summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/webui')
-rw-r--r--chrome/browser/ui/webui/active_downloads_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc5
-rw-r--r--chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc5
-rw-r--r--chrome/browser/ui/webui/chromeos/login/login_ui.cc10
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc15
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/register_page_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/system_info_ui.cc3
-rw-r--r--chrome/browser/ui/webui/collected_cookies_ui_delegate.cc20
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc3
-rw-r--r--chrome/browser/ui/webui/new_profile_ui.cc7
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc10
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc6
-rw-r--r--chrome/browser/ui/webui/test_chrome_web_ui_factory.cc4
-rw-r--r--chrome/browser/ui/webui/web_ui_unittest.cc9
20 files changed, 71 insertions, 52 deletions
diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc
index a6faa09..816d323 100644
--- a/chrome/browser/ui/webui/active_downloads_ui.cc
+++ b/chrome/browser/ui/webui/active_downloads_ui.cc
@@ -382,7 +382,8 @@ ActiveDownloadsUI::ActiveDownloadsUI(TabContents* contents)
ActiveDownloadsUIHTMLSource* html_source = new ActiveDownloadsUIHTMLSource();
// Set up the chrome://active-downloads/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
// static
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 243221d..325ef6b 100644
--- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
@@ -252,7 +252,8 @@ ChooseMobileNetworkUI::ChooseMobileNetworkUI(TabContents* contents)
ChooseMobileNetworkHTMLSource* html_source =
new ChooseMobileNetworkHTMLSource();
// Set up the "chrome://choose-mobile-network" source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
index 71bfb67..2ea3a32 100644
--- a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
@@ -167,7 +167,9 @@ void EnterpriseEnrollmentUI::RenderViewCreated(
ChromeURLDataManager::DataSource::SetFontAndTextDirection(
localized_strings.get());
// Set up the data source, so the enrollment page can be loaded.
- tab_contents()->profile()->GetChromeURLDataManager()->AddDataSource(
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents()->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(
new EnterpriseEnrollmentDataSource(localized_strings.release()));
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
index e8bdd0b..9e54398 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
@@ -433,7 +433,7 @@ void WebUIHandler::OnConfigFileFetched(const ConfigFile&
}
if (!download_manager_) {
- download_manager_ = tab_contents_->profile()->GetDownloadManager();
+ download_manager_ = tab_contents_->browser_context()->GetDownloadManager();
download_manager_->AddObserver(this);
}
if (!state_machine_->download_started()) {
@@ -668,5 +668,6 @@ ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) {
imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents);
AddMessageHandler((handler)->Attach(this));
imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
index eec9b4a..ee7e03c 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
@@ -305,7 +305,7 @@ void BurnManager::FetchConfigFile(TabContents* tab_contents,
config_file_requested_ = true;
config_file_path_ = GetImageDir().Append(kConfigFileName);
- download_manager_ = tab_contents->profile()->GetDownloadManager();
+ download_manager_ = tab_contents->browser_context()->GetDownloadManager();
download_manager_->AddObserver(this);
downloader()->AddListener(this, config_file_url_);
downloader()->DownloadFile(config_file_url_, config_file_path_, tab_contents);
@@ -429,7 +429,7 @@ void Downloader::OnFileStreamCreatedOnUIThread(const GURL& url,
if (created_file_stream) {
DownloadManager* download_manager =
- tab_contents->profile()->GetDownloadManager();
+ tab_contents->browser_context()->GetDownloadManager();
DownloadSaveInfo save_info;
save_info.file_path = file_path;
save_info.file_stream = linked_ptr<net::FileStream>(created_file_stream);
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
index 51000d2..112d012 100644
--- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -317,11 +317,12 @@ void KeyboardOverlayHandler::GetLabelMap(const ListValue* args) {
KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents)
: HtmlDialogUI(contents) {
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
KeyboardOverlayHandler* handler =
- new KeyboardOverlayHandler(contents->profile());
+ new KeyboardOverlayHandler(profile);
AddMessageHandler((handler)->Attach(this));
KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource();
// Set up the chrome://keyboardoverlay/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/login/login_ui.cc b/chrome/browser/ui/webui/chromeos/login/login_ui.cc
index 0b83815..c140263 100644
--- a/chrome/browser/ui/webui/chromeos/login/login_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/login_ui.cc
@@ -74,20 +74,20 @@ LoginUI::LoginUI(TabContents* contents)
AddMessageHandler(signin_screen_handler->Attach(this));
signin_screen_handler->GetLocalizedStrings(localized_strings.get());
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
LoginUIHTMLSource* html_source =
new LoginUIHTMLSource(localized_strings.release());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Load the theme URLs.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Load the user-image URLs
// Set up the chrome://userimage/ source.
chromeos::UserImageSource* user_image_source =
new chromeos::UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index e225c4d..4ec88d0 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -224,22 +224,21 @@ OobeUI::OobeUI(TabContents* contents)
DictionaryValue* localized_strings = new DictionaryValue();
GetLocalizedStrings(localized_strings);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
// Set up the chrome://theme/ source, for Chrome logo.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the chrome://terms/ data source, for EULA content.
- InitializeAboutDataSource(chrome::kChromeUITermsHost, contents->profile());
+ InitializeAboutDataSource(chrome::kChromeUITermsHost, profile);
// Set up the chrome://oobe/ source.
- OobeUIHTMLSource* html_source =
- new OobeUIHTMLSource(localized_strings);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ OobeUIHTMLSource* html_source = new OobeUIHTMLSource(localized_strings);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://userimage/ source.
UserImageSource* user_image_source = new UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
}
void OobeUI::ShowScreen(WizardScreen* screen) {
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index 9bde86e..ef94964 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -1329,5 +1329,6 @@ MobileSetupUI::MobileSetupUI(TabContents* contents) : ChromeWebUI(contents) {
new MobileSetupUIHTMLSource(service_path);
// Set up the chrome://mobilesetup/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
index 6477137..4f0e51f 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -80,7 +80,8 @@ ProxySettingsUI::ProxySettingsUI(TabContents* contents)
ProxySettingsHTMLSource* source =
new ProxySettingsHTMLSource(localized_strings);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(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 14480c8..19768ce 100644
--- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
@@ -310,5 +310,6 @@ RegisterPageUI::RegisterPageUI(TabContents* contents) : ChromeWebUI(contents) {
RegisterPageUIHTMLSource* html_source = new RegisterPageUIHTMLSource();
// Set up the chrome://register/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(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 7cea5a8..9e6e04f 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -656,7 +656,8 @@ SimUnlockUI::SimUnlockUI(TabContents* contents) : ChromeWebUI(contents) {
SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
// Set up the chrome://sim-unlock/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(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 872e987..baa5fcf 100644
--- a/chrome/browser/ui/webui/chromeos/system_info_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
@@ -178,5 +178,6 @@ SystemInfoUI::SystemInfoUI(TabContents* contents) : ChromeWebUI(contents) {
SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource();
// Set up the chrome://system/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc b/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
index ca18acb..86018d6 100644
--- a/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
+++ b/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
@@ -133,7 +133,9 @@ void CollectedCookiesSource::StartDataRequest(const std::string& path,
void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) {
CollectedCookiesUIDelegate* delegate =
new CollectedCookiesUIDelegate(tab_contents);
- ConstrainedHtmlUI::CreateConstrainedHtmlDialog(tab_contents->profile(),
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile,
delegate,
tab_contents);
}
@@ -142,11 +144,11 @@ CollectedCookiesUIDelegate::CollectedCookiesUIDelegate(
TabContents* tab_contents)
: tab_contents_(tab_contents),
closed_(false) {
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)->
- content_settings();
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
+ TabSpecificContentSettings* content_settings = wrapper->content_settings();
HostContentSettingsMap* host_content_settings_map =
- tab_contents_->profile()->GetHostContentSettingsMap();
+ wrapper->profile()->GetHostContentSettingsMap();
registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN,
Source<TabSpecificContentSettings>(content_settings));
@@ -158,7 +160,7 @@ CollectedCookiesUIDelegate::CollectedCookiesUIDelegate(
CollectedCookiesSource* source = new CollectedCookiesSource(
host_content_settings_map->BlockThirdPartyCookies());
- tab_contents->profile()->GetChromeURLDataManager()->AddDataSource(source);
+ wrapper->profile()->GetChromeURLDataManager()->AddDataSource(source);
}
CollectedCookiesUIDelegate::~CollectedCookiesUIDelegate() {
@@ -227,8 +229,10 @@ void CollectedCookiesUIDelegate::SetInfobarLabel(const std::string& text) {
void CollectedCookiesUIDelegate::AddContentException(
CookieTreeOriginNode* origin_node, ContentSetting setting) {
if (origin_node->CanCreateContentException()) {
- origin_node->CreateContentException(
- tab_contents_->profile()->GetHostContentSettingsMap(), setting);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents_->browser_context());
+ origin_node->CreateContentException(profile->GetHostContentSettingsMap(),
+ setting);
SetInfobarLabel(GetInfobarLabel(setting, origin_node->GetTitle()));
}
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index a3d5296..4c1d3ea 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -157,7 +157,8 @@ ConflictsUI::ConflictsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new ConflictsDOMHandler())->Attach(this));
// Set up the about:conflicts source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(
CreateConflictsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/new_profile_ui.cc b/chrome/browser/ui/webui/new_profile_ui.cc
index 1f6ba0a..9bda595 100644
--- a/chrome/browser/ui/webui/new_profile_ui.cc
+++ b/chrome/browser/ui/webui/new_profile_ui.cc
@@ -96,8 +96,9 @@ NewProfileUI::NewProfileUI(TabContents* contents) : ChromeWebUI(contents) {
handler->Attach(this);
// Set up the chrome://theme/ source.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the new profile source.
NewProfileUIHTMLSource* html_source =
@@ -105,5 +106,5 @@ NewProfileUI::NewProfileUI(TabContents* contents) : ChromeWebUI(contents) {
html_source->set_json_path(kStringsJsFile);
html_source->add_resource_path(kNewProfileJsFile, IDR_NEW_PROFILE_JS);
html_source->set_default_resource(IDR_NEW_PROFILE_HTML);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index de75ec6..ede0fcd 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -260,18 +260,18 @@ OptionsUI::OptionsUI(TabContents* contents)
new OptionsUIHTMLSource(localized_strings);
// Set up the chrome://settings/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://theme/ source.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
#if defined(OS_CHROMEOS)
// Set up the chrome://userimage/ source.
chromeos::UserImageSource* user_image_source =
new chromeos::UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
#endif
}
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index d7ab1b0..397e6fc 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -305,11 +305,11 @@ PluginsUI::PluginsUI(TabContents* contents) : ChromeWebUI(contents) {
// Set up the chrome://plugins/ source.
bool enable_controls = true;
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
#if !defined(OS_CHROMEOS)
- enable_controls = contents->profile()->GetOriginalProfile()->
- first_launched();
+ enable_controls = profile->GetOriginalProfile()->first_launched();
#endif
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
+ profile->GetChromeURLDataManager()->AddDataSource(
CreatePluginsUIHTMLSource(enable_controls));
}
diff --git a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
index c4a51d9..3176cd1 100644
--- a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
+++ b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
@@ -37,7 +37,9 @@ WebUI::TypeID TestChromeWebUIFactory::GetWebUIType(
WebUI* TestChromeWebUIFactory::CreateWebUIForURL(TabContents* tab_contents,
const GURL& url) const {
- WebUIProvider* provider = GetWebUIProvider(tab_contents->profile(), url);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ WebUIProvider* provider = GetWebUIProvider(profile, url);
return provider ? provider->NewWebUI(tab_contents, url) :
ChromeWebUIFactory::CreateWebUIForURL(tab_contents, url);
}
diff --git a/chrome/browser/ui/webui/web_ui_unittest.cc b/chrome/browser/ui/webui/web_ui_unittest.cc
index 93578fc..e027039 100644
--- a/chrome/browser/ui/webui/web_ui_unittest.cc
+++ b/chrome/browser/ui/webui/web_ui_unittest.cc
@@ -158,8 +158,9 @@ TEST_F(WebUITest, StandardToWebUI) {
class TabContentsForFocusTest : public TestTabContents {
public:
- TabContentsForFocusTest(Profile* profile, SiteInstance* instance)
- : TestTabContents(profile, instance), focus_called_(0) {
+ TabContentsForFocusTest(content::BrowserContext* browser_context,
+ SiteInstance* instance)
+ : TestTabContents(browser_context, instance), focus_called_(0) {
}
virtual void SetFocusToLocationBar(bool select_all) { ++focus_called_; }
@@ -172,8 +173,8 @@ class TabContentsForFocusTest : public TestTabContents {
TEST_F(WebUITest, FocusOnNavigate) {
// Setup. |tc| will be used to track when we try to focus the location bar.
TabContentsForFocusTest* tc = new TabContentsForFocusTest(
- contents()->profile(),
- SiteInstance::CreateSiteInstance(contents()->profile()));
+ contents()->browser_context(),
+ SiteInstance::CreateSiteInstance(contents()->browser_context()));
tc->controller().CopyStateFrom(controller());
SetContents(tc);
int page_id = 200;