Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2952)

Unified Diff: chrome/browser/themes/theme_service.cc

Issue 23614007: Use the normal Google logo for managed users for --enable-instant-extended-api (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed mac compile failure Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 056b9dc194e010ed2f7f213b5f98d71151a53342..f51a4a64f8d7cd35ee655326f883793ecd222503 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -169,11 +169,22 @@ SkColor ThemeService::GetColor(int id) const {
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;
+ }
+
+ 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, result);
+ return Properties::GetDefaultDisplayProperty(id);
}
bool ThemeService::ShouldUseNativeFrame() const {
@@ -200,8 +211,7 @@ base::RefCountedMemory* ThemeService::GetRawData(
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 @@ void ThemeService::SetNativeTheme() {
bool ThemeService::UsingDefaultTheme() const {
std::string id = GetThemeID();
return id == ThemeService::kDefaultThemeID ||
- (id == kDefaultThemeGalleryID && !IsManagedUser());
+ id == kDefaultThemeGalleryID;
}
bool ThemeService::UsingNativeTheme() const {
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698