From dff6d13ca6ddb778867ce2d731d5f8093aef28ea Mon Sep 17 00:00:00 2001 From: "glen@chromium.org" Date: Fri, 15 May 2009 22:40:57 +0000 Subject: 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 --- chrome/browser/dom_ui/new_tab_ui.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chrome/browser/dom_ui/new_tab_ui.cc') 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); -- cgit v1.1