This CL makes managed users use the normal Google logo on the --enable-instant-extended-api NTP.
I also changed the signature of ui::ThemeProvider::GetDisplayProperty() because most of the callers were ignoring the return value. In some cases we were using uninitialized variables because of this.
BUG=279978
TEST=Manual, see bug
R=erg
TBR=sky (For trivial refactor)
Review URL: https://chromiumcodereview.appspot.com/23614007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220537 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 056b9dc..f51a4a6 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -169,11 +169,22 @@
return Properties::GetDefaultColor(id);
}
-bool ThemeService::GetDisplayProperty(int id, int* result) const {
- if (theme_supplier_.get())
- return theme_supplier_->GetDisplayProperty(id, result);
+int ThemeService::GetDisplayProperty(int id) const {
+ int result = 0;
+ if (theme_supplier_.get() &&
+ theme_supplier_->GetDisplayProperty(id, &result)) {
+ return result;
+ }
- return Properties::GetDefaultDisplayProperty(id, result);
+ if (id == Properties::NTP_LOGO_ALTERNATE &&
+ !UsingDefaultTheme() &&
+ !UsingNativeTheme()) {
+ // Use the alternate logo for themes from the web store except for
+ // |kDefaultThemeGalleryID|.
+ return 1;
+ }
+
+ return Properties::GetDefaultDisplayProperty(id);
}
bool ThemeService::ShouldUseNativeFrame() const {
@@ -200,8 +211,7 @@
int id,
ui::ScaleFactor scale_factor) const {
// Check to see whether we should substitute some images.
- int ntp_alternate;
- GetDisplayProperty(Properties::NTP_LOGO_ALTERNATE, &ntp_alternate);
+ int ntp_alternate = GetDisplayProperty(Properties::NTP_LOGO_ALTERNATE);
if (id == IDR_PRODUCT_LOGO && ntp_alternate != 0)
id = IDR_PRODUCT_LOGO_WHITE;
@@ -364,7 +374,7 @@
bool ThemeService::UsingDefaultTheme() const {
std::string id = GetThemeID();
return id == ThemeService::kDefaultThemeID ||
- (id == kDefaultThemeGalleryID && !IsManagedUser());
+ id == kDefaultThemeGalleryID;
}
bool ThemeService::UsingNativeTheme() const {