| Index: chrome/browser/dom_ui/new_tab_ui.cc
|
| ===================================================================
|
| --- chrome/browser/dom_ui/new_tab_ui.cc (revision 27540)
|
| +++ chrome/browser/dom_ui/new_tab_ui.cc (working copy)
|
| @@ -1680,11 +1680,7 @@
|
|
|
| // In testing mode there may not be an I/O thread.
|
| if (g_browser_process->io_thread()) {
|
| - g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
|
| - NewRunnableMethod(&chrome_url_data_manager,
|
| - &ChromeURLDataManager::AddDataSource,
|
| - new DOMUIThemeSource(GetProfile())));
|
| -
|
| + InitializeCSSCaches();
|
| NewTabHTMLSource* html_source = new NewTabHTMLSource(GetProfile());
|
| g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
|
| NewRunnableMethod(&chrome_url_data_manager,
|
| @@ -1708,6 +1704,7 @@
|
| const NotificationSource& source,
|
| const NotificationDetails& details) {
|
| if (NotificationType::BROWSER_THEME_CHANGED == type) {
|
| + InitializeCSSCaches();
|
| CallJavascriptFunction(L"themeChanged");
|
| } else if (NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED) {
|
| if (GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar))
|
| @@ -1717,6 +1714,16 @@
|
| }
|
| }
|
|
|
| +void NewTabUI::InitializeCSSCaches() {
|
| + // In testing mode there may not be an I/O thread.
|
| + if (g_browser_process->io_thread()) {
|
| + g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
|
| + NewRunnableMethod(&chrome_url_data_manager,
|
| + &ChromeURLDataManager::AddDataSource,
|
| + new DOMUIThemeSource(GetProfile())));
|
| + }
|
| +}
|
| +
|
| // static
|
| void NewTabUI::RegisterUserPrefs(PrefService* prefs) {
|
| MostVisitedHandler::RegisterUserPrefs(prefs);
|
|
|