summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 03:26:31 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 03:26:31 +0000
commitfea45336e484410b790467bfc0314cd4218f39f0 (patch)
treefb1a5acacccca1c617b79e17c9f587c73e65674e /chrome
parentfa23bd53f70490619439cee296e084d739c15aa1 (diff)
downloadchromium_src-fea45336e484410b790467bfc0314cd4218f39f0.zip
chromium_src-fea45336e484410b790467bfc0314cd4218f39f0.tar.gz
chromium_src-fea45336e484410b790467bfc0314cd4218f39f0.tar.bz2
Set the details field of the BROWSER_THEME_CHANGED notification to
the relevant Extension*. BUG=none TEST=manual Review URL: http://codereview.chromium.org/1117008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_theme_provider.cc10
-rw-r--r--chrome/browser/browser_theme_provider.h4
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc8
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.h2
4 files changed, 14 insertions, 10 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc
index fabeb9c..f4f536bf 100644
--- a/chrome/browser/browser_theme_provider.cc
+++ b/chrome/browser/browser_theme_provider.cc
@@ -21,7 +21,9 @@
#include "chrome/browser/theme_resources_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/notification_details.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
#include "gfx/codec/png_codec.h"
@@ -292,7 +294,7 @@ void BrowserThemeProvider::SetTheme(Extension* extension) {
BuildFromExtension(extension);
SaveThemeID(extension->id());
- NotifyThemeChanged();
+ NotifyThemeChanged(extension);
UserMetrics::RecordAction("Themes_Installed", profile_);
}
@@ -317,7 +319,7 @@ void BrowserThemeProvider::RemoveUnusedThemes() {
void BrowserThemeProvider::UseDefaultTheme() {
ClearAllThemeData();
- NotifyThemeChanged();
+ NotifyThemeChanged(NULL);
UserMetrics::RecordAction("Themes_Reset", profile_);
}
@@ -561,12 +563,12 @@ void BrowserThemeProvider::LoadThemePrefs() {
}
}
-void BrowserThemeProvider::NotifyThemeChanged() {
+void BrowserThemeProvider::NotifyThemeChanged(Extension* extension) {
// Redraw!
NotificationService* service = NotificationService::current();
service->Notify(NotificationType::BROWSER_THEME_CHANGED,
Source<BrowserThemeProvider>(this),
- NotificationService::NoDetails());
+ Details<Extension>(extension));
#if defined(OS_MACOSX)
NotifyPlatformThemeChanged();
#endif // OS_MACOSX
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h
index 8ef628e..0af39cb 100644
--- a/chrome/browser/browser_theme_provider.h
+++ b/chrome/browser/browser_theme_provider.h
@@ -206,7 +206,9 @@ class BrowserThemeProvider : public NonThreadSafe,
virtual void LoadThemePrefs();
// Let all the browser views know that themes have changed.
- virtual void NotifyThemeChanged();
+ // extension is NULL iff the theme is being set to the
+ // default/system theme.
+ virtual void NotifyThemeChanged(Extension* extension);
#if defined(OS_MACOSX)
// Let all the browser views know that themes have changed in a platform way.
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 7438bbf..4227724 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -195,7 +195,7 @@ void GtkThemeProvider::SetNativeTheme() {
profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, true);
ClearAllThemeData();
LoadGtkValues();
- NotifyThemeChanged();
+ NotifyThemeChanged(NULL);
}
void GtkThemeProvider::Observe(NotificationType type,
@@ -395,8 +395,8 @@ void GtkThemeProvider::LoadThemePrefs() {
}
}
-void GtkThemeProvider::NotifyThemeChanged() {
- BrowserThemeProvider::NotifyThemeChanged();
+void GtkThemeProvider::NotifyThemeChanged(Extension* extension) {
+ BrowserThemeProvider::NotifyThemeChanged(extension);
// Notify all GtkChromeButtons of their new rendering mode:
for (std::vector<GtkWidget*>::iterator it = chrome_buttons_.begin();
@@ -424,7 +424,7 @@ void GtkThemeProvider::OnStyleSet(GtkWidget* widget,
if (provider->profile()->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) {
provider->ClearAllThemeData();
provider->LoadGtkValues();
- provider->NotifyThemeChanged();
+ provider->NotifyThemeChanged(NULL);
}
// Free the old icons only after the theme change notification has gone
diff --git a/chrome/browser/gtk/gtk_theme_provider.h b/chrome/browser/gtk/gtk_theme_provider.h
index 8e40d6f..b7310ca 100644
--- a/chrome/browser/gtk/gtk_theme_provider.h
+++ b/chrome/browser/gtk/gtk_theme_provider.h
@@ -119,7 +119,7 @@ class GtkThemeProvider : public BrowserThemeProvider,
virtual void LoadThemePrefs();
// Let all the browser views know that themes have changed.
- virtual void NotifyThemeChanged();
+ virtual void NotifyThemeChanged(Extension* extension);
// Additionally frees the CairoCachedSurfaces.
virtual void FreePlatformCaches();