OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |