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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed style nit Created 8 years, 8 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/ui/webui/ntp/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 547f347c0765c69c40ec2592059af75f0e350acd..a731c10bc8fb3fec0218d0ef3393f4b65b27bb53 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h"
#include "chrome/browser/ui/webui/ntp/foreign_session_handler.h"
@@ -159,7 +160,9 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
// ChromeURLDataManager assumes the ownership of the html_source and in some
// tests immediately deletes it, so html_source should not be accessed after
// this call.
- GetProfile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = GetProfile();
+ ChromeURLDataManagerFactory::GetForProfile(profile)->
+ AddDataSource(html_source);
pref_change_registrar_.Init(GetProfile()->GetPrefs());
pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
@@ -260,7 +263,7 @@ void NewTabUI::InitializeCSSCaches() {
#if defined(ENABLE_THEMES)
Profile* profile = GetProfile();
ThemeSource* theme = new ThemeSource(profile);
- profile->GetChromeURLDataManager()->AddDataSource(theme);
+ ChromeURLDataManagerFactory::GetForProfile(profile)->AddDataSource(theme);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698