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

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

Issue 6532033: Disable "Reset to Default theme"/"Use classic theme" correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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/browser_theme_provider.cc
diff --git a/chrome/browser/themes/browser_theme_provider.cc b/chrome/browser/themes/browser_theme_provider.cc
index 87a73aa22982a7883c6891ed70765388de35094d..0d118a565ef885f5599f103e00d1bf61f17c9595 100644
--- a/chrome/browser/themes/browser_theme_provider.cc
+++ b/chrome/browser/themes/browser_theme_provider.cc
@@ -35,11 +35,18 @@ const char* BrowserThemeProvider::kTilingRepeatX = "repeat-x";
const char* BrowserThemeProvider::kTilingRepeatY = "repeat-y";
const char* BrowserThemeProvider::kTilingRepeat = "repeat";
-// Saved default values.
+// The default theme if we haven't installed a theme yet or if we've clicked
+// the "Use Classic" button.
const char* BrowserThemeProvider::kDefaultThemeID = "";
namespace {
+// The default theme if we've gone to the theme gallery and installed the
+// "Default" theme. We have to detect this case specifically. (By the time we
+// realize we've installed the default theme, we already have an extension
+// unpacked on the filesystem.)
+const char* kDefatulThemeGalleryID = "hkacjpbfdknhflllbcmjibkdeoafencn";
Miranda Callahan 2011/02/17 21:41:46 s/fatul/fault ;-)
+
SkColor TintForUnderline(SkColor input) {
return SkColorSetA(input, SkColorGetA(input) / 3);
}
@@ -331,7 +338,9 @@ void BrowserThemeProvider::SetNativeTheme() {
}
bool BrowserThemeProvider::UsingDefaultTheme() {
- return GetThemeID() == BrowserThemeProvider::kDefaultThemeID;
+ std::string id = GetThemeID();
+ return id == BrowserThemeProvider::kDefaultThemeID ||
+ id == kDefatulThemeGalleryID;
Miranda Callahan 2011/02/17 21:41:46 I actually kind of like the word "Defatul," but st
Evan Stade 2011/02/17 22:13:17 I wonder, how do you pronounce it?
}
std::string BrowserThemeProvider::GetThemeID() const {
« no previous file with comments | « chrome/browser/dom_ui/options/personal_options_handler.cc ('k') | chrome/browser/ui/gtk/options/content_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698