diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-27 23:54:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-27 23:54:53 +0000 |
commit | 24ea7a17338ce6ed2621aeaeb5542edf5b07d098 (patch) | |
tree | fdbf45cf0ba6af23069b542d5491867da692d980 /chrome/browser/ui/webui | |
parent | d017a7046c34bb37a980e0a1a4fd20ec44ba7c78 (diff) | |
download | chromium_src-24ea7a17338ce6ed2621aeaeb5542edf5b07d098.zip chromium_src-24ea7a17338ce6ed2621aeaeb5542edf5b07d098.tar.gz chromium_src-24ea7a17338ce6ed2621aeaeb5542edf5b07d098.tar.bz2 |
Stop using content's internal URLDataManager methods from chrome.
BUG=169170
Review URL: https://codereview.chromium.org/12077017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui')
73 files changed, 218 insertions, 289 deletions
diff --git a/chrome/browser/ui/webui/DEPS b/chrome/browser/ui/webui/DEPS index b543703..6461fcc 100644 --- a/chrome/browser/ui/webui/DEPS +++ b/chrome/browser/ui/webui/DEPS @@ -4,10 +4,6 @@ include_rules = [ "+sync/js", "+sync/internal_api/public/util/weak_handle.h", - - # TODO(jam): temporary http://crbug.com/169170 - "+content/browser/webui/web_ui_data_source.h", - "+content/browser/webui/url_data_manager.h", # Other libraries. "+device/bluetooth", diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc index 9656319..2bb654e 100644 --- a/chrome/browser/ui/webui/about_ui.cc +++ b/chrome/browser/ui/webui/about_ui.cc @@ -37,13 +37,13 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser_dialogs.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "content/public/common/process_type.h" @@ -1061,9 +1061,8 @@ AboutUI::AboutUI(content::WebUI* web_ui, const std::string& name) #if defined(ENABLE_THEMES) // Set up the chrome://theme/ source. ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); #endif - ChromeURLDataManager::AddDataSource( - profile, new AboutUIHTMLSource(name, profile)); + content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); } diff --git a/chrome/browser/ui/webui/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks_ui.cc index 2ad5893..a65dc82 100644 --- a/chrome/browser/ui/webui/bookmarks_ui.cc +++ b/chrome/browser/ui/webui/bookmarks_ui.cc @@ -7,8 +7,8 @@ #include "base/memory/ref_counted_memory.h" #include "base/message_loop.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/url_constants.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_ui.h" #include "grit/theme_resources.h" #include "ui/base/resource/resource_bundle.h" @@ -55,7 +55,7 @@ BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://bookmarks/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); } // static diff --git a/chrome/browser/ui/webui/certificate_viewer_ui.cc b/chrome/browser/ui/webui/certificate_viewer_ui.cc index 32f40c4..4ebb98d 100644 --- a/chrome/browser/ui/webui/certificate_viewer_ui.cc +++ b/chrome/browser/ui/webui/certificate_viewer_ui.cc @@ -5,11 +5,10 @@ #include "chrome/browser/ui/webui/certificate_viewer_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -17,7 +16,7 @@ CertificateViewerUI::CertificateViewerUI(content::WebUI* web_ui) : ConstrainedWebDialogUI(web_ui) { // Set up the chrome://view-cert source. content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUICertificateViewerHost); + content::WebUIDataSource::Create(chrome::kChromeUICertificateViewerHost); // Localized strings. html_source->SetUseJsonJSFormatV2(); @@ -59,7 +58,7 @@ CertificateViewerUI::CertificateViewerUI(content::WebUI* web_ui) html_source->SetDefaultResource(IDR_CERTIFICATE_VIEWER_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } CertificateViewerUI::~CertificateViewerUI() { diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.h b/chrome/browser/ui/webui/chrome_url_data_manager.h deleted file mode 100644 index 6bb8630..0000000 --- a/chrome/browser/ui/webui/chrome_url_data_manager.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// temporary forwarding header -#include "content/browser/webui/url_data_manager.h" diff --git a/chrome/browser/ui/webui/chrome_web_ui_data_source.h b/chrome/browser/ui/webui/chrome_web_ui_data_source.h deleted file mode 100644 index 64f42ae..0000000 --- a/chrome/browser/ui/webui/chrome_web_ui_data_source.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// temporary forwarding header -#include "content/browser/webui/web_ui_data_source.h" diff --git a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.cc b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.cc index 8aa1d68..cc8e7498 100644 --- a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.cc +++ b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.cc @@ -6,11 +6,11 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h" #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" using content::WebContents; @@ -32,7 +32,7 @@ BluetoothPairingUI::BluetoothPairingUI(content::WebUI* web_ui) web_ui->AddMessageHandler(bluetooth_handler_); content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIBluetoothPairingHost); + content::WebUIDataSource::Create(chrome::kChromeUIBluetoothPairingHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedStrings(localized_strings); source->SetJsonPath("strings.js"); @@ -40,7 +40,7 @@ BluetoothPairingUI::BluetoothPairingUI(content::WebUI* web_ui) source->DisableContentSecurityPolicy(); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); } BluetoothPairingUI::~BluetoothPairingUI() { diff --git a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc index b62117b..5c638f2 100644 --- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc +++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc @@ -16,11 +16,10 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -49,8 +48,8 @@ const char kStatusProperty[] = "status"; const char kTechnologyProperty[] = "technology"; content::WebUIDataSource* CreateChooseMobileNetworkUIHTMLSource() { - content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIChooseMobileNetworkHost); + content::WebUIDataSource* source = content::WebUIDataSource::Create( + chrome::kChromeUIChooseMobileNetworkHost); source->AddLocalizedString("chooseNetworkTitle", IDS_NETWORK_CHOOSE_MOBILE_NETWORK); @@ -215,7 +214,7 @@ ChooseMobileNetworkUI::ChooseMobileNetworkUI(content::WebUI* web_ui) web_ui->AddMessageHandler(handler); // Set up the "chrome://choose-mobile-network" source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource( + content::WebUIDataSource::Add( profile, CreateChooseMobileNetworkUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc b/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc index 7c14c16..9b8465c 100644 --- a/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc +++ b/chrome/browser/ui/webui/chromeos/cryptohome_ui.cc @@ -5,10 +5,10 @@ #include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" namespace chromeos { @@ -18,7 +18,7 @@ namespace { // Returns HTML data source for chrome://cryptohome. content::WebUIDataSource* CreateCryptohomeUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUICryptohomeHost); + content::WebUIDataSource::Create(chrome::kChromeUICryptohomeHost); source->AddResourcePath("cryptohome.js", IDR_CRYPTOHOME_JS); source->SetDefaultResource(IDR_CRYPTOHOME_HTML); return source; @@ -30,8 +30,7 @@ CryptohomeUI::CryptohomeUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->AddMessageHandler(new CryptohomeWebUIHandler()); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateCryptohomeUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateCryptohomeUIHTMLSource()); } } // namespace chromeos diff --git a/chrome/browser/ui/webui/chromeos/diagnostics/diagnostics_ui.cc b/chrome/browser/ui/webui/chromeos/diagnostics/diagnostics_ui.cc index f541e42..e891a16 100644 --- a/chrome/browser/ui/webui/chromeos/diagnostics/diagnostics_ui.cc +++ b/chrome/browser/ui/webui/chromeos/diagnostics/diagnostics_ui.cc @@ -7,12 +7,13 @@ #include "base/bind.h" #include "base/json/json_reader.h" #include "base/memory/weak_ptr.h" +#include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "chromeos/dbus/debug_daemon_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -136,7 +137,7 @@ DiagnosticsUI::DiagnosticsUI(content::WebUI* web_ui) web_ui->AddMessageHandler(new DiagnosticsWebUIHandler()); content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIDiagnosticsHost); + content::WebUIDataSource::Create(chrome::kChromeUIDiagnosticsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("main.css", IDR_DIAGNOSTICS_MAIN_CSS); source->AddResourcePath("main.js", IDR_DIAGNOSTICS_MAIN_JS); @@ -178,7 +179,7 @@ DiagnosticsUI::DiagnosticsUI(content::WebUI* web_ui) source->SetDefaultResource(IDR_DIAGNOSTICS_MAIN_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); } } // namespace chromeos diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc index 7fd2dce..10b3646 100644 --- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc +++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc @@ -29,12 +29,12 @@ #include "chrome/browser/google_apis/time_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" @@ -684,13 +684,13 @@ DriveInternalsUI::DriveInternalsUI(content::WebUI* web_ui) web_ui->AddMessageHandler(new DriveInternalsWebUIHandler()); content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); } } // namespace chromeos diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc index dc3ce9d..112b0ec 100644 --- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc +++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc @@ -12,11 +12,10 @@ #include "base/values.h" #include "chrome/browser/chromeos/imageburner/burn_controller.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -41,7 +40,7 @@ const char kMoreInfoLink[] = content::WebUIDataSource* CreateImageburnerUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIImageBurnerHost); + content::WebUIDataSource::Create(chrome::kChromeUIImageBurnerHost); source->AddLocalizedString("headerTitle", IDS_IMAGEBURN_HEADER_TITLE); source->AddLocalizedString("headerDescription", @@ -329,6 +328,6 @@ ImageBurnUI::ImageBurnUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->AddMessageHandler(handler); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource( + content::WebUIDataSource::Add( profile, chromeos::imageburner::CreateImageburnerUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc index 8e6df36..333273a 100644 --- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc +++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc @@ -15,8 +15,6 @@ #include "chrome/browser/chromeos/input_method/xkeyboard.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -24,6 +22,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -237,7 +236,7 @@ std::string ModifierKeyToLabel(ModifierKey modifier) { content::WebUIDataSource* CreateKeyboardOverlayUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIKeyboardOverlayHost); + content::WebUIDataSource::Create(chrome::kChromeUIKeyboardOverlayHost); for (size_t i = 0; i < arraysize(kI18nContentToMessage); ++i) { source->AddLocalizedString(kI18nContentToMessage[i].i18n_content, @@ -366,6 +365,5 @@ KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) web_ui->AddMessageHandler(handler); // Set up the chrome://keyboardoverlay/ source. - ChromeURLDataManager::AddWebUIDataSource( - profile, CreateKeyboardOverlayUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index d915602..8a46929 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc @@ -20,7 +20,6 @@ #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/about_ui.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" @@ -206,21 +205,21 @@ OobeUI::OobeUI(content::WebUI* web_ui) Profile* profile = Profile::FromWebUI(web_ui); // Set up the chrome://theme/ source, for Chrome logo. ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); // Set up the chrome://terms/ data source, for EULA content. AboutUIHTMLSource* about_source = new AboutUIHTMLSource(chrome::kChromeUITermsHost, profile); - ChromeURLDataManager::AddDataSource(profile, about_source); + content::URLDataSource::Add(profile, about_source); // Set up the chrome://oobe/ source. OobeUIHTMLSource* html_source = new OobeUIHTMLSource(localized_strings); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); // Set up the chrome://userimage/ source. options::UserImageSource* user_image_source = new options::UserImageSource(); - ChromeURLDataManager::AddDataSource(profile, user_image_source); + content::URLDataSource::Add(profile, user_image_source); } OobeUI::~OobeUI() { diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc index 0b88373..477342a 100644 --- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc +++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc @@ -25,7 +25,6 @@ #include "chrome/browser/chromeos/mobile/mobile_activator.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -347,7 +346,7 @@ MobileSetupUI::MobileSetupUI(content::WebUI* web_ui) // Set up the chrome://mobilesetup/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); } void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc index f8f840b..e4b8e17 100644 --- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc +++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc @@ -99,7 +99,7 @@ ProxySettingsUI::ProxySettingsUI(content::WebUI* web_ui) ProxySettingsHTMLSource* source = new ProxySettingsHTMLSource(localized_strings); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, source); + content::URLDataSource::Add(profile, source); } ProxySettingsUI::~ProxySettingsUI() { diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc index e0f9047..bc2b6dd 100644 --- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc +++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc @@ -24,7 +24,6 @@ #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/chromeos/version_loader.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/url_constants.h" #include "content/public/browser/url_data_source.h" @@ -295,5 +294,5 @@ RegisterPageUI::RegisterPageUI(content::WebUI* web_ui) // Set up the chrome://register/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); } diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc index ce8ea88..d23f04e 100644 --- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc +++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc @@ -18,7 +18,6 @@ #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/sim_dialog_delegate.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" @@ -684,7 +683,7 @@ SimUnlockUI::SimUnlockUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://sim-unlock/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); } } // namespace chromeos diff --git a/chrome/browser/ui/webui/chromeos/system_info_ui.cc b/chrome/browser/ui/webui/chromeos/system_info_ui.cc index 0ec8b9a..04502c9 100644 --- a/chrome/browser/ui/webui/chromeos/system_info_ui.cc +++ b/chrome/browser/ui/webui/chromeos/system_info_ui.cc @@ -21,7 +21,6 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/system_logs/system_logs_fetcher.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/url_constants.h" #include "content/public/browser/url_data_source.h" @@ -190,7 +189,7 @@ SystemInfoUI::SystemInfoUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://system/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); } } // namespace chromeos diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc index 43b68ae..fae49c9 100644 --- a/chrome/browser/ui/webui/conflicts_ui.cc +++ b/chrome/browser/ui/webui/conflicts_ui.cc @@ -16,8 +16,6 @@ #include "base/values.h" #include "chrome/browser/enumerate_modules_model_win.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/url_constants.h" #include "content/public/browser/notification_observer.h" @@ -26,6 +24,7 @@ #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -43,7 +42,7 @@ namespace { content::WebUIDataSource* CreateConflictsUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIConflictsHost); + content::WebUIDataSource::Create(chrome::kChromeUIConflictsHost); source->AddLocalizedString("loadingMessage", IDS_CONFLICTS_LOADING_MESSAGE); source->AddLocalizedString("modulesLongTitle", @@ -167,8 +166,7 @@ ConflictsUI::ConflictsUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the about:conflicts source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateConflictsUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateConflictsUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc index 72c6ae6f..73a0bff 100644 --- a/chrome/browser/ui/webui/crashes_ui.cc +++ b/chrome/browser/ui/webui/crashes_ui.cc @@ -16,13 +16,12 @@ #include "chrome/browser/crash_upload_list.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -42,7 +41,7 @@ namespace { content::WebUIDataSource* CreateCrashesUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUICrashesHost); + content::WebUIDataSource::Create(chrome::kChromeUICrashesHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("crashesTitle", IDS_CRASHES_TITLE); @@ -165,8 +164,7 @@ CrashesUI::CrashesUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://crashes/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateCrashesUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateCrashesUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc index e57c3a0..341e6cf 100644 --- a/chrome/browser/ui/webui/devtools_ui.cc +++ b/chrome/browser/ui/webui/devtools_ui.cc @@ -11,7 +11,6 @@ #include "base/string_util.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/devtools_client_host.h" @@ -104,15 +103,15 @@ void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); static bool registered = false; if (!registered) { - ChromeURLDataManager::AddDataSource(profile, new DevToolsDataSource); + content::URLDataSource::Add(profile, new DevToolsDataSource); registered = true; } } DevToolsUI::DevToolsUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->SetBindings(0); - ChromeURLDataManager::AddDataSource( - Profile::FromWebUI(web_ui), new DevToolsDataSource); + content::URLDataSource::Add(Profile::FromWebUI(web_ui), + new DevToolsDataSource); } void DevToolsUI::RenderViewCreated( diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc index 4037f64..f810ad1 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler.cc @@ -31,13 +31,13 @@ #include "chrome/browser/download/download_util.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/fileicon_source.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_item.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "grit/generated_resources.h" @@ -209,7 +209,7 @@ DownloadsDOMHandler::DownloadsDOMHandler(content::DownloadManager* dlm) ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { // Create our fileicon data source. Profile* profile = Profile::FromBrowserContext(dlm->GetBrowserContext()); - ChromeURLDataManager::AddDataSource(profile, new FileIconSource()); + content::URLDataSource::Add(profile, new FileIconSource()); if (profile->IsOffTheRecord()) { original_notifier_.reset(new AllDownloadItemNotifier( diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc index 6fd041b..2ec81e4 100644 --- a/chrome/browser/ui/webui/downloads_ui.cc +++ b/chrome/browser/ui/webui/downloads_ui.cc @@ -13,14 +13,14 @@ #include "chrome/browser/download/download_service.h" #include "chrome/browser/download/download_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/downloads_dom_handler.h" #include "chrome/browser/ui/webui/theme_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/download_manager.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -34,7 +34,7 @@ namespace { content::WebUIDataSource* CreateDownloadsUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIDownloadsHost); + content::WebUIDataSource::Create(chrome::kChromeUIDownloadsHost); source->AddLocalizedString("title", IDS_DOWNLOAD_TITLE); source->AddLocalizedString("searchbutton", IDS_DOWNLOAD_SEARCH_BUTTON); @@ -97,10 +97,10 @@ DownloadsUI::DownloadsUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://downloads/ source. content::WebUIDataSource* source = CreateDownloadsUIHTMLSource(); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); #if defined(ENABLE_THEMES) ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); #endif } diff --git a/chrome/browser/ui/webui/extensions/extension_activity_ui.cc b/chrome/browser/ui/webui/extensions/extension_activity_ui.cc index 95ee0ed..0ed189c 100644 --- a/chrome/browser/ui/webui/extensions/extension_activity_ui.cc +++ b/chrome/browser/ui/webui/extensions/extension_activity_ui.cc @@ -7,12 +7,11 @@ #include "base/bind.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -24,7 +23,7 @@ ExtensionActivityUI::ExtensionActivityUI(content::WebUI* web_ui) IDS_EXTENSION_ACTIVITY_TITLE)); content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost); + content::WebUIDataSource::Create(chrome::kChromeUIExtensionActivityHost); // Localized strings. source->AddLocalizedString("extensionActivity", IDS_EXTENSION_ACTIVITY_TITLE); @@ -41,7 +40,7 @@ ExtensionActivityUI::ExtensionActivityUI(content::WebUI* web_ui) source->AddResourcePath("extension_activity.js", IDR_EXTENSION_ACTIVITY_JS); source->SetDefaultResource(IDR_EXTENSION_ACTIVITY_HTML); profile_ = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile_, source); + content::WebUIDataSource::Add(profile_, source); // Callback handlers. web_ui->RegisterMessageCallback("requestExtensionData", base::Bind(&ExtensionActivityUI::HandleRequestExtensionData, diff --git a/chrome/browser/ui/webui/extensions/extension_info_ui.cc b/chrome/browser/ui/webui/extensions/extension_info_ui.cc index c58d453..7e892e0 100644 --- a/chrome/browser/ui/webui/extensions/extension_info_ui.cc +++ b/chrome/browser/ui/webui/extensions/extension_info_ui.cc @@ -12,19 +12,19 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" ExtensionInfoUI::ExtensionInfoUI(content::WebUI* web_ui, const GURL& url) : content::WebUIController(web_ui), - source_(ChromeWebUIDataSource::Create( + source_(content::WebUIDataSource::Create( chrome::kChromeUIExtensionInfoHost)) { AddExtensionDataToSource(url.path().substr(1)); @@ -40,7 +40,7 @@ ExtensionInfoUI::ExtensionInfoUI(content::WebUI* web_ui, const GURL& url) source_->SetDefaultResource(IDR_EXTENSION_INFO_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, source_); + content::WebUIDataSource::Add(profile, source_); } ExtensionInfoUI::~ExtensionInfoUI() { diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc index fe8401a..fb01ce3 100644 --- a/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc @@ -5,8 +5,6 @@ #include "chrome/browser/ui/webui/extensions/extensions_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/extensions/command_handler.h" #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" #include "chrome/browser/ui/webui/extensions/install_extension_handler.h" @@ -14,13 +12,14 @@ #include "chrome/browser/ui/webui/generic_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" namespace { content::WebUIDataSource* CreateExtensionsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIExtensionsFrameHost); + content::WebUIDataSource::Create(chrome::kChromeUIExtensionsFrameHost); source->SetUseJsonJSFormatV2(); source->SetJsonPath("strings.js"); @@ -58,7 +57,7 @@ ExtensionsUI::ExtensionsUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->AddMessageHandler(install_extension_handler); web_ui->AddMessageHandler(new GenericHandler()); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); } ExtensionsUI::~ExtensionsUI() { diff --git a/chrome/browser/ui/webui/feedback_ui.cc b/chrome/browser/ui/webui/feedback_ui.cc index bd87eca..462e608 100644 --- a/chrome/browser/ui/webui/feedback_ui.cc +++ b/chrome/browser/ui/webui/feedback_ui.cc @@ -33,8 +33,6 @@ #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/singleton_tabs.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/screenshot_source.h" #include "chrome/browser/ui/window_snapshot/window_snapshot.h" #include "chrome/common/cancelable_task_tracker.h" @@ -44,8 +42,10 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -295,7 +295,7 @@ class FeedbackHandler : public WebUIMessageHandler, content::WebUIDataSource* CreateFeedbackUIHTMLSource(bool successful_init) { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIFeedbackHost); + content::WebUIDataSource::Create(chrome::kChromeUIFeedbackHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("title", IDS_FEEDBACK_TITLE); @@ -377,8 +377,7 @@ void FeedbackHandler::ClobberScreenshotsSource() { // setting the screenshot to NULL, effectively disabling the source // TODO(rkc): Once there is a method to 'remove' a source, change this code Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext()); - ChromeURLDataManager::AddDataSource(profile, - new ScreenshotSource(NULL, profile)); + content::URLDataSource::Add(profile, new ScreenshotSource(NULL, profile)); FeedbackUtil::ClearScreenshotPng(); } @@ -388,7 +387,7 @@ void FeedbackHandler::SetupScreenshotsSource() { screenshot_source_ = new ScreenshotSource(FeedbackUtil::GetScreenshotPng(), profile); // Add the source to the data manager. - ChromeURLDataManager::AddDataSource(profile, screenshot_source_); + content::URLDataSource::Add(profile, screenshot_source_); } bool FeedbackHandler::Init() { @@ -725,7 +724,7 @@ FeedbackUI::FeedbackUI(content::WebUI* web_ui) // Set up the chrome://feedback/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } #if defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index 31059fc..78cee4c 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc @@ -16,12 +16,11 @@ #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -43,7 +42,7 @@ namespace { content::WebUIDataSource* CreateFlagsUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIFlagsHost); + content::WebUIDataSource::Create(chrome::kChromeUIFlagsHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("flagsLongTitle", IDS_FLAGS_LONG_TITLE); @@ -163,7 +162,7 @@ FlagsUI::FlagsUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the about:flags source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateFlagsUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateFlagsUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc index 924cc49..1f1f2d6 100644 --- a/chrome/browser/ui/webui/flash_ui.cc +++ b/chrome/browser/ui/webui/flash_ui.cc @@ -22,8 +22,6 @@ #include "chrome/browser/crash_upload_list.h" #include "chrome/browser/plugins/plugin_prefs.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/crashes_ui.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" @@ -33,6 +31,7 @@ #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "content/public/common/gpu_info.h" #include "grit/browser_resources.h" @@ -60,7 +59,7 @@ const char kFlashPlugin[] = "Flash plugin"; content::WebUIDataSource* CreateFlashUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIFlashHost); + content::WebUIDataSource::Create(chrome::kChromeUIFlashHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("loadingMessage", IDS_FLASH_LOADING_MESSAGE); @@ -388,7 +387,7 @@ FlashUI::FlashUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the about:flash source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateFlashUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/gesture_config_ui.cc b/chrome/browser/ui/webui/gesture_config_ui.cc index 3983e70..6589f33 100644 --- a/chrome/browser/ui/webui/gesture_config_ui.cc +++ b/chrome/browser/ui/webui/gesture_config_ui.cc @@ -9,9 +9,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -23,7 +23,7 @@ GestureConfigUI::GestureConfigUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { // Set up the chrome://gesture-config source. content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUIGestureConfigHost); + content::WebUIDataSource::Create(chrome::kChromeUIGestureConfigHost); // Register callback handlers. web_ui->RegisterMessageCallback( @@ -45,7 +45,7 @@ GestureConfigUI::GestureConfigUI(content::WebUI* web_ui) html_source->SetDefaultResource(IDR_GESTURE_CONFIG_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } GestureConfigUI::~GestureConfigUI() { diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index a798a03..efc0663 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -20,8 +20,6 @@ #include "cc/switches.h" #include "chrome/browser/crash_upload_list.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/crashes_ui.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" @@ -31,6 +29,7 @@ #include "content/public/browser/gpu_data_manager_observer.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "content/public/common/content_switches.h" #include "content/public/common/gpu_info.h" @@ -57,7 +56,7 @@ struct GpuFeatureInfo { content::WebUIDataSource* CreateGpuHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIGpuInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUIGpuInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("gpu_internals.js", IDR_GPU_INTERNALS_JS); @@ -688,5 +687,5 @@ GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) // Set up the chrome://gpu-internals/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateGpuHTMLSource()); + content::WebUIDataSource::Add(profile, CreateGpuHTMLSource()); } diff --git a/chrome/browser/ui/webui/help/help_ui.cc b/chrome/browser/ui/webui/help/help_ui.cc index 3d9970e..f7694ba 100644 --- a/chrome/browser/ui/webui/help/help_ui.cc +++ b/chrome/browser/ui/webui/help/help_ui.cc @@ -6,18 +6,17 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/help/help_handler.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" namespace { content::WebUIDataSource* CreateAboutPageHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIHelpFrameHost); + content::WebUIDataSource::Create(chrome::kChromeUIHelpFrameHost); source->SetJsonPath("strings.js"); source->SetUseJsonJSFormatV2(); @@ -36,7 +35,7 @@ HelpUI::HelpUI(content::WebUI* web_ui) HelpHandler* handler = new HelpHandler(); handler->GetLocalizedValues(source); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); web_ui->AddMessageHandler(handler); } diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index 88f5624..5c5e9e0 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -32,8 +32,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/chrome_pages.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" @@ -41,10 +39,12 @@ #include "chrome/common/url_constants.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -109,7 +109,7 @@ void SetURLAndTitle(DictionaryValue* result, content::WebUIDataSource* CreateHistoryUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIHistoryFrameHost); + content::WebUIDataSource::Create(chrome::kChromeUIHistoryFrameHost); source->AddLocalizedString("loading", IDS_HISTORY_LOADING); source->AddLocalizedString("title", IDS_HISTORY_TITLE); source->AddLocalizedString("newest", IDS_HISTORY_NEWEST); @@ -167,7 +167,7 @@ BrowsingHistoryHandler::~BrowsingHistoryHandler() { void BrowsingHistoryHandler::RegisterMessages() { // Create our favicon data source. Profile* profile = Profile::FromWebUI(web_ui()); - ChromeURLDataManager::AddDataSource( + content::URLDataSource::Add( profile, new FaviconSource(profile, FaviconSource::FAVICON)); // Get notifications when history is cleared. @@ -532,8 +532,8 @@ HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->AddMessageHandler(new BrowsingHistoryHandler()); // Set up the chrome://history-frame/ source. - ChromeURLDataManager::AddWebUIDataSource(Profile::FromWebUI(web_ui), - CreateHistoryUIHTMLSource()); + content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), + CreateHistoryUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h index 689a4ba..f8ef503 100644 --- a/chrome/browser/ui/webui/history_ui.h +++ b/chrome/browser/ui/webui/history_ui.h @@ -12,7 +12,6 @@ #include "chrome/browser/common/cancelable_request.h" #include "chrome/browser/history/history_service.h" #include "chrome/browser/history/web_history_service.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/cancelable_task_tracker.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_ui_controller.h" diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc index 302b0f2..eb682ef 100644 --- a/chrome/browser/ui/webui/inspect_ui.cc +++ b/chrome/browser/ui/webui/inspect_ui.cc @@ -18,8 +18,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" @@ -36,6 +34,7 @@ #include "content/public/browser/render_widget_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "content/public/browser/worker_service.h" #include "content/public/browser/worker_service_observer.h" @@ -147,8 +146,9 @@ DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh, bool is_tab) { // Appends the inspectable workers to the list of RenderViews, and sends the // response back to the webui system. -void SendDescriptors(ListValue* rvh_list, - const ChromeWebUIDataSource::GotDataCallback& callback) { +void SendDescriptors( + ListValue* rvh_list, + const content::WebUIDataSource::GotDataCallback& callback) { std::vector<WorkerService::WorkerInfo> worker_info = WorkerService::GetInstance()->GetWorkers(); for (size_t i = 0; i < worker_info.size(); ++i) { @@ -171,7 +171,7 @@ void SendDescriptors(ListValue* rvh_list, bool HandleRequestCallback( const std::string& path, - const ChromeWebUIDataSource::GotDataCallback& callback) { + const content::WebUIDataSource::GotDataCallback& callback) { if (path != kDataFile) return false; @@ -215,7 +215,7 @@ bool HandleRequestCallback( content::WebUIDataSource* CreateInspectUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIInspectHost); + content::WebUIDataSource::Create(chrome::kChromeUIInspectHost); source->AddResourcePath("inspect.css", IDR_INSPECT_CSS); source->AddResourcePath("inspect.js", IDR_INSPECT_JS); source->SetDefaultResource(IDR_INSPECT_HTML); @@ -362,8 +362,7 @@ InspectUI::InspectUI(content::WebUI* web_ui) web_ui->AddMessageHandler(new InspectMessageHandler()); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateInspectUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateInspectUIHTMLSource()); registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc index b29bf8b..14df056 100644 --- a/chrome/browser/ui/webui/instant_ui.cc +++ b/chrome/browser/ui/webui/instant_ui.cc @@ -13,10 +13,10 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_instant_controller.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" @@ -24,7 +24,7 @@ namespace { content::WebUIDataSource* CreateInstantHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIInstantHost); + content::WebUIDataSource::Create(chrome::kChromeUIInstantHost); source->SetJsonPath("strings.js"); source->AddResourcePath("instant.js", IDR_INSTANT_JS); source->AddResourcePath("instant.css", IDR_INSTANT_CSS); @@ -145,7 +145,7 @@ InstantUI::InstantUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://instant/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateInstantHTMLSource()); + content::WebUIDataSource::Add(profile, CreateInstantHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.cc b/chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.cc index 10d373d..68c5154 100644 --- a/chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.cc +++ b/chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.cc @@ -5,17 +5,16 @@ #include "chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" LocalOmniboxPopupUI::LocalOmniboxPopupUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { - content::WebUIDataSource* source = ChromeWebUIDataSource::Create( + content::WebUIDataSource* source = content::WebUIDataSource::Create( chrome::kChromeUILocalOmniboxPopupHost); source->AddResourcePath("local_omnibox_popup.css", IDR_LOCAL_OMNIBOX_POPUP_CSS); @@ -38,7 +37,7 @@ LocalOmniboxPopupUI::LocalOmniboxPopupUI(content::WebUI* web_ui) source->SetDefaultResource(IDR_LOCAL_OMNIBOX_POPUP_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, source); + content::WebUIDataSource::Add(profile, source); } LocalOmniboxPopupUI::~LocalOmniboxPopupUI() { diff --git a/chrome/browser/ui/webui/media/media_internals_ui.cc b/chrome/browser/ui/webui/media/media_internals_ui.cc index 672fd99..a58f3fb 100644 --- a/chrome/browser/ui/webui/media/media_internals_ui.cc +++ b/chrome/browser/ui/webui/media/media_internals_ui.cc @@ -6,12 +6,11 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/media/media_internals_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "ui/base/resource/resource_bundle.h" @@ -21,7 +20,7 @@ namespace { content::WebUIDataSource* CreateMediaInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIMediaInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUIMediaInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("media_internals.js", IDR_MEDIA_INTERNALS_JS); @@ -42,6 +41,5 @@ MediaInternalsUI::MediaInternalsUI(content::WebUI* web_ui) web_ui->AddMessageHandler(new MediaInternalsMessageHandler()); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource( - profile, CreateMediaInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateMediaInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/media/webrtc_internals_ui.cc b/chrome/browser/ui/webui/media/webrtc_internals_ui.cc index b5e7719..26d45c9 100644 --- a/chrome/browser/ui/webui/media/webrtc_internals_ui.cc +++ b/chrome/browser/ui/webui/media/webrtc_internals_ui.cc @@ -5,11 +5,10 @@ #include "chrome/browser/ui/webui/media/webrtc_internals_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/media/webrtc_internals_message_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" using content::WebContents; @@ -18,7 +17,7 @@ namespace { content::WebUIDataSource* CreateWebRTCInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIWebRTCInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUIWebRTCInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("webrtc_internals.js", IDR_WEBRTC_INTERNALS_JS); @@ -39,6 +38,5 @@ WebRTCInternalsUI::WebRTCInternalsUI(content::WebUI* web_ui) web_ui->AddMessageHandler(new WebRTCInternalsMessageHandler()); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateWebRTCInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateWebRTCInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/nacl_ui.cc b/chrome/browser/ui/webui/nacl_ui.cc index 5be0f13..9a54a34 100644 --- a/chrome/browser/ui/webui/nacl_ui.cc +++ b/chrome/browser/ui/webui/nacl_ui.cc @@ -18,8 +18,6 @@ #include "base/values.h" #include "chrome/browser/plugins/plugin_prefs.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" @@ -27,6 +25,7 @@ #include "content/public/browser/plugin_service.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -48,7 +47,7 @@ namespace { content::WebUIDataSource* CreateNaClUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUINaClHost); + content::WebUIDataSource::Create(chrome::kChromeUINaClHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("loadingMessage", IDS_NACL_LOADING_MESSAGE); @@ -277,5 +276,5 @@ NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the about:nacl source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateNaClUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc index 2ed5328..43ba219 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -40,8 +40,6 @@ #include "chrome/browser/prerender/prerender_manager.h" #include "chrome/browser/prerender/prerender_manager_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" @@ -54,6 +52,7 @@ #include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/generated_resources.h" #include "grit/net_internals_resources.h" @@ -220,7 +219,7 @@ Value* ExperimentToValue(const ConnectionTester::Experiment& experiment) { content::WebUIDataSource* CreateNetInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUINetInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUINetInternalsHost); source->SetDefaultResource(IDR_NET_INTERNALS_INDEX_HTML); source->AddResourcePath("help.html", IDR_NET_INTERNALS_HELP_HTML); @@ -1940,6 +1939,5 @@ NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) // Set up the chrome://net-internals/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateNetInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc index f871d0f..bcde01a 100644 --- a/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc +++ b/chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc @@ -14,9 +14,9 @@ #include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/codec/png_codec.h" @@ -105,8 +105,8 @@ void BookmarksHandler::RegisterMessages() { Profile* profile = Profile::FromBrowserContext( web_ui()->GetWebContents()->GetBrowserContext()); - ChromeURLDataManager::AddDataSource(profile, - new FaviconSource(profile, FaviconSource::ANY)); + content::URLDataSource::Add( + profile, new FaviconSource(profile, FaviconSource::ANY)); bookmark_model_ = BookmarkModelFactory::GetForProfile(profile); if (bookmark_model_) { diff --git a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc index a1726f7..6343abc 100644 --- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc +++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc @@ -22,7 +22,6 @@ #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/host_desktop.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/session_favicon_source.h" #include "chrome/common/chrome_notification_types.h" @@ -31,6 +30,7 @@ #include "chrome/common/url_constants.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "grit/generated_resources.h" @@ -192,8 +192,7 @@ void ForeignSessionHandler::Init() { content::Source<Profile>(profile)); // Add the data source for synced favicons. - ChromeURLDataManager::AddDataSource(profile, - new SessionFaviconSource(profile)); + content::URLDataSource::Add(profile, new SessionFaviconSource(profile)); } void ForeignSessionHandler::Observe( diff --git a/chrome/browser/ui/webui/ntp/most_visited_handler.cc b/chrome/browser/ui/webui/ntp/most_visited_handler.cc index 360a3f5..e4409b2 100644 --- a/chrome/browser/ui/webui/ntp/most_visited_handler.cc +++ b/chrome/browser/ui/webui/ntp/most_visited_handler.cc @@ -23,7 +23,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/ntp/ntp_stats.h" @@ -34,6 +33,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" @@ -72,16 +72,16 @@ void MostVisitedHandler::RegisterMessages() { Profile* profile = Profile::FromWebUI(web_ui()); // Set up our sources for thumbnail and favicon data. ThumbnailSource* thumbnail_src = new ThumbnailSource(profile); - ChromeURLDataManager::AddDataSource(profile, thumbnail_src); + content::URLDataSource::Add(profile, thumbnail_src); #if defined(OS_ANDROID) // Register chrome://touch-icon as a data source for touch icons or favicons. - ChromeURLDataManager::AddDataSource(profile, - new FaviconSource(profile, FaviconSource::ANY)); + content::URLDataSource::Add(profile, + new FaviconSource(profile, FaviconSource::ANY)); #endif // Register chrome://favicon as a data source for favicons. - ChromeURLDataManager::AddDataSource(profile, - new FaviconSource(profile, FaviconSource::FAVICON)); + content::URLDataSource::Add( + profile, new FaviconSource(profile, FaviconSource::FAVICON)); history::TopSites* ts = profile->GetTopSites(); if (ts) { diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc index fb5cad6..933f044 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc @@ -27,7 +27,6 @@ #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.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" @@ -44,6 +43,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_view_host.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" @@ -162,7 +162,7 @@ NewTabUI::NewTabUI(content::WebUI* web_ui) // tests immediately deletes it, so html_source should not be accessed after // this call. Profile* profile = GetProfile(); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); pref_change_registrar_.Init(GetProfile()->GetPrefs()); pref_change_registrar_.Add(prefs::kShowBookmarkBar, @@ -277,7 +277,7 @@ void NewTabUI::InitializeCSSCaches() { #if defined(ENABLE_THEMES) Profile* profile = GetProfile(); ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); #endif } diff --git a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc index fe98458..9f6b614 100644 --- a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc +++ b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc @@ -18,7 +18,6 @@ #include "chrome/browser/history/page_usage_data.h" #include "chrome/browser/history/top_sites.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" #include "chrome/browser/ui/webui/ntp/ntp_stats.h" @@ -29,6 +28,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" @@ -62,9 +62,9 @@ SuggestionsHandler::~SuggestionsHandler() { void SuggestionsHandler::RegisterMessages() { Profile* profile = Profile::FromWebUI(web_ui()); // Set up our sources for thumbnail and favicon data. - ChromeURLDataManager::AddDataSource(profile, new ThumbnailSource(profile)); - ChromeURLDataManager::AddDataSource(profile, - new FaviconSource(profile, FaviconSource::FAVICON)); + content::URLDataSource::Add(profile, new ThumbnailSource(profile)); + content::URLDataSource::Add( + profile, new FaviconSource(profile, FaviconSource::FAVICON)); // TODO(georgey) change the source of the web-sites to provide our data. // Initial commit uses top sites as a data source. diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc index 3dc54b4..d677beb 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc +++ b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc @@ -5,25 +5,24 @@ #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" OmniboxUI::OmniboxUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { // Set up the chrome://omnibox/ source. content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUIOmniboxHost); + content::WebUIDataSource::Create(chrome::kChromeUIOmniboxHost); html_source->AddResourcePath("omnibox.css", IDR_OMNIBOX_CSS); html_source->AddResourcePath("omnibox.js", IDR_OMNIBOX_JS); html_source->SetDefaultResource(IDR_OMNIBOX_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); // AddMessageHandler takes ownership of OmniboxUIHandler web_ui->AddMessageHandler(new OmniboxUIHandler(profile)); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index ce74cef..40b149b 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -50,7 +50,6 @@ #include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/options/options_util.h" #include "chrome/browser/ui/search/search.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_notification_types.h" @@ -65,6 +64,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" @@ -587,8 +587,8 @@ void BrowserOptionsHandler::InitializeHandler() { sync_service->AddObserver(this); // Create our favicon data source. - ChromeURLDataManager::AddDataSource(profile, - new FaviconSource(profile, FaviconSource::FAVICON)); + content::URLDataSource::Add( + profile, new FaviconSource(profile, FaviconSource::FAVICON)); default_browser_policy_.Init( prefs::kDefaultBrowserSettingEnabled, diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc index 2b80d5a..b7f7059 100644 --- a/chrome/browser/ui/webui/options/options_ui.cc +++ b/chrome/browser/ui/webui/options/options_ui.cc @@ -313,17 +313,17 @@ OptionsUI::OptionsUI(content::WebUI* web_ui) // Set up the chrome://settings-frame/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, html_source); + content::URLDataSource::Add(profile, html_source); // Set up the chrome://theme/ source. ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); #if defined(OS_CHROMEOS) // Set up the chrome://userimage/ source. chromeos::options::UserImageSource* user_image_source = new chromeos::options::UserImageSource(); - ChromeURLDataManager::AddDataSource(profile, user_image_source); + content::URLDataSource::Add(profile, user_image_source); pointer_device_observer_.reset( new chromeos::system::PointerDeviceObserver()); diff --git a/chrome/browser/ui/webui/options/options_ui.h b/chrome/browser/ui/webui/options/options_ui.h index 0b5e3d6..ac2a98b 100644 --- a/chrome/browser/ui/webui/options/options_ui.h +++ b/chrome/browser/ui/webui/options/options_ui.h @@ -10,7 +10,6 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" @@ -23,6 +22,7 @@ class AutocompleteResult; namespace base { class DictionaryValue; class ListValue; +class RefCountedMemory; } #if defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.cc b/chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.cc index 6b6bf60..86ed9a5 100644 --- a/chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.cc +++ b/chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.cc @@ -8,11 +8,10 @@ #include "base/values.h" #include "chrome/browser/performance_monitor/performance_monitor.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -20,7 +19,7 @@ namespace { content::WebUIDataSource* CreateWebUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIPerformanceMonitorHost); + content::WebUIDataSource::Create(chrome::kChromeUIPerformanceMonitorHost); source->SetJsonPath("strings.js"); source->AddResourcePath("chart.css", IDR_PERFORMANCE_MONITOR_CHART_CSS); @@ -79,7 +78,7 @@ PerformanceMonitorUI::PerformanceMonitorUI(content::WebUI* web_ui) html_source->SetUseJsonJSFormatV2(); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } } // namespace performance_monitor diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc index dac9443..dbbf747 100644 --- a/chrome/browser/ui/webui/plugins_ui.cc +++ b/chrome/browser/ui/webui/plugins_ui.cc @@ -28,8 +28,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" @@ -39,6 +37,7 @@ #include "content/public/browser/plugin_service.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -64,7 +63,7 @@ void AssertPluginEnabled(bool did_enable) { content::WebUIDataSource* CreatePluginsUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIPluginsHost); + content::WebUIDataSource::Create(chrome::kChromeUIPluginsHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("pluginsTitle", IDS_PLUGINS_TITLE); @@ -480,8 +479,7 @@ PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://plugins/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreatePluginsUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreatePluginsUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc index 2878dc4..efa876d 100644 --- a/chrome/browser/ui/webui/policy_ui.cc +++ b/chrome/browser/ui/webui/policy_ui.cc @@ -27,13 +27,12 @@ #include "chrome/browser/policy/proto/device_management_backend.pb.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/pref_names.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -61,7 +60,7 @@ namespace { content::WebUIDataSource* CreatePolicyUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIPolicyHost); + content::WebUIDataSource::Create(chrome::kChromeUIPolicyHost); // Localized strings. source->SetUseJsonJSFormatV2(); @@ -539,7 +538,7 @@ PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://policy/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreatePolicyUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreatePolicyUIHTMLSource()); } PolicyUI::~PolicyUI() { diff --git a/chrome/browser/ui/webui/predictors/predictors_ui.cc b/chrome/browser/ui/webui/predictors/predictors_ui.cc index c72013f..0497f77 100644 --- a/chrome/browser/ui/webui/predictors/predictors_ui.cc +++ b/chrome/browser/ui/webui/predictors/predictors_ui.cc @@ -5,18 +5,18 @@ #include "chrome/browser/ui/webui/predictors/predictors_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/predictors/predictors_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" namespace { content::WebUIDataSource* CreatePredictorsUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIPredictorsHost); + content::WebUIDataSource::Create(chrome::kChromeUIPredictorsHost); source->AddResourcePath("predictors.js", IDR_PREDICTORS_JS); source->SetDefaultResource(IDR_PREDICTORS_HTML); return source; @@ -27,6 +27,5 @@ content::WebUIDataSource* CreatePredictorsUIHTMLSource() { PredictorsUI::PredictorsUI(content::WebUI* web_ui) : WebUIController(web_ui) { Profile* profile = Profile::FromWebUI(web_ui); web_ui->AddMessageHandler(new PredictorsHandler(profile)); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreatePredictorsUIHTMLSource()); + content::WebUIDataSource::Add(profile, CreatePredictorsUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 3076ab6..73f1a3c 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -20,13 +20,13 @@ #include "chrome/browser/printing/background_printing_manager.h" #include "chrome/browser/printing/print_preview_data_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" #include "chrome/browser/ui/webui/theme_source.h" #include "chrome/common/print_messages.h" #include "chrome/common/url_constants.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -119,7 +119,7 @@ base::LazyInstance<IDMap<PrintPreviewUI> > // to return the markup or other resources for the print preview page itself. bool HandleRequestCallback( const std::string& path, - const ChromeWebUIDataSource::GotDataCallback& callback) { + const content::WebUIDataSource::GotDataCallback& callback) { // ChromeWebUIDataSource handles most requests except for the print preview // data. if (!EndsWith(path, "/print.pdf", true)) @@ -150,7 +150,7 @@ bool HandleRequestCallback( content::WebUIDataSource* CreatePrintPreviewUISource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIPrintHost); + content::WebUIDataSource::Create(chrome::kChromeUIPrintHost); #if defined(OS_CHROMEOS) source->AddLocalizedString("title", IDS_PRINT_PREVIEW_GOOGLE_CLOUD_PRINT_TITLE); @@ -347,11 +347,10 @@ PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui) dialog_closed_(false) { // Set up the chrome://print/ data source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreatePrintPreviewUISource()); + content::WebUIDataSource::Add(profile, CreatePrintPreviewUISource()); // Set up the chrome://theme/ source. - ChromeURLDataManager::AddDataSource(profile, new ThemeSource(profile)); + content::URLDataSource::Add(profile, new ThemeSource(profile)); // WebUI owns |handler_|. handler_ = new PrintPreviewHandler(); diff --git a/chrome/browser/ui/webui/profiler_ui.cc b/chrome/browser/ui/webui/profiler_ui.cc index 4272905..32ec1285 100644 --- a/chrome/browser/ui/webui/profiler_ui.cc +++ b/chrome/browser/ui/webui/profiler_ui.cc @@ -21,12 +21,12 @@ #include "chrome/browser/metrics/tracking_synchronizer.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/task_profiler/task_profiler_data_serializer.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -100,7 +100,7 @@ class ProfilerWebUIDataSource : public content::URLDataSource { content::WebUIDataSource* CreateProfilerHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIProfilerHost); + content::WebUIDataSource::Create(chrome::kChromeUIProfilerHost); source->SetJsonPath("strings.js"); source->AddResourcePath("profiler.js", IDR_PROFILER_JS); @@ -157,9 +157,9 @@ ProfilerUI::ProfilerUI(content::WebUI* web_ui) // Set up the chrome://profiler/ source. Profile* profile = Profile::FromWebUI(web_ui); #if defined(USE_SOURCE_FILES_DIRECTLY) - ChromeURLDataManager::AddDataSource(profile, new ProfilerWebUIDataSource); + content::URLDataSource::Add(profile, new ProfilerWebUIDataSource); #else - ChromeURLDataManager::AddWebUIDataSource(profile, CreateProfilerHTMLSource()); + content::WebUIDataSource::Add(profile, CreateProfilerHTMLSource()); #endif } diff --git a/chrome/browser/ui/webui/quota_internals_ui.cc b/chrome/browser/ui/webui/quota_internals_ui.cc index fb364c8..da49194 100644 --- a/chrome/browser/ui/webui/quota_internals_ui.cc +++ b/chrome/browser/ui/webui/quota_internals_ui.cc @@ -7,12 +7,11 @@ #include <string> #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/quota_internals_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/quota_internals_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -23,7 +22,7 @@ namespace { content::WebUIDataSource* CreateQuotaInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIQuotaInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUIQuotaInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath( @@ -40,6 +39,5 @@ QuotaInternalsUI::QuotaInternalsUI(content::WebUI* web_ui) : WebUIController(web_ui) { web_ui->AddMessageHandler(new quota_internals::QuotaInternalsHandler); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateQuotaInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateQuotaInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/session_favicon_source.cc b/chrome/browser/ui/webui/session_favicon_source.cc index a69c008..13678d0 100644 --- a/chrome/browser/ui/webui/session_favicon_source.cc +++ b/chrome/browser/ui/webui/session_favicon_source.cc @@ -7,7 +7,6 @@ #include "chrome/browser/sync/glue/session_model_associator.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/common/url_constants.h" using browser_sync::SessionModelAssociator; diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc index 8263c48..04a6959 100644 --- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc +++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc @@ -22,7 +22,6 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/singleton_tabs.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -32,6 +31,7 @@ #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_view.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -64,7 +64,7 @@ enum MakeChromeDefaultResult { }; content::WebUIDataSource* CreateSetAsDefaultBrowserUIHTMLSource() { - content::WebUIDataSource* data_source = ChromeWebUIDataSource::Create( + content::WebUIDataSource* data_source = content::WebUIDataSource::Create( chrome::kChromeUIMetroFlowHost); data_source->AddLocalizedString("page-title", IDS_METRO_FLOW_TAB_TITLE); data_source->AddLocalizedString("flowTitle", IDS_METRO_FLOW_TITLE_SHORT); @@ -388,7 +388,7 @@ void SetAsDefaultBrowserDialogImpl:: SetAsDefaultBrowserUI::SetAsDefaultBrowserUI(content::WebUI* web_ui) : ui::WebDialogUI(web_ui) { - ChromeURLDataManager::AddWebUIDataSource( + content::WebUIDataSource::Add( Profile::FromWebUI(web_ui), CreateSetAsDefaultBrowserUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/signin_internals_ui.cc b/chrome/browser/ui/webui/signin_internals_ui.cc index a9a5de1..672cddd 100644 --- a/chrome/browser/ui/webui/signin_internals_ui.cc +++ b/chrome/browser/ui/webui/signin_internals_ui.cc @@ -10,9 +10,9 @@ #include "chrome/browser/signin/about_signin_internals_factory.h" #include "chrome/browser/signin/token_service.h" #include "chrome/browser/signin/token_service_factory.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/signin_internals_resources.h" #include "ui/base/resource/resource_bundle.h" @@ -20,7 +20,7 @@ namespace { content::WebUIDataSource* CreateSignInInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUISignInInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUISignInInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("signin_internals.js", @@ -34,8 +34,7 @@ content::WebUIDataSource* CreateSignInInternalsHTMLSource() { SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) : WebUIController(web_ui) { Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource( - profile, CreateSignInInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateSignInInternalsHTMLSource()); if (profile) { AboutSigninInternals* about_signin_internals = AboutSigninInternalsFactory::GetForProfile(profile); diff --git a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui.cc b/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui.cc index 74eef16b..d55e8a7 100644 --- a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui.cc +++ b/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui.cc @@ -5,19 +5,20 @@ #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.h" #include "chrome/common/url_constants.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" SuggestionsInternalsUI::SuggestionsInternalsUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { // Set up the chrome://suggestions-internals/ source. - content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUISuggestionsInternalsHost); + content::WebUIDataSource* html_source = content::WebUIDataSource::Create( + chrome::kChromeUISuggestionsInternalsHost); html_source->AddResourcePath("suggestions_internals.css", IDR_SUGGESTIONS_INTERNALS_CSS); html_source->AddResourcePath("suggestions_internals.js", @@ -25,8 +26,8 @@ SuggestionsInternalsUI::SuggestionsInternalsUI(content::WebUI* web_ui) html_source->SetDefaultResource(IDR_SUGGESTIONS_INTERNALS_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); - ChromeURLDataManager::AddDataSource( + content::WebUIDataSource::Add(profile, html_source); + content::URLDataSource::Add( profile, new FaviconSource(profile, FaviconSource::FAVICON)); // AddMessageHandler takes ownership of SuggestionsInternalsUIHandler diff --git a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc b/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc index dcb58e8..a3257ec 100644 --- a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc +++ b/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" #include "content/public/browser/web_ui.h" diff --git a/chrome/browser/ui/webui/sync_internals_ui.cc b/chrome/browser/ui/webui/sync_internals_ui.cc index 5a3c3d8..a1a87f6 100644 --- a/chrome/browser/ui/webui/sync_internals_ui.cc +++ b/chrome/browser/ui/webui/sync_internals_ui.cc @@ -16,12 +16,11 @@ #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/sync_ui_util.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/extensions/extension_messages.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/sync_internals_resources.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/js/js_arg_list.h" @@ -39,7 +38,7 @@ namespace { content::WebUIDataSource* CreateSyncInternalsHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUISyncInternalsHost); + content::WebUIDataSource::Create(chrome::kChromeUISyncInternalsHost); source->SetJsonPath("strings.js"); source->AddResourcePath("sync_index.js", IDR_SYNC_INTERNALS_INDEX_JS); @@ -81,8 +80,7 @@ SyncInternalsUI::SyncInternalsUI(content::WebUI* web_ui) weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { // TODO(akalin): Fix. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateSyncInternalsHTMLSource()); + content::WebUIDataSource::Add(profile, CreateSyncInternalsHTMLSource()); ProfileSyncService* sync_service = GetProfileSyncService(profile); if (sync_service) { js_controller_ = sync_service->GetJsController(); diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc index e894bc3..6e00ca1 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc @@ -18,8 +18,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/options/core_options_handler.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_handler.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" @@ -28,8 +26,10 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/common/net/url_util.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "google_apis/gaia/gaia_urls.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -78,7 +78,7 @@ bool AllowPromoAtStartupForCurrentBrand() { content::WebUIDataSource* CreateSyncUIHTMLSource(content::WebUI* web_ui) { content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUISyncPromoHost); + content::WebUIDataSource::Create(chrome::kChromeUISyncPromoHost); DictionaryValue localized_strings; options::CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings); SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui); @@ -100,11 +100,10 @@ SyncPromoUI::SyncPromoUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://theme/ source. Profile* profile = Profile::FromWebUI(web_ui); ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); // Set up the sync promo source. - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateSyncUIHTMLSource(web_ui)); + content::WebUIDataSource::Add(profile, CreateSyncUIHTMLSource(web_ui)); sync_promo_trial::RecordUserShownPromo(web_ui); } diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc index feb7496..c2b6053 100644 --- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc +++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc @@ -16,11 +16,10 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" #include "chrome/browser/ui/web_contents_modal_dialog.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -47,11 +46,11 @@ TabModalConfirmDialogWebUI::TabModalConfirmDialogWebUI( : delegate_(delegate) { Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); - content::WebUIDataSource* data_source = - ChromeWebUIDataSource::Create(chrome::kChromeUITabModalConfirmDialogHost); + content::WebUIDataSource* data_source = content::WebUIDataSource::Create( + chrome::kChromeUITabModalConfirmDialogHost); data_source->SetDefaultResource(IDR_TAB_MODAL_CONFIRM_DIALOG_HTML); data_source->DisableContentSecurityPolicy(); - ChromeURLDataManager::AddWebUIDataSource(profile, data_source); + content::WebUIDataSource::Add(profile, data_source); constrained_web_dialog_delegate_ = CreateConstrainedWebDialog(profile, this, NULL, web_contents); diff --git a/chrome/browser/ui/webui/task_manager/task_manager_ui.cc b/chrome/browser/ui/webui/task_manager/task_manager_ui.cc index 61e497c..1321bd0 100644 --- a/chrome/browser/ui/webui/task_manager/task_manager_ui.cc +++ b/chrome/browser/ui/webui/task_manager/task_manager_ui.cc @@ -7,12 +7,11 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/task_manager/task_manager.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/task_manager/task_manager_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "grit/chromium_strings.h" @@ -26,7 +25,7 @@ namespace { content::WebUIDataSource* CreateTaskManagerUIHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUITaskManagerHost); + content::WebUIDataSource::Create(chrome::kChromeUITaskManagerHost); source->SetUseJsonJSFormatV2(); source->AddLocalizedString("closeWindow", IDS_CLOSE); @@ -93,5 +92,5 @@ TaskManagerUI::TaskManagerUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://taskmanager/ source. content::WebUIDataSource* html_source = CreateTaskManagerUIHTMLSource(); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } diff --git a/chrome/browser/ui/webui/tracing_ui.cc b/chrome/browser/ui/webui/tracing_ui.cc index f79ebc0..1a68187 100644 --- a/chrome/browser/ui/webui/tracing_ui.cc +++ b/chrome/browser/ui/webui/tracing_ui.cc @@ -15,10 +15,9 @@ #include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" +#include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/chrome_select_file_policy.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" @@ -30,6 +29,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -52,7 +52,7 @@ namespace { content::WebUIDataSource* CreateTracingHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUITracingHost); + content::WebUIDataSource::Create(chrome::kChromeUITracingHost); source->SetJsonPath("strings.js"); source->SetDefaultResource(IDR_TRACING_HTML); @@ -510,5 +510,5 @@ TracingUI::TracingUI(content::WebUI* web_ui) : WebUIController(web_ui) { // Set up the chrome://tracing/ source. Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateTracingHTMLSource()); + content::WebUIDataSource::Add(profile, CreateTracingHTMLSource()); } diff --git a/chrome/browser/ui/webui/uber/uber_ui.cc b/chrome/browser/ui/webui/uber/uber_ui.cc index 998a109..0bb9eec 100644 --- a/chrome/browser/ui/webui/uber/uber_ui.cc +++ b/chrome/browser/ui/webui/uber/uber_ui.cc @@ -8,8 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" #include "chrome/browser/ui/webui/extensions/extensions_ui.h" #include "chrome/browser/ui/webui/options/options_ui.h" @@ -22,6 +20,7 @@ #include "content/public/browser/notification_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -35,7 +34,7 @@ namespace { content::WebUIDataSource* CreateUberHTMLSource() { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIUberHost); + content::WebUIDataSource::Create(chrome::kChromeUIUberHost); source->SetUseJsonJSFormatV2(); source->SetJsonPath("strings.js"); @@ -88,7 +87,7 @@ bool HasExtensionType(Profile* profile, const char* extensionType) { content::WebUIDataSource* CreateUberFrameHTMLSource(Profile* profile) { content::WebUIDataSource* source = - ChromeWebUIDataSource::Create(chrome::kChromeUIUberFrameHost); + content::WebUIDataSource::Create(chrome::kChromeUIUberFrameHost); source->SetUseJsonJSFormatV2(); source->SetJsonPath("strings.js"); @@ -129,7 +128,7 @@ content::WebUIDataSource* CreateUberFrameHTMLSource(Profile* profile) { UberUI::UberUI(content::WebUI* web_ui) : WebUIController(web_ui) { Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, CreateUberHTMLSource()); + content::WebUIDataSource::Add(profile, CreateUberHTMLSource()); RegisterSubpage(chrome::kChromeUIExtensionsFrameURL); RegisterSubpage(chrome::kChromeUIHelpFrameURL); @@ -187,8 +186,7 @@ bool UberUI::OverrideHandleWebUIMessage(const GURL& source_url, UberFrameUI::UberFrameUI(content::WebUI* web_ui) : WebUIController(web_ui) { Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource( - profile, CreateUberFrameHTMLSource(profile)); + content::WebUIDataSource::Add(profile, CreateUberFrameHTMLSource(profile)); // Register as an observer for when extensions are loaded and unloaded. registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, diff --git a/chrome/browser/ui/webui/user_actions/user_actions_ui.cc b/chrome/browser/ui/webui/user_actions/user_actions_ui.cc index 431c616..1b6bac9 100644 --- a/chrome/browser/ui/webui/user_actions/user_actions_ui.cc +++ b/chrome/browser/ui/webui/user_actions/user_actions_ui.cc @@ -5,25 +5,24 @@ #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" UserActionsUI::UserActionsUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { // Set up the chrome://user-actions/ source. content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUIUserActionsHost); + content::WebUIDataSource::Create(chrome::kChromeUIUserActionsHost); html_source->SetDefaultResource(IDR_USER_ACTIONS_HTML); html_source->AddResourcePath("user_actions.css", IDR_USER_ACTIONS_CSS); html_source->AddResourcePath("user_actions.js", IDR_USER_ACTIONS_JS); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); // AddMessageHandler takes ownership of UserActionsUIHandler. web_ui->AddMessageHandler(new UserActionsUIHandler()); diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc index 8c5d2d5..34c4c52 100644 --- a/chrome/browser/ui/webui/version_ui.cc +++ b/chrome/browser/ui/webui/version_ui.cc @@ -8,12 +8,12 @@ #include "base/file_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/browser/ui/webui/version_handler.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" +#include "content/public/browser/url_data_source.h" #include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" #include "content/public/common/content_client.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -39,7 +39,7 @@ namespace { content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUIVersionHost); + content::WebUIDataSource::Create(chrome::kChromeUIVersionHost); // Localized and data strings. html_source->AddLocalizedString("title", IDS_ABOUT_VERSION_TITLE); @@ -139,11 +139,10 @@ VersionUI::VersionUI(content::WebUI* web_ui) #if defined(ENABLE_THEMES) // Set up the chrome://theme/ source. ThemeSource* theme = new ThemeSource(profile); - ChromeURLDataManager::AddDataSource(profile, theme); + content::URLDataSource::Add(profile, theme); #endif - ChromeURLDataManager::AddWebUIDataSource(profile, - CreateVersionUIDataSource(profile)); + content::WebUIDataSource::Add(profile, CreateVersionUIDataSource(profile)); } VersionUI::~VersionUI() { diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc index af2d16b..aee7e93 100644 --- a/chrome/browser/ui/webui/web_ui_browsertest.cc +++ b/chrome/browser/ui/webui/web_ui_browsertest.cc @@ -20,7 +20,6 @@ #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/test_chrome_web_ui_controller_factory.h" #include "chrome/browser/ui/webui/web_ui_test_handler.h" #include "chrome/common/chrome_paths.h" @@ -307,7 +306,7 @@ class MockWebUIProvider WebUIController* NewWebUI(content::WebUI* web_ui, const GURL& url) OVERRIDE { WebUIController* controller = new content::WebUIController(web_ui); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddDataSource(profile, new MockWebUIDataSource()); + content::URLDataSource::Add(profile, new MockWebUIDataSource()); return controller; } diff --git a/chrome/browser/ui/webui/welcome_ui_android.cc b/chrome/browser/ui/webui/welcome_ui_android.cc index c222cde..41b000a 100644 --- a/chrome/browser/ui/webui/welcome_ui_android.cc +++ b/chrome/browser/ui/webui/welcome_ui_android.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/webui/welcome_ui_android.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" #include "chrome/common/url_constants.h" +#include "content/public/browser/web_ui_data_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -16,7 +16,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui) : content::WebUIController(web_ui) { // Set up the chrome://welcome source. content::WebUIDataSource* html_source = - ChromeWebUIDataSource::Create(chrome::kChromeUIWelcomeHost); + content::WebUIDataSource::Create(chrome::kChromeUIWelcomeHost); html_source->SetUseJsonJSFormatV2(); // Localized strings. @@ -35,7 +35,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui) html_source->SetDefaultResource(IDR_ABOUT_WELCOME_HTML); Profile* profile = Profile::FromWebUI(web_ui); - ChromeURLDataManager::AddWebUIDataSource(profile, html_source); + content::WebUIDataSource::Add(profile, html_source); } WelcomeUI::~WelcomeUI() { |