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

Side by Side Diff: chrome/browser/ui/webui/flags_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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/flags_ui.h" 5 #include "chrome/browser/ui/webui/flags_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/about_flags.h" 13 #include "chrome/browser/about_flags.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/prefs/pref_service.h" 15 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
18 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
18 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
19 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
20 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
21 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
22 #include "content/public/browser/web_ui.h" 23 #include "content/public/browser/web_ui.h"
23 #include "content/public/browser/web_ui_message_handler.h" 24 #include "content/public/browser/web_ui_message_handler.h"
24 #include "grit/browser_resources.h" 25 #include "grit/browser_resources.h"
25 #include "grit/chromium_strings.h" 26 #include "grit/chromium_strings.h"
26 #include "grit/generated_resources.h" 27 #include "grit/generated_resources.h"
27 #include "grit/theme_resources_standard.h" 28 #include "grit/theme_resources_standard.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // 155 //
155 // FlagsUI 156 // FlagsUI
156 // 157 //
157 /////////////////////////////////////////////////////////////////////////////// 158 ///////////////////////////////////////////////////////////////////////////////
158 159
159 FlagsUI::FlagsUI(content::WebUI* web_ui) : WebUIController(web_ui) { 160 FlagsUI::FlagsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
160 web_ui->AddMessageHandler(new FlagsDOMHandler()); 161 web_ui->AddMessageHandler(new FlagsDOMHandler());
161 162
162 // Set up the about:flags source. 163 // Set up the about:flags source.
163 Profile* profile = Profile::FromWebUI(web_ui); 164 Profile* profile = Profile::FromWebUI(web_ui);
164 profile->GetChromeURLDataManager()->AddDataSource(CreateFlagsUIHTMLSource()); 165 ChromeURLDataManagerFactory::GetForProfile(profile)->
166 AddDataSource(CreateFlagsUIHTMLSource());
165 } 167 }
166 168
167 // static 169 // static
168 RefCountedMemory* FlagsUI::GetFaviconResourceBytes() { 170 RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
169 return ResourceBundle::GetSharedInstance(). 171 return ResourceBundle::GetSharedInstance().
170 LoadDataResourceBytes(IDR_FLAGS); 172 LoadDataResourceBytes(IDR_FLAGS);
171 } 173 }
172 174
173 // static 175 // static
174 void FlagsUI::RegisterPrefs(PrefService* prefs) { 176 void FlagsUI::RegisterPrefs(PrefService* prefs) {
175 prefs->RegisterListPref(prefs::kEnabledLabsExperiments); 177 prefs->RegisterListPref(prefs::kEnabledLabsExperiments);
176 } 178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698