summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/new_tab_ui.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 22:40:57 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 22:40:57 +0000
commitdff6d13ca6ddb778867ce2d731d5f8093aef28ea (patch)
tree4758c346a2af607ec2a842c24f222e8fc401b6a8 /chrome/browser/dom_ui/new_tab_ui.cc
parent05062e288e4b8f174a79cc698c3c97d7d12975be (diff)
downloadchromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.zip
chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.gz
chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.bz2
Re-land of earlier NTP theme patch; now with mac and linux compatibility.
Review URL: http://codereview.chromium.org/115413 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/new_tab_ui.cc')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index f5865a2..449c605 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -1172,11 +1172,27 @@ NewTabUI::NewTabUI(TabContents* contents)
html_source));
}
}
+
+ // Listen for theme installation.
+ NotificationService::current()->AddObserver(this,
+ NotificationType::THEME_INSTALLED, NotificationService::AllSources());
}
NewTabUI::~NewTabUI() {
+ // Remove theme observer.
+ NotificationService::current()->RemoveObserver(this,
+ NotificationType::THEME_INSTALLED, NotificationService::AllSources());
+}
+
+void NewTabUI::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ if (NotificationType::THEME_INSTALLED == type) {
+ CallJavascriptFunction(L"themeChanged");
+ }
}
+
// static
void NewTabUI::RegisterUserPrefs(PrefService* prefs) {
MostVisitedHandler::RegisterUserPrefs(prefs);