summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 22:55:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 22:55:30 +0000
commit627e05130fa2d98498dbd19fdcae4a173801d797 (patch)
tree6ab91bc7d842c689a509e897a09c5a789798ac17 /chrome/browser
parent632197304ce0bb8fa5cd8931fe90c3c19cdeeab8 (diff)
downloadchromium_src-627e05130fa2d98498dbd19fdcae4a173801d797.zip
chromium_src-627e05130fa2d98498dbd19fdcae4a173801d797.tar.gz
chromium_src-627e05130fa2d98498dbd19fdcae4a173801d797.tar.bz2
Rename TabContents::browser_context() to GetBrowserContext and put it into the WebContents interface.
BUG=98716 Review URL: http://codereview.chromium.org/9021022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/autocomplete_history_manager.cc2
-rw-r--r--chrome/browser/autofill/autofill_manager.cc6
-rw-r--r--chrome/browser/automation/automation_provider.cc4
-rw-r--r--chrome/browser/automation/automation_util.cc2
-rw-r--r--chrome/browser/background/background_contents_service.cc2
-rw-r--r--chrome/browser/chrome_content_browser_client.cc4
-rw-r--r--chrome/browser/chromeos/locale_change_guard.cc3
-rw-r--r--chrome/browser/chromeos/offline/offline_load_page.cc2
-rw-r--r--chrome/browser/content_settings/tab_specific_content_settings.cc4
-rw-r--r--chrome/browser/download/chrome_download_manager_delegate.cc2
-rw-r--r--chrome/browser/download/save_package_file_picker.cc4
-rw-r--r--chrome/browser/extensions/extension_browser_event_router.cc4
-rw-r--r--chrome/browser/extensions/extension_debugger_api.cc6
-rw-r--r--chrome/browser/extensions/extension_host.cc6
-rw-r--r--chrome/browser/extensions/extension_tab_helper.cc8
-rw-r--r--chrome/browser/extensions/extension_tab_util.cc2
-rw-r--r--chrome/browser/extensions/extension_web_ui.cc4
-rw-r--r--chrome/browser/extensions/extension_webnavigation_api.cc19
-rw-r--r--chrome/browser/extensions/isolated_app_browsertest.cc3
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc8
-rw-r--r--chrome/browser/favicon/favicon_handler_unittest.cc18
-rw-r--r--chrome/browser/favicon/favicon_tab_helper.cc2
-rw-r--r--chrome/browser/history/history_tab_helper.cc4
-rw-r--r--chrome/browser/history/top_sites.cc2
-rw-r--r--chrome/browser/prerender/prerender_manager.cc2
-rw-r--r--chrome/browser/prerender/prerender_tab_helper.cc2
-rw-r--r--chrome/browser/printing/print_preview_tab_controller.cc2
-rw-r--r--chrome/browser/profiles/profile.cc4
-rw-r--r--chrome/browser/safe_browsing/browser_feature_extractor.cc4
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host.cc2
-rw-r--r--chrome/browser/safe_browsing/malware_details.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc8
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc33
-rw-r--r--chrome/browser/sidebar/sidebar_container.cc4
-rw-r--r--chrome/browser/sidebar/sidebar_manager.cc8
-rw-r--r--chrome/browser/speech/speech_input_bubble_gtk.cc4
-rw-r--r--chrome/browser/speech/speech_input_bubble_views.cc4
-rw-r--r--chrome/browser/sync/glue/session_change_processor.cc3
-rw-r--r--chrome/browser/tab_contents/chrome_interstitial_page.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc4
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc4
-rw-r--r--chrome/browser/tab_contents/tab_util.cc2
-rw-r--r--chrome/browser/tab_contents/thumbnail_generator.cc2
-rw-r--r--chrome/browser/tabs/tab_finder.cc4
-rw-r--r--chrome/browser/translate/options_menu_model.cc2
-rw-r--r--chrome/browser/translate/translate_infobar_delegate.cc8
-rw-r--r--chrome/browser/translate/translate_manager.cc8
-rw-r--r--chrome/browser/translate/translate_manager_browsertest.cc31
-rw-r--r--chrome/browser/ui/auto_login_prompter.cc2
-rw-r--r--chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc2
-rw-r--r--chrome/browser/ui/bookmarks/bookmark_tab_helper.cc2
-rw-r--r--chrome/browser/ui/browser.cc4
-rw-r--r--chrome/browser/ui/find_bar/find_backend_unittest.cc2
-rw-r--r--chrome/browser/ui/find_bar/find_tab_helper.cc4
-rw-r--r--chrome/browser/ui/gtk/infobars/infobar_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc2
-rw-r--r--chrome/browser/ui/search_engines/search_engine_tab_helper.cc4
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.cc2
-rw-r--r--chrome/browser/ui/toolbar/back_forward_menu_model.cc2
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc2
-rw-r--r--chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc2
-rw-r--r--chrome/browser/ui/webui/about_ui.cc2
-rw-r--r--chrome/browser/ui/webui/active_downloads_ui.cc2
-rw-r--r--chrome/browser/ui/webui/aura/app_list_ui.cc2
-rw-r--r--chrome/browser/ui/webui/bookmarks_ui.cc2
-rw-r--r--chrome/browser/ui/webui/bug_report_ui.cc6
-rw-r--r--chrome/browser/ui/webui/certificate_viewer_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_factory.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc2
-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.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc6
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/register_page_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc2
-rw-r--r--chrome/browser/ui/webui/chromeos/system_info_ui.cc2
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc2
-rw-r--r--chrome/browser/ui/webui/crashes_ui.cc2
-rw-r--r--chrome/browser/ui/webui/devtools_ui.cc2
-rw-r--r--chrome/browser/ui/webui/downloads_ui.cc2
-rw-r--r--chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.cc2
-rw-r--r--chrome/browser/ui/webui/extensions/extensions_ui.cc2
-rw-r--r--chrome/browser/ui/webui/flags_ui.cc2
-rw-r--r--chrome/browser/ui/webui/flash_ui.cc2
-rw-r--r--chrome/browser/ui/webui/gpu_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/history_ui.cc2
-rw-r--r--chrome/browser/ui/webui/hung_renderer_dialog_ui.cc2
-rw-r--r--chrome/browser/ui/webui/input_window_dialog_ui.cc2
-rw-r--r--chrome/browser/ui/webui/keyboard_ui.cc2
-rw-r--r--chrome/browser/ui/webui/media/media_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc2
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_handler.cc4
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc2
-rw-r--r--chrome/browser/ui/webui/options/personal_options_handler.cc2
-rw-r--r--chrome/browser/ui/webui/options2/advanced_options_handler2.cc4
-rw-r--r--chrome/browser/ui/webui/options2/options_ui2.cc2
-rw-r--r--chrome/browser/ui/webui/options2/personal_options_handler2.cc2
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc2
-rw-r--r--chrome/browser/ui/webui/policy_ui.cc2
-rw-r--r--chrome/browser/ui/webui/print_preview_ui.cc2
-rw-r--r--chrome/browser/ui/webui/profiler_ui.cc2
-rw-r--r--chrome/browser/ui/webui/quota_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/sessions_ui.cc2
-rw-r--r--chrome/browser/ui/webui/sync_internals_ui.cc2
-rw-r--r--chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc2
-rw-r--r--chrome/browser/ui/webui/task_manager_ui.cc2
-rw-r--r--chrome/browser/ui/webui/test_chrome_web_ui_factory.cc2
-rw-r--r--chrome/browser/ui/webui/tracing_ui.cc2
-rw-r--r--chrome/browser/ui/webui/uber/uber_ui.cc2
-rw-r--r--chrome/browser/ui/webui/web_ui_unittest.cc4
-rw-r--r--chrome/browser/ui/webui/workers_ui.cc2
-rw-r--r--chrome/browser/user_style_sheet_watcher.cc2
118 files changed, 233 insertions, 202 deletions
diff --git a/chrome/browser/autocomplete_history_manager.cc b/chrome/browser/autocomplete_history_manager.cc
index 33be279..964697c 100644
--- a/chrome/browser/autocomplete_history_manager.cc
+++ b/chrome/browser/autocomplete_history_manager.cc
@@ -112,7 +112,7 @@ AutocompleteHistoryManager::AutocompleteHistoryManager(
pending_query_handle_(0),
query_id_(0),
external_delegate_(NULL) {
- profile_ = Profile::FromBrowserContext(tab_contents->browser_context());
+ profile_ = Profile::FromBrowserContext(tab_contents->GetBrowserContext());
// May be NULL in unit tests.
web_data_service_ = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS);
autofill_enabled_.Init(prefs::kAutofillEnabled, profile_->GetPrefs(), NULL);
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 8087f81..a6108a7 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -331,7 +331,7 @@ bool AutofillManager::OnFormSubmitted(const FormData& form,
if (!IsAutofillEnabled())
return false;
- if (tab_contents()->browser_context()->IsOffTheRecord())
+ if (tab_contents()->GetBrowserContext()->IsOffTheRecord())
return false;
// Don't save data that was submitted through JavaScript.
@@ -640,7 +640,7 @@ void AutofillManager::OnFillAutofillFormData(int query_id,
void AutofillManager::OnShowAutofillDialog() {
Browser* browser = BrowserList::GetLastActiveWithProfile(
- Profile::FromBrowserContext(tab_contents()->browser_context()));
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext()));
if (browser)
browser->ShowOptionsTab(chrome::kAutofillSubPage);
}
@@ -709,7 +709,7 @@ void AutofillManager::OnDidEndTextFieldEditing() {
bool AutofillManager::IsAutofillEnabled() const {
Profile* profile = Profile::FromBrowserContext(
- const_cast<AutofillManager*>(this)->tab_contents()->browser_context());
+ const_cast<AutofillManager*>(this)->tab_contents()->GetBrowserContext());
return profile->GetPrefs()->GetBoolean(prefs::kAutofillEnabled);
}
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 7e7ff6d..a7448cd 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -727,9 +727,9 @@ void AutomationProvider::OnSetPageFontSize(int tab_handle,
NavigationController* tab = tab_tracker_->GetResource(tab_handle);
DCHECK(tab != NULL);
if (tab && tab->tab_contents()) {
- DCHECK(tab->tab_contents()->browser_context() != NULL);
+ DCHECK(tab->tab_contents()->GetBrowserContext() != NULL);
Profile* profile =
- Profile::FromBrowserContext(tab->tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab->tab_contents()->GetBrowserContext());
profile->GetPrefs()->SetInteger(prefs::kWebKitDefaultFontSize, font_size);
}
}
diff --git a/chrome/browser/automation/automation_util.cc b/chrome/browser/automation/automation_util.cc
index 1f1b64d..a5f6a5e 100644
--- a/chrome/browser/automation/automation_util.cc
+++ b/chrome/browser/automation/automation_util.cc
@@ -160,7 +160,7 @@ Browser* GetBrowserForTab(TabContents* tab) {
net::URLRequestContextGetter* GetRequestContext(TabContents* contents) {
// Since we may be on the UI thread don't call GetURLRequestContext().
// Get the request context specific to the current TabContents and app.
- return contents->browser_context()->GetRequestContextForRenderProcess(
+ return contents->GetBrowserContext()->GetRequestContextForRenderProcess(
contents->GetRenderProcessHost()->GetID());
}
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc
index c78c429..098af80 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -574,7 +574,7 @@ void BackgroundContentsService::AddTabContents(
const gfx::Rect& initial_pos,
bool user_gesture) {
Browser* browser = BrowserList::GetLastActiveWithProfile(
- Profile::FromBrowserContext(new_contents->browser_context()));
+ Profile::FromBrowserContext(new_contents->GetBrowserContext()));
if (!browser)
return;
browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture);
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 7269b0a..7127cc9 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -896,7 +896,7 @@ void ChromeContentBrowserClient::AllowCertificateError(
}
prerender::PrerenderManager* prerender_manager =
prerender::PrerenderManagerFactory::GetForProfile(
- Profile::FromBrowserContext(tab->browser_context()));
+ Profile::FromBrowserContext(tab->GetBrowserContext()));
if (prerender_manager && prerender_manager->IsTabContentsPrerendering(tab)) {
if (prerender_manager->prerender_tracker()->TryCancel(
handler->render_process_host_id(),
@@ -929,7 +929,7 @@ void ChromeContentBrowserClient::SelectClientCertificate(
DCHECK(requesting_url.is_valid()) << "Invalid URL string: https://"
<< cert_request_info->host_and_port;
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
DCHECK(profile);
scoped_ptr<Value> filter(
profile->GetHostContentSettingsMap()->GetWebsiteSetting(
diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc
index db63722..896b85e 100644
--- a/chrome/browser/chromeos/locale_change_guard.cc
+++ b/chrome/browser/chromeos/locale_change_guard.cc
@@ -87,7 +87,8 @@ void LocaleChangeGuard::Observe(int type,
}
switch (type) {
case content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME: {
- if (profile_ == content::Source<TabContents>(source)->browser_context()) {
+ if (profile_ ==
+ content::Source<TabContents>(source)->GetBrowserContext()) {
// We need to perform locale change check only once, so unsubscribe.
registrar_.Remove(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
content::NotificationService::AllSources());
diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc
index 4ae10e0..4e0eed2 100644
--- a/chrome/browser/chromeos/offline/offline_load_page.cc
+++ b/chrome/browser/chromeos/offline/offline_load_page.cc
@@ -85,7 +85,7 @@ std::string OfflineLoadPage::GetHTMLContents() {
strings.SetString("url", failed_url);
// The offline page for app has icons and slightly different message.
- Profile* profile = Profile::FromBrowserContext(tab()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab()->GetBrowserContext());
DCHECK(profile);
const Extension* extension = NULL;
ExtensionService* extensions_service = profile->GetExtensionService();
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 2afe890..08cfd5c 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -50,7 +50,7 @@ bool TabSpecificContentSettings::LocalSharedObjectsContainer::empty() const {
TabSpecificContentSettings::TabSpecificContentSettings(TabContents* tab)
: TabContentsObserver(tab),
- profile_(Profile::FromBrowserContext(tab->browser_context())),
+ profile_(Profile::FromBrowserContext(tab->GetBrowserContext())),
allowed_local_shared_objects_(profile_),
blocked_local_shared_objects_(profile_),
geolocation_settings_state_(profile_),
@@ -474,7 +474,7 @@ void TabSpecificContentSettings::Observe(
// Currently this should be matched by the |primary_pattern|.
settings_details.ptr()->primary_pattern().Matches(entry_url)) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
RendererContentSettingRules rules;
GetRendererContentSettingRules(profile->GetHostContentSettingsMap(),
&rules);
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 9ff2b41..bb347b5 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -279,7 +279,7 @@ void ChromeDownloadManagerDelegate::GetSaveDir(TabContents* tab_contents,
FilePath* website_save_dir,
FilePath* download_save_dir) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
// Check whether the preference has the preferred directory for saving file.
diff --git a/chrome/browser/download/save_package_file_picker.cc b/chrome/browser/download/save_package_file_picker.cc
index 06db2b4..dd0e0f3 100644
--- a/chrome/browser/download/save_package_file_picker.cc
+++ b/chrome/browser/download/save_package_file_picker.cc
@@ -156,7 +156,7 @@ void SavePackageFilePicker::FileSelected(const FilePath& path,
TabContents* tab_contents = save_package_->tab_contents();
SavePackage::SavePackageType save_type = kIndexToSaveType[index];
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
if (select_file_dialog_ &&
select_file_dialog_->HasMultipleFileTypeChoices())
@@ -171,7 +171,7 @@ void SavePackageFilePicker::FileSelected(const FilePath& path,
#endif
// If user change the default saving directory, we will remember it just
// like IE and FireFox.
- if (!tab_contents->browser_context()->IsOffTheRecord() &&
+ if (!tab_contents->GetBrowserContext()->IsOffTheRecord() &&
save_file_path.GetValue() != path_string) {
save_file_path.SetValue(path_string);
}
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc
index a415f5b..48c26f5 100644
--- a/chrome/browser/extensions/extension_browser_event_router.cc
+++ b/chrome/browser/extensions/extension_browser_event_router.cc
@@ -251,7 +251,7 @@ void ExtensionBrowserEventRouter::OnBrowserSetLastActive(
void ExtensionBrowserEventRouter::TabCreatedAt(TabContents* contents,
int index,
bool active) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
DispatchEventWithTab(profile, "", events::kOnTabCreated, contents, active);
RegisterForTabNotifications(contents);
@@ -517,7 +517,7 @@ void ExtensionBrowserEventRouter::DispatchTabUpdatedEvent(
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
DispatchEvent(profile, events::kOnTabUpdated, json_args);
}
diff --git a/chrome/browser/extensions/extension_debugger_api.cc b/chrome/browser/extensions/extension_debugger_api.cc
index 9ceb318..44e5509 100644
--- a/chrome/browser/extensions/extension_debugger_api.cc
+++ b/chrome/browser/extensions/extension_debugger_api.cc
@@ -133,7 +133,7 @@ ExtensionDevToolsClientHost::ExtensionDevToolsClientHost(
// Detach from debugger when extension unloads.
Profile* profile =
- Profile::FromBrowserContext(tab_contents_->browser_context());
+ Profile::FromBrowserContext(tab_contents_->GetBrowserContext());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(profile));
@@ -157,7 +157,7 @@ bool ExtensionDevToolsClientHost::MatchesContentsAndExtensionId(
void ExtensionDevToolsClientHost::InspectedTabClosing() {
// Tell extension that this client host has been detached.
Profile* profile =
- Profile::FromBrowserContext(tab_contents_->browser_context());
+ Profile::FromBrowserContext(tab_contents_->GetBrowserContext());
if (profile != NULL && profile->GetExtensionEventRouter()) {
ListValue args;
args.Append(CreateDebuggeeId(tab_id_));
@@ -209,7 +209,7 @@ void ExtensionDevToolsClientHost::Observe(
void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend(
const std::string& message) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents_->browser_context());
+ Profile::FromBrowserContext(tab_contents_->GetBrowserContext());
if (profile == NULL || !profile->GetExtensionEventRouter())
return;
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index b007ce2..a282b6e 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -508,8 +508,8 @@ void ExtensionHost::AddNewContents(TabContents* source,
if (disposition != NEW_POPUP) {
TabContents* associated_contents = GetAssociatedTabContents();
if (associated_contents &&
- associated_contents->browser_context() ==
- new_contents->browser_context()) {
+ associated_contents->GetBrowserContext() ==
+ new_contents->GetBrowserContext()) {
associated_contents->AddNewContents(
new_contents, disposition, initial_pos, user_gesture);
return;
@@ -519,7 +519,7 @@ void ExtensionHost::AddNewContents(TabContents* source,
// Find a browser with a profile that matches the new tab. If none is found,
// NULL argument to NavigateParams is valid.
Profile* profile =
- Profile::FromBrowserContext(new_contents->browser_context());
+ Profile::FromBrowserContext(new_contents->GetBrowserContext());
Browser* browser = BrowserList::FindTabbedBrowser(
profile, false); // Match incognito exactly.
TabContentsWrapper* wrapper = new TabContentsWrapper(new_contents);
diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc
index 5273696..5aee503 100644
--- a/chrome/browser/extensions/extension_tab_helper.cc
+++ b/chrome/browser/extensions/extension_tab_helper.cc
@@ -67,7 +67,7 @@ void ExtensionTabHelper::SetExtensionAppById(
return;
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
ExtensionService* extension_service = profile->GetExtensionService();
if (!extension_service || !extension_service->is_ready())
return;
@@ -92,7 +92,7 @@ void ExtensionTabHelper::DidNavigateMainFrame(
return;
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
if (!service)
return;
@@ -165,7 +165,7 @@ void ExtensionTabHelper::OnGetAppNotifyChannel(
// Check for permission first.
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
ExtensionService* extension_service = profile->GetExtensionService();
extensions::ProcessMap* process_map = extension_service->process_map();
content::RenderProcessHost* process =
@@ -208,7 +208,7 @@ void ExtensionTabHelper::AppNotifyChannelSetupComplete(
// If the setup was successful, record that fact in ExtensionService.
if (!channel_id.empty() && error.empty()) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
if (service->GetExtensionById(setup->extension_id(), true))
service->SetAppNotificationSetupDone(setup->extension_id(),
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index ba8a740..4c1f7cb 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -113,7 +113,7 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue(const TabContents* contents,
tab_strip && tab_strip->IsTabPinned(tab_index));
result->SetString(keys::kTitleKey, contents->GetTitle());
result->SetBoolean(keys::kIncognitoKey,
- contents->browser_context()->IsOffTheRecord());
+ contents->GetBrowserContext()->IsOffTheRecord());
if (!is_loading) {
NavigationEntry* entry = contents->GetController().GetActiveEntry();
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 80ecfa9..9acd62f 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -128,7 +128,7 @@ ExtensionWebUI::ExtensionWebUI(TabContents* tab_contents, const GURL& url)
: ChromeWebUI(tab_contents),
url_(url) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
const Extension* extension =
service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url));
@@ -342,7 +342,7 @@ void ExtensionWebUI::UnregisterAndReplaceOverride(const std::string& page,
for (TabContentsIterator iterator; !iterator.done(); ++iterator) {
TabContents* tab = (*iterator)->tab_contents();
Profile* tab_profile =
- Profile::FromBrowserContext(tab->browser_context());
+ Profile::FromBrowserContext(tab->GetBrowserContext());
if (tab_profile != profile)
continue;
diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc
index c79eae6..ea1f00f 100644
--- a/chrome/browser/extensions/extension_webnavigation_api.cc
+++ b/chrome/browser/extensions/extension_webnavigation_api.cc
@@ -85,7 +85,7 @@ void DispatchOnBeforeNavigate(TabContents* tab_contents,
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(tab_contents->browser_context(),
+ DispatchEvent(tab_contents->GetBrowserContext(),
keys::kOnBeforeNavigate,
json_args);
}
@@ -122,7 +122,7 @@ void DispatchOnCommitted(const char* event_name,
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(tab_contents->browser_context(), event_name, json_args);
+ DispatchEvent(tab_contents->GetBrowserContext(), event_name, json_args);
}
// Constructs and dispatches an onDOMContentLoaded event.
@@ -141,7 +141,7 @@ void DispatchOnDOMContentLoaded(TabContents* tab_contents,
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(tab_contents->browser_context(),
+ DispatchEvent(tab_contents->GetBrowserContext(),
keys::kOnDOMContentLoaded,
json_args);
}
@@ -162,7 +162,8 @@ void DispatchOnCompleted(TabContents* tab_contents,
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(tab_contents->browser_context(), keys::kOnCompleted, json_args);
+ DispatchEvent(tab_contents->GetBrowserContext(),
+ keys::kOnCompleted, json_args);
}
// Constructs and dispatches an onCreatedNavigationTarget event.
@@ -177,7 +178,7 @@ void DispatchOnCreatedNavigationTarget(
// path is exercised by ExtensionApiTest.WebNavigationRequestOpenTab.
DCHECK(ExtensionTabUtil::GetTabById(
ExtensionTabUtil::GetTabId(target_tab_contents),
- Profile::FromBrowserContext(target_tab_contents->browser_context()),
+ Profile::FromBrowserContext(target_tab_contents->GetBrowserContext()),
false, NULL, NULL, NULL, NULL));
ListValue args;
@@ -216,7 +217,7 @@ void DispatchOnErrorOccurred(TabContents* tab_contents,
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(tab_contents->browser_context(),
+ DispatchEvent(tab_contents->GetBrowserContext(),
keys::kOnErrorOccurred,
json_args);
}
@@ -440,7 +441,7 @@ void ExtensionWebNavigationEventRouter::Retargeting(
} else {
DispatchOnCreatedNavigationTarget(
details->source_tab_contents,
- details->target_tab_contents->browser_context(),
+ details->target_tab_contents->GetBrowserContext(),
details->source_frame_id,
frame_navigation_state.IsMainFrame(details->source_frame_id),
details->target_tab_contents,
@@ -456,7 +457,7 @@ void ExtensionWebNavigationEventRouter::TabAdded(TabContents* tab_contents) {
DispatchOnCreatedNavigationTarget(
iter->second.source_tab_contents,
- iter->second.target_tab_contents->browser_context(),
+ iter->second.target_tab_contents->GetBrowserContext(),
iter->second.source_frame_id,
iter->second.source_frame_is_main_frame,
iter->second.target_tab_contents,
@@ -618,7 +619,7 @@ void ExtensionWebNavigationTabObserver::DidOpenRequestedURL(
DispatchOnCreatedNavigationTarget(
tab_contents(),
- new_contents->browser_context(),
+ new_contents->GetBrowserContext(),
source_frame_id,
navigation_state_.IsMainFrame(source_frame_id),
new_contents,
diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc
index 7bfe238..2d115f3 100644
--- a/chrome/browser/extensions/isolated_app_browsertest.cc
+++ b/chrome/browser/extensions/isolated_app_browsertest.cc
@@ -33,7 +33,8 @@ class IsolatedAppTest : public ExtensionBrowserTest {
const Extension* GetInstalledApp(TabContents* contents) {
const Extension* installed_app = NULL;
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
if (service) {
installed_app = service->GetInstalledAppForRenderer(
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 73c0589..8c5a678 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -173,7 +173,7 @@ void WebstoreInlineInstaller::BeginInstall() {
webstore_data_url_fetcher_.reset(content::URLFetcher::Create(
webstore_data_url, content::URLFetcher::GET, this));
Profile* profile = Profile::FromBrowserContext(
- tab_contents()->browser_context());
+ tab_contents()->GetBrowserContext());
webstore_data_url_fetcher_->SetRequestContext(
profile->GetRequestContext());
// Use the requesting page as the referrer both since that is more correct
@@ -319,7 +319,7 @@ void WebstoreInlineInstaller::OnWebstoreResponseParseSuccess(
manifest,
"", // We don't have any icon data.
icon_url,
- Profile::FromBrowserContext(tab_contents()->browser_context())->
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext())->
GetRequestContext());
// The helper will call us back via OnWebstoreParseSucces or
// OnWebstoreParseFailure.
@@ -346,7 +346,7 @@ void WebstoreInlineInstaller::OnWebstoreParseSuccess(
icon_ = icon;
Profile* profile = Profile::FromBrowserContext(
- tab_contents()->browser_context());
+ tab_contents()->GetBrowserContext());
ExtensionInstallUI::Prompt prompt(ExtensionInstallUI::INLINE_INSTALL_PROMPT);
prompt.SetInlineInstallWebstoreData(localized_user_count_,
@@ -391,7 +391,7 @@ void WebstoreInlineInstaller::InstallUIProceed() {
CrxInstaller::SetWhitelistEntry(id_, entry);
Profile* profile = Profile::FromBrowserContext(
- tab_contents()->browser_context());
+ tab_contents()->GetBrowserContext());
scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
profile, this, &(tab_contents()->GetController()), id_,
diff --git a/chrome/browser/favicon/favicon_handler_unittest.cc b/chrome/browser/favicon/favicon_handler_unittest.cc
index bdf05d8..1358ba5 100644
--- a/chrome/browser/favicon/favicon_handler_unittest.cc
+++ b/chrome/browser/favicon/favicon_handler_unittest.cc
@@ -312,7 +312,8 @@ TEST_F(FaviconHandlerTest, GetFaviconFromHistory) {
const GURL icon_url("http://www.google.com/favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::FAVICON);
@@ -360,7 +361,8 @@ TEST_F(FaviconHandlerTest, DownloadFavicon) {
const GURL icon_url("http://www.google.com/favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::FAVICON);
@@ -427,7 +429,8 @@ TEST_F(FaviconHandlerTest, UpdateAndDownloadFavicon) {
const GURL new_icon_url("http://www.google.com/new_favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::FAVICON);
@@ -515,7 +518,8 @@ TEST_F(FaviconHandlerTest, UpdateFavicon) {
const GURL new_icon_url("http://www.google.com/new_favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::FAVICON);
@@ -589,7 +593,8 @@ TEST_F(FaviconHandlerTest, Download2ndFaviconURLCandidate) {
const GURL new_icon_url("http://www.google.com/new_favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::TOUCH);
@@ -706,7 +711,8 @@ TEST_F(FaviconHandlerTest, UpdateDuringDownloading) {
const GURL new_icon_url("http://www.google.com/new_favicon");
TestFaviconHandlerDelegate delegate(contents());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
TestFaviconHandler helper(page_url, profile,
&delegate, FaviconHandler::TOUCH);
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index 8df87aa..b3c0883 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -22,7 +22,7 @@
FaviconTabHelper::FaviconTabHelper(TabContents* tab_contents)
: TabContentsObserver(tab_contents),
- profile_(Profile::FromBrowserContext(tab_contents->browser_context())) {
+ profile_(Profile::FromBrowserContext(tab_contents->GetBrowserContext())) {
favicon_handler_.reset(new FaviconHandler(profile_, this,
FaviconHandler::FAVICON));
if (chrome::kEnableTouchIcon)
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 65b501d..d087b25 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -147,7 +147,7 @@ void HistoryTabHelper::OnThumbnail(const GURL& url,
const ThumbnailScore& score,
const SkBitmap& bitmap) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
@@ -161,7 +161,7 @@ void HistoryTabHelper::OnThumbnail(const GURL& url,
HistoryService* HistoryTabHelper::GetHistoryService() {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
if (profile->IsOffTheRecord())
return NULL;
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc
index 32f8ba3..8e8e832 100644
--- a/chrome/browser/history/top_sites.cc
+++ b/chrome/browser/history/top_sites.cc
@@ -848,7 +848,7 @@ void TopSites::Observe(int type,
NavigationController* controller =
content::Source<NavigationController>(source).ptr();
Profile* profile = Profile::FromBrowserContext(
- controller->tab_contents()->browser_context());
+ controller->tab_contents()->GetBrowserContext());
if (profile == profile_ && !IsFull()) {
content::LoadCommittedDetails* load_details =
content::Details<content::LoadCommittedDetails>(details).ptr();
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 52ef74a..282cf79 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -814,7 +814,7 @@ void PrerenderManager::RecordPerceivedPageLoadTime(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
PrerenderManager* prerender_manager =
PrerenderManagerFactory::GetForProfile(
- Profile::FromBrowserContext(tab_contents->browser_context()));
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext()));
if (!prerender_manager)
return;
if (!prerender_manager->is_enabled())
diff --git a/chrome/browser/prerender/prerender_tab_helper.cc b/chrome/browser/prerender/prerender_tab_helper.cc
index ac00da4..abf6ef5 100644
--- a/chrome/browser/prerender/prerender_tab_helper.cc
+++ b/chrome/browser/prerender/prerender_tab_helper.cc
@@ -244,7 +244,7 @@ void PrerenderTabHelper::DidStartProvisionalLoadForFrame(
PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const {
return PrerenderManagerFactory::GetForProfile(
- Profile::FromBrowserContext(tab_contents()->browser_context()));
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext()));
}
bool PrerenderTabHelper::MaybeUsePrerenderedPage(const GURL& url,
diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc
index 3c634d9..6acf2bd 100644
--- a/chrome/browser/printing/print_preview_tab_controller.cc
+++ b/chrome/browser/printing/print_preview_tab_controller.cc
@@ -363,7 +363,7 @@ TabContentsWrapper* PrintPreviewTabController::CreatePrintPreviewTab(
if (!current_browser) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) {
Profile* profile = Profile::FromBrowserContext(
- initiator_tab->tab_contents()->browser_context());
+ initiator_tab->tab_contents()->GetBrowserContext());
current_browser = Browser::CreateForType(Browser::TYPE_POPUP, profile);
if (!current_browser) {
NOTREACHED() << "Failed to create popup browser window";
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 57b6ca5..f2584a0 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -89,9 +89,9 @@ Profile* Profile::FromWebUI(WebUI* web_ui) {
// TODO(dhollowa): Crash diagnosis http://crbug.com/97802
CHECK(web_ui);
CHECK(web_ui->tab_contents());
- CHECK(web_ui->tab_contents()->browser_context());
+ CHECK(web_ui->tab_contents()->GetBrowserContext());
- return FromBrowserContext(web_ui->tab_contents()->browser_context());
+ return FromBrowserContext(web_ui->tab_contents()->GetBrowserContext());
}
TestingProfile* Profile::AsTestingProfile() {
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc
index f91cd839..c0e122c 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc
@@ -433,8 +433,8 @@ bool BrowserFeatureExtractor::GetPendingQuery(
bool BrowserFeatureExtractor::GetHistoryService(HistoryService** history) {
*history = NULL;
- if (tab_ && tab_->browser_context()) {
- Profile* profile = Profile::FromBrowserContext(tab_->browser_context());
+ if (tab_ && tab_->GetBrowserContext()) {
+ Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext());
*history = profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (*history) {
return true;
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc
index f4ef976..17b8123 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host.cc
@@ -97,7 +97,7 @@ class ClientSideDetectionHost::ShouldClassifyUrlRequest
}
// Don't run the phishing classifier if the tab is incognito.
- if (tab_contents_->browser_context()->IsOffTheRecord()) {
+ if (tab_contents_->GetBrowserContext()->IsOffTheRecord()) {
VLOG(1) << "Skipping phishing classification for URL: " << params_.url
<< " because we're browsing incognito.";
UMA_HISTOGRAM_ENUMERATION("SBClientPhishing.PreClassificationCheckFail",
diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc
index 481cb70..95f7de5 100644
--- a/chrome/browser/safe_browsing/malware_details.cc
+++ b/chrome/browser/safe_browsing/malware_details.cc
@@ -75,7 +75,7 @@ MalwareDetails::MalwareDetails(
TabContents* tab_contents,
const SafeBrowsingService::UnsafeResource& resource)
: TabContentsObserver(tab_contents),
- profile_(Profile::FromBrowserContext(tab_contents->browser_context())),
+ profile_(Profile::FromBrowserContext(tab_contents->GetBrowserContext())),
request_context_getter_(profile_->GetRequestContext()),
sb_service_(sb_service),
resource_(resource),
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 4ea3212..531c40b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -166,7 +166,7 @@ SafeBrowsingBlockingPage::SafeBrowsingBlockingPage(
}
bool SafeBrowsingBlockingPage::CanShowMalwareDetailsOption() {
- return (!tab()->browser_context()->IsOffTheRecord() &&
+ return (!tab()->GetBrowserContext()->IsOffTheRecord() &&
tab()->GetURL().SchemeIs(chrome::kHttpScheme));
}
@@ -369,7 +369,7 @@ void SafeBrowsingBlockingPage::PopulateMalwareStringDictionary(
IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE,
UTF8ToUTF16(privacy_link)));
- Profile* profile = Profile::FromBrowserContext(tab()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab()->GetBrowserContext());
const PrefService::Preference* pref =
profile->GetPrefs()->FindPreference(
prefs::kSafeBrowsingReportingEnabled);
@@ -534,7 +534,7 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) {
}
void SafeBrowsingBlockingPage::SetReportingPreference(bool report) {
- Profile* profile = Profile::FromBrowserContext(tab()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab()->GetBrowserContext());
PrefService* pref = profile->GetPrefs();
pref->SetBoolean(prefs::kSafeBrowsingReportingEnabled, report);
}
@@ -658,7 +658,7 @@ void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) {
if (malware_details_ == NULL)
return; // Not all interstitials have malware details (eg phishing).
- Profile* profile = Profile::FromBrowserContext(tab()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab()->GetBrowserContext());
const PrefService::Preference* pref =
profile->GetPrefs()->FindPreference(prefs::kSafeBrowsingReportingEnabled);
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index a6c2704..37d7e02 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -193,7 +193,8 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness,
// Tests showing a blocking page for a malware page and not proceeding.
TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) {
// Enable malware details.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Start a load.
@@ -226,7 +227,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) {
// Tests showing a blocking page for a malware page and then proceeding.
TEST_F(SafeBrowsingBlockingPageTest, MalwarePageProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Start a load.
@@ -257,7 +259,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageProceed) {
// and not proceeding.
TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceDontProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere.
@@ -291,7 +294,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceDontProceed) {
// and proceeding.
TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere.
@@ -323,7 +327,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceProceed) {
TEST_F(SafeBrowsingBlockingPageTest,
PageWithMultipleMalwareResourceDontProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere.
@@ -363,7 +368,8 @@ TEST_F(SafeBrowsingBlockingPageTest,
TEST_F(SafeBrowsingBlockingPageTest,
PageWithMultipleMalwareResourceProceedThenDontProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere.
@@ -418,7 +424,8 @@ TEST_F(SafeBrowsingBlockingPageTest,
// subresources and proceeding through the multiple interstitials.
TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere else.
@@ -468,7 +475,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) {
// controller entries are OK. http://crbug.com/17627
TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Navigate somewhere.
@@ -515,7 +523,8 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) {
// cause problems. http://crbug.com/30079
TEST_F(SafeBrowsingBlockingPageTest, ProceedThenDontProceed) {
// Enable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
// Start a load.
@@ -549,7 +558,8 @@ TEST_F(SafeBrowsingBlockingPageTest, ProceedThenDontProceed) {
// Tests showing a blocking page for a malware page with reports disabled.
TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsDisabled) {
// Disable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, false);
// Start a load.
@@ -581,7 +591,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsDisabled) {
// Test setting the malware report preferance
TEST_F(SafeBrowsingBlockingPageTest, MalwareReports) {
// Disable malware reports.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile = Profile::FromBrowserContext(
+ contents()->GetBrowserContext());
profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, false);
// Start a load.
diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc
index 17b83c4..ec8ba22 100644
--- a/chrome/browser/sidebar/sidebar_container.cc
+++ b/chrome/browser/sidebar/sidebar_container.cc
@@ -31,7 +31,7 @@ SidebarContainer::SidebarContainer(TabContents* tab,
use_default_icon_(true) {
// Create TabContents for sidebar.
sidebar_contents_.reset(
- new TabContents(Profile::FromBrowserContext(tab->browser_context()),
+ new TabContents(Profile::FromBrowserContext(tab->GetBrowserContext()),
NULL, MSG_ROUTING_NONE, NULL, NULL));
sidebar_contents_->SetDelegate(this);
}
@@ -123,7 +123,7 @@ void SidebarContainer::OnImageLoaded(SkBitmap* image,
const Extension* SidebarContainer::GetExtension() const {
Profile* profile =
- Profile::FromBrowserContext(sidebar_contents_->browser_context());
+ Profile::FromBrowserContext(sidebar_contents_->GetBrowserContext());
ExtensionService* service = profile->GetExtensionService();
if (!service)
return NULL;
diff --git a/chrome/browser/sidebar/sidebar_manager.cc b/chrome/browser/sidebar/sidebar_manager.cc
index dc1d04d..caf9e8e 100644
--- a/chrome/browser/sidebar/sidebar_manager.cc
+++ b/chrome/browser/sidebar/sidebar_manager.cc
@@ -88,7 +88,7 @@ void SidebarManager::NotifyStateChanges(
if (was_active_host != NULL) {
Profile* profile = Profile::FromBrowserContext(
- was_active_sidebar_contents->browser_context());
+ was_active_sidebar_contents->GetBrowserContext());
ExtensionSidebarEventRouter::OnStateChanged(
profile,
was_active_host->tab_contents(),
@@ -98,7 +98,7 @@ void SidebarManager::NotifyStateChanges(
if (active_host != NULL) {
Profile* profile = Profile::FromBrowserContext(
- active_sidebar_contents->browser_context());
+ active_sidebar_contents->GetBrowserContext());
ExtensionSidebarEventRouter::OnStateChanged(
profile,
active_host->tab_contents(),
@@ -121,7 +121,7 @@ void SidebarManager::ShowSidebar(TabContents* tab,
host->Show();
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
ExtensionSidebarEventRouter::OnStateChanged(
profile, tab, content_id,
extension_sidebar_constants::kShownState);
@@ -179,7 +179,7 @@ void SidebarManager::HideSidebar(TabContents* tab,
UnregisterSidebarContainerFor(tab, content_id);
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
ExtensionSidebarEventRouter::OnStateChanged(
profile, tab, content_id,
extension_sidebar_constants::kHiddenState);
diff --git a/chrome/browser/speech/speech_input_bubble_gtk.cc b/chrome/browser/speech/speech_input_bubble_gtk.cc
index 842b558..471ca97 100644
--- a/chrome/browser/speech/speech_input_bubble_gtk.cc
+++ b/chrome/browser/speech/speech_input_bubble_gtk.cc
@@ -110,7 +110,7 @@ void SpeechInputBubbleGtk::OnTryAgainClicked(GtkWidget* widget) {
void SpeechInputBubbleGtk::OnMicSettingsClicked(GtkWidget* widget) {
speech_input::SpeechInputManager::ShowAudioInputSettingsFromUI(
- &tab_contents()->browser_context()->GetResourceContext());
+ &tab_contents()->GetBrowserContext()->GetResourceContext());
Hide();
}
@@ -137,7 +137,7 @@ void SpeechInputBubbleGtk::Show() {
kBubbleControlVerticalSpacing);
Profile* profile = Profile::FromBrowserContext(
- tab_contents()->browser_context());
+ tab_contents()->GetBrowserContext());
// TODO(tommi): The audio_manager property can only be accessed from the
// IO thread, so we can't call CanShowAudioInputSettings directly here if
diff --git a/chrome/browser/speech/speech_input_bubble_views.cc b/chrome/browser/speech/speech_input_bubble_views.cc
index e7714c9..ab71bf4 100644
--- a/chrome/browser/speech/speech_input_bubble_views.cc
+++ b/chrome/browser/speech/speech_input_bubble_views.cc
@@ -212,7 +212,7 @@ void SpeechInputBubbleView::ButtonPressed(views::Button* source,
void SpeechInputBubbleView::LinkClicked(views::Link* source, int event_flags) {
DCHECK_EQ(source, mic_settings_);
speech_input::SpeechInputManager::ShowAudioInputSettingsFromUI(
- &tab_contents_->browser_context()->GetResourceContext());
+ &tab_contents_->GetBrowserContext()->GetResourceContext());
}
gfx::Size SpeechInputBubbleView::GetPreferredSize() {
@@ -342,7 +342,7 @@ void SpeechInputBubbleImpl::Show() {
// Anchor to the location icon view, in case |element_rect| is offscreen.
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
Browser* browser = Browser::GetOrCreateTabbedBrowser(profile);
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
views::View* icon = browser_view->GetLocationBarView() ?
diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc
index ab879bc..cee05f9 100644
--- a/chrome/browser/sync/glue/session_change_processor.cc
+++ b/chrome/browser/sync/glue/session_change_processor.cc
@@ -164,7 +164,8 @@ void SessionChangeProcessor::Observe(
ExtensionTabHelper* extension_tab_helper =
content::Source<ExtensionTabHelper>(source).ptr();
if (!extension_tab_helper ||
- extension_tab_helper->tab_contents()->browser_context() != profile_) {
+ extension_tab_helper->tab_contents()->GetBrowserContext() !=
+ profile_) {
return;
}
if (extension_tab_helper->extension_app()) {
diff --git a/chrome/browser/tab_contents/chrome_interstitial_page.cc b/chrome/browser/tab_contents/chrome_interstitial_page.cc
index 9c9940c..ba6d562 100644
--- a/chrome/browser/tab_contents/chrome_interstitial_page.cc
+++ b/chrome/browser/tab_contents/chrome_interstitial_page.cc
@@ -18,7 +18,7 @@ ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab,
bool new_navigation,
const GURL& url)
: InterstitialPage(tab, new_navigation, url) {
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
content::RendererPreferences prefs;
renderer_preferences_util::UpdateFromSystemSettings(&prefs, profile);
set_renderer_preferences(prefs);
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 6f22541..5ac6612 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -233,7 +233,7 @@ RenderViewContextMenu::RenderViewContextMenu(
const ContextMenuParams& params)
: params_(params),
source_tab_contents_(tab_contents),
- profile_(Profile::FromBrowserContext(tab_contents->browser_context())),
+ profile_(Profile::FromBrowserContext(tab_contents->GetBrowserContext())),
ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)),
external_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(speech_input_submenu_model_(this)),
@@ -1842,7 +1842,7 @@ void RenderViewContextMenu::OpenURL(
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_RETARGETING,
content::Source<Profile>(Profile::FromBrowserContext(
- source_tab_contents_->browser_context())),
+ source_tab_contents_->GetBrowserContext())),
content::Details<RetargetingDetails>(&details));
}
}
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index f3f8cc3..9daffb5 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -261,7 +261,7 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindowFromTabContents(
const ViewHostMsg_CreateWindow_Params& params) {
TabContents* new_contents = CreateNewWindow(
route_id,
- Profile::FromBrowserContext(tab_contents->browser_context()),
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext()),
tab_contents->GetSiteInstance(),
tab_contents->GetWebUITypeForCurrentState(),
tab_contents,
@@ -281,7 +281,7 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindowFromTabContents(
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_RETARGETING,
content::Source<Profile>(
- Profile::FromBrowserContext(tab_contents->browser_context())),
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext())),
content::Details<RetargetingDetails>(&details));
} else {
content::NotificationService::current()->Notify(
diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc
index 58b7fb7..9ed8c74 100644
--- a/chrome/browser/tab_contents/tab_util.cc
+++ b/chrome/browser/tab_contents/tab_util.cc
@@ -42,7 +42,7 @@ SiteInstance* GetSiteInstanceForNewTab(TabContents* source_contents,
// Don't use this logic when "--process-per-tab" is specified.
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessPerTab) &&
- SiteInstance::IsSameWebSite(source_contents->browser_context(),
+ SiteInstance::IsSameWebSite(source_contents->GetBrowserContext(),
source_contents->GetURL(),
url)) {
return source_contents->GetSiteInstance();
diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc
index 49147f2..61d2cef 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -449,7 +449,7 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary(
TabContents* tab_contents) {
const GURL& url = tab_contents->GetURL();
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
history::TopSites* top_sites = profile->GetTopSites();
// Skip if we don't need to update the thumbnail.
if (!ShouldUpdateThumbnail(profile, top_sites, url))
diff --git a/chrome/browser/tabs/tab_finder.cc b/chrome/browser/tabs/tab_finder.cc
index 311552c9..0ab8342c 100644
--- a/chrome/browser/tabs/tab_finder.cc
+++ b/chrome/browser/tabs/tab_finder.cc
@@ -185,7 +185,7 @@ void TabFinder::TabDestroyed(TabContentsObserverImpl* observer) {
void TabFinder::CancelRequestsFor(TabContents* tab_contents) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
@@ -203,7 +203,7 @@ void TabFinder::CancelRequestsFor(TabContents* tab_contents) {
}
void TabFinder::FetchRedirectStart(TabContents* tab) {
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc
index f687db0..c835e31 100644
--- a/chrome/browser/translate/options_menu_model.cc
+++ b/chrome/browser/translate/options_menu_model.cc
@@ -38,7 +38,7 @@ OptionsMenuModel::OptionsMenuModel(
// Populate the menu.
// Incognito mode does not get any preferences related items.
if (!translate_delegate->owner()->tab_contents()->
- browser_context()->IsOffTheRecord()) {
+ GetBrowserContext()->IsOffTheRecord()) {
AddCheckItem(IDC_TRANSLATE_OPTIONS_ALWAYS,
l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS,
original_language, target_language));
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 1439d25..ef3c36c 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -111,7 +111,7 @@ void TranslateInfoBarDelegate::SetTargetLanguage(size_t language_index) {
void TranslateInfoBarDelegate::Translate() {
const std::string& original_language_code = GetOriginalLanguageCode();
- if (!owner()->tab_contents()->browser_context()->IsOffTheRecord()) {
+ if (!owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord()) {
prefs_.ResetTranslationDeniedCount(original_language_code);
prefs_.IncrementTranslationAcceptedCount(original_language_code);
}
@@ -133,7 +133,7 @@ void TranslateInfoBarDelegate::ReportLanguageDetectionError() {
void TranslateInfoBarDelegate::TranslationDeclined() {
const std::string& original_language_code = GetOriginalLanguageCode();
- if (!owner()->tab_contents()->browser_context()->IsOffTheRecord()) {
+ if (!owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord()) {
prefs_.ResetTranslationAcceptedCount(original_language_code);
prefs_.IncrementTranslationDeniedCount(original_language_code);
}
@@ -270,13 +270,13 @@ bool TranslateInfoBarDelegate::ShouldShowMessageInfoBarButton() {
bool TranslateInfoBarDelegate::ShouldShowNeverTranslateButton() {
DCHECK_EQ(BEFORE_TRANSLATE, type_);
- return !owner()->tab_contents()->browser_context()->IsOffTheRecord() &&
+ return !owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord() &&
(prefs_.GetTranslationDeniedCount(GetOriginalLanguageCode()) >= 3);
}
bool TranslateInfoBarDelegate::ShouldShowAlwaysTranslateButton() {
DCHECK_EQ(BEFORE_TRANSLATE, type_);
- return !owner()->tab_contents()->browser_context()->IsOffTheRecord() &&
+ return !owner()->tab_contents()->GetBrowserContext()->IsOffTheRecord() &&
(prefs_.GetTranslationAcceptedCount(GetOriginalLanguageCode()) >= 3);
}
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index 0d23440..60a6de7 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -456,7 +456,7 @@ TranslateManager::TranslateManager()
void TranslateManager::InitiateTranslation(TabContents* tab,
const std::string& page_lang) {
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
if (!prefs->GetBoolean(prefs::kEnableTranslate))
return;
@@ -500,7 +500,7 @@ void TranslateManager::InitiateTranslation(TabContents* tab,
// feature; the user will get an infobar, so they can control whether the
// page's text is sent to the translate server.
std::string auto_target_lang;
- if (!tab->browser_context()->IsOffTheRecord() &&
+ if (!tab->GetBrowserContext()->IsOffTheRecord() &&
TranslatePrefs::ShouldAutoTranslate(prefs, language_code,
&auto_target_lang)) {
// We need to confirm that the saved target language is still supported.
@@ -615,7 +615,7 @@ void TranslateManager::ReportLanguageDetectionError(TabContents* tab_contents) {
GetLanguageCode(g_browser_process->GetApplicationLocale());
// Open that URL in a new tab so that the user can tell us more.
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
if (!browser) {
NOTREACHED();
@@ -681,7 +681,7 @@ void TranslateManager::PageTranslated(TabContents* tab,
bool TranslateManager::IsAcceptLanguage(TabContents* tab,
const std::string& language) {
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
profile = profile->GetOriginalProfile();
PrefService* pref_service = profile->GetPrefs();
PrefServiceLanguagesMap::const_iterator iter =
diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc
index cb168fc..28f84ce 100644
--- a/chrome/browser/translate/translate_manager_browsertest.cc
+++ b/chrome/browser/translate/translate_manager_browsertest.cc
@@ -580,7 +580,8 @@ TEST_F(TranslateManagerTest, FetchLanguagesFromTranslateServer) {
// To make sure we got the defaults and don't confuse them with the mocks.
ASSERT_NE(default_supported_languages.size(), server_languages.size());
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
TranslateManager::GetInstance()->FetchLanguageListFromTranslateServer(prefs);
@@ -899,7 +900,8 @@ TEST_F(TranslateManagerTest, UnsupportedUILanguage) {
g_browser_process->SetApplicationLocale("qbz");
// Make sure that the accept language list only contains unsupported languages
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
prefs->SetString(prefs::kAcceptLanguages, "qbz");
@@ -920,7 +922,8 @@ TEST_F(TranslateManagerTest, TranslateAcceptLanguage) {
g_browser_process->SetApplicationLocale("qbz");
// Set Qbz and French as the only accepted languages
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
prefs->SetString(prefs::kAcceptLanguages, "qbz,fr");
@@ -945,7 +948,8 @@ TEST_F(TranslateManagerTest, TranslateAcceptLanguage) {
// Tests that the translate enabled preference is honored.
TEST_F(TranslateManagerTest, TranslateEnabledPref) {
// Make sure the pref allows translate.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
prefs->SetBoolean(prefs::kEnableTranslate, true);
@@ -982,7 +986,8 @@ TEST_F(TranslateManagerTest, NeverTranslateLanguagePref) {
EXPECT_TRUE(GetTranslateInfoBar() != NULL);
// Select never translate this language.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
PrefChangeRegistrar registrar;
registrar.Init(prefs);
@@ -1029,7 +1034,8 @@ TEST_F(TranslateManagerTest, NeverTranslateSitePref) {
EXPECT_TRUE(GetTranslateInfoBar() != NULL);
// Select never translate this site.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
PrefChangeRegistrar registrar;
registrar.Init(prefs);
@@ -1068,7 +1074,8 @@ TEST_F(TranslateManagerTest, NeverTranslateSitePref) {
// Tests the "Always translate this language" pref.
TEST_F(TranslateManagerTest, AlwaysTranslateLanguagePref) {
// Select always translate French to English.
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
PrefChangeRegistrar registrar;
registrar.Init(prefs);
@@ -1105,7 +1112,7 @@ TEST_F(TranslateManagerTest, AlwaysTranslateLanguagePref) {
// Let's switch to incognito mode, it should not be autotranslated in that
// case either.
TestingProfile* test_profile =
- static_cast<TestingProfile*>(contents()->browser_context());
+ static_cast<TestingProfile*>(contents()->GetBrowserContext());
test_profile->set_incognito(true);
SimulateNavigation(GURL("http://www.youtube.fr"), "fr", true);
EXPECT_FALSE(GetTranslateMessage(&page_id, &original_lang, &target_lang));
@@ -1128,7 +1135,8 @@ TEST_F(TranslateManagerTest, AlwaysTranslateLanguagePref) {
TEST_F(TranslateManagerTest, ContextMenu) {
// Blacklist www.google.fr and French for translation.
GURL url("http://www.google.fr");
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
TranslatePrefs translate_prefs(profile->GetPrefs());
translate_prefs.BlacklistLanguage("fr");
translate_prefs.BlacklistSite(url.host());
@@ -1236,7 +1244,8 @@ TEST_F(TranslateManagerTest, ContextMenu) {
// translate" infobar when the translation is accepted/declined 3 times,
// only when not in incognito mode.
TEST_F(TranslateManagerTest, BeforeTranslateExtraButtons) {
- Profile* profile = Profile::FromBrowserContext(contents()->browser_context());
+ Profile* profile =
+ Profile::FromBrowserContext(contents()->GetBrowserContext());
TranslatePrefs translate_prefs(profile->GetPrefs());
translate_prefs.ResetTranslationAcceptedCount("fr");
translate_prefs.ResetTranslationDeniedCount("fr");
@@ -1247,7 +1256,7 @@ TEST_F(TranslateManagerTest, BeforeTranslateExtraButtons) {
// shown in that case, then 4 times in normal mode.
TranslateInfoBarDelegate* infobar;
TestingProfile* test_profile =
- static_cast<TestingProfile*>(contents()->browser_context());
+ static_cast<TestingProfile*>(contents()->GetBrowserContext());
test_profile->CreateExtensionProcessManager();
test_profile->set_incognito(true);
for (int i = 0; i < 8; ++i) {
diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc
index ae47d63..3aba710 100644
--- a/chrome/browser/ui/auto_login_prompter.cc
+++ b/chrome/browser/ui/auto_login_prompter.cc
@@ -292,7 +292,7 @@ void AutoLoginPrompter::ShowInfoBarUIThread(const std::string& account,
// If auto-login is turned off, then simply return.
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
if (!profile->GetPrefs()->GetBoolean(prefs::kAutologinEnabled))
return;
diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
index ac3b8d6..bf91a8c 100644
--- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
+++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc
@@ -84,7 +84,7 @@ void BlockedContentTabHelper::AddPopup(TabContentsWrapper* new_contents,
tab_contents()->GetController().GetLastCommittedEntry();
GURL creator = entry ? entry->virtual_url() : GURL::EmptyGURL();
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
if (creator.is_valid() &&
profile->GetHostContentSettingsMap()->GetContentSetting(
diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
index b4aa381..84fdc4c 100644
--- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
@@ -101,7 +101,7 @@ BookmarkTabHelper::BookmarkDrag*
void BookmarkTabHelper::UpdateStarredStateForCurrentURL() {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
BookmarkModel* model = profile->GetBookmarkModel();
const bool old_state = is_starred_;
is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL()));
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d9ffe73..95bbefc 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2530,7 +2530,7 @@ Browser* Browser::GetBrowserForController(
void Browser::RunFileChooserHelper(
TabContents* tab, const content::FileChooserParams& params) {
Profile* profile =
- Profile::FromBrowserContext(tab->browser_context());
+ Profile::FromBrowserContext(tab->GetBrowserContext());
// FileSelectHelper adds a reference to itself and only releases it after
// sending the result message. It won't be destroyed when this reference
// goes out of scope.
@@ -2548,7 +2548,7 @@ void Browser::EnumerateDirectoryHelper(TabContents* tab, int request_id,
return;
Profile* profile =
- Profile::FromBrowserContext(tab->browser_context());
+ Profile::FromBrowserContext(tab->GetBrowserContext());
// FileSelectHelper adds a reference to itself and only releases it after
// sending the result message. It won't be destroyed when this reference
// goes out of scope.
diff --git a/chrome/browser/ui/find_bar/find_backend_unittest.cc b/chrome/browser/ui/find_bar/find_backend_unittest.cc
index c1f4ceb..f151b6d 100644
--- a/chrome/browser/ui/find_bar/find_backend_unittest.cc
+++ b/chrome/browser/ui/find_bar/find_backend_unittest.cc
@@ -29,7 +29,7 @@ class FindBackendTest : public TabContentsWrapperTestHarness {
namespace {
string16 FindPrepopulateText(TabContents* contents) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
return FindBarState::GetLastPrepopulateText(profile);
}
diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc
index 974db90..a401f3f 100644
--- a/chrome/browser/ui/find_bar/find_tab_helper.cc
+++ b/chrome/browser/ui/find_bar/find_tab_helper.cc
@@ -39,7 +39,7 @@ void FindTabHelper::StartFinding(string16 search_string,
// shortcut so unless we have something to search for we return early.
if (search_string.empty() && find_text_.empty()) {
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
string16 last_search_prepopulate_text =
FindBarState::GetLastPrepopulateText(profile);
@@ -76,7 +76,7 @@ void FindTabHelper::StartFinding(string16 search_string,
// Keep track of what the last search was across the tabs.
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
FindBarState* find_bar_state = profile->GetFindBarState();
find_bar_state->set_last_prepopulate_text(find_text_);
diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
index fe15111..1e82093 100644
--- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
@@ -53,7 +53,7 @@ const int InfoBarGtk::kEndOfLabelSpacing = 6;
InfoBarGtk::InfoBarGtk(InfoBarTabHelper* owner, InfoBarDelegate* delegate)
: InfoBar(owner, delegate),
theme_service_(GtkThemeService::GetFrom(Profile::FromBrowserContext(
- owner->tab_contents()->browser_context()))),
+ owner->tab_contents()->GetBrowserContext()))),
signals_(new ui::GtkSignalRegistrar) {
DCHECK(delegate);
// Create |hbox_| and pad the sides.
diff --git a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
index 7afd2148..86ed7c8 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc
@@ -66,7 +66,7 @@ DraggedViewGtk::DraggedViewGtk(DragData* drag_data,
std::vector<TabContents*> data_sources(drag_data_->GetDraggedTabsContents());
for (size_t i = 0; i < data_sources.size(); i++) {
renderers_.push_back(new TabRendererGtk(GtkThemeService::GetFrom(
- Profile::FromBrowserContext(data_sources[i]->browser_context()))));
+ Profile::FromBrowserContext(data_sources[i]->GetBrowserContext()))));
}
for (size_t i = 0; i < drag_data_->size(); i++) {
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
index 497bed2..cee692e 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
@@ -331,7 +331,7 @@ void TabRendererGtk::UpdateData(TabContents* contents,
if (!loading_only) {
data_.title = contents->GetTitle();
- data_.incognito = contents->browser_context()->IsOffTheRecord();
+ data_.incognito = contents->GetBrowserContext()->IsOffTheRecord();
data_.crashed = contents->is_crashed();
SkBitmap* app_icon =
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
index 5ba0c11..07e61e9 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
@@ -59,7 +59,7 @@ void SearchEngineTabHelper::OnPageHasOSDD(
// Make sure page_id is the current page and other basic checks.
DCHECK(doc_url.is_valid());
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
if (!tab_contents()->IsActiveEntry(page_id))
return;
if (!profile->GetTemplateURLFetcher())
@@ -132,7 +132,7 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary(
return;
Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
+ Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index 00dd82e..7705c3f 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -172,7 +172,7 @@ const TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents(
}
Profile* TabContentsWrapper::profile() const {
- return Profile::FromBrowserContext(tab_contents()->browser_context());
+ return Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
index fbea791..c3b30d2 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
@@ -91,7 +91,7 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const {
// super long.
NavigationEntry* entry = GetNavigationEntry(index);
Profile* profile =
- Profile::FromBrowserContext(GetTabContents()->browser_context());
+ Profile::FromBrowserContext(GetTabContents()->GetBrowserContext());
string16 menu_text(entry->GetTitleForDisplay(
profile->GetPrefs()->GetString(prefs::kAcceptLanguages)));
menu_text =
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 92e3b9a..5758df3 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -438,7 +438,7 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
data->url = contents->GetURL();
data->loading = contents->IsLoading();
data->crashed_status = contents->crashed_status();
- data->incognito = contents->browser_context()->IsOffTheRecord();
+ data->incognito = contents->GetBrowserContext()->IsOffTheRecord();
data->show_icon = wrapper->favicon_tab_helper()->ShouldDisplayFavicon();
data->mini = model_->IsMiniTab(model_index);
data->blocked = model_->IsTabBlocked(model_index);
diff --git a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc
index b346cd8..6da4b32 100644
--- a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc
+++ b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc
@@ -404,7 +404,7 @@ void KeyboardWidget::TextInputTypeChanged(ui::TextInputType type,
Profile* profile =
Profile::FromBrowserContext(
- dom_view_->dom_contents()->tab_contents()->browser_context());
+ dom_view_->dom_contents()->tab_contents()->GetBrowserContext());
profile->GetExtensionEventRouter()->DispatchEventToRenderers(
kOnTextInputTypeChanged, json_args, NULL, GURL());
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index fdd8beb..c07f19d 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -1379,7 +1379,7 @@ std::string AboutUIHTMLSource::GetMimeType(const std::string& path) const {
AboutUI::AboutUI(TabContents* contents, const std::string& name)
: ChromeWebUI(contents) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
ChromeURLDataManager::DataSource* source =
new AboutUIHTMLSource(name, profile);
if (source)
diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc
index f59af2a..460c093 100644
--- a/chrome/browser/ui/webui/active_downloads_ui.cc
+++ b/chrome/browser/ui/webui/active_downloads_ui.cc
@@ -369,7 +369,7 @@ ActiveDownloadsUI::ActiveDownloadsUI(TabContents* contents)
handler_->Init();
// Set up the chrome://active-downloads/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateActiveDownloadsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/aura/app_list_ui.cc b/chrome/browser/ui/webui/aura/app_list_ui.cc
index d63d784..e876431 100644
--- a/chrome/browser/ui/webui/aura/app_list_ui.cc
+++ b/chrome/browser/ui/webui/aura/app_list_ui.cc
@@ -125,7 +125,7 @@ AppListUI::AppListUI(TabContents* contents)
AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
// Set up the source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
PrefService* prefs = profile->GetPrefs();
profile->GetChromeURLDataManager()->AddDataSource(
CreateAppListUIHTMLSource(prefs));
diff --git a/chrome/browser/ui/webui/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks_ui.cc
index 7673997..c4363ae 100644
--- a/chrome/browser/ui/webui/bookmarks_ui.cc
+++ b/chrome/browser/ui/webui/bookmarks_ui.cc
@@ -59,7 +59,7 @@ BookmarksUI::BookmarksUI(TabContents* contents) : ChromeWebUI(contents) {
BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource();
// Set up the chrome://bookmarks/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc
index ca36cca..bbb603a 100644
--- a/chrome/browser/ui/webui/bug_report_ui.cc
+++ b/chrome/browser/ui/webui/bug_report_ui.cc
@@ -332,7 +332,7 @@ void BugReportHandler::ClobberScreenshotsSource() {
// Re-create our screenshots data source (this clobbers the last source)
// 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_->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(new ScreenshotSource(NULL));
BugReportUtil::ClearScreenshotPng();
@@ -345,7 +345,7 @@ void BugReportHandler::SetupScreenshotsSource() {
new ScreenshotSource(BugReportUtil::GetScreenshotPng());
}
// Add the source to the data manager.
- Profile* profile = Profile::FromBrowserContext(tab_->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(screenshot_source_);
}
@@ -624,6 +624,6 @@ BugReportUI::BugReportUI(TabContents* tab) : HtmlDialogUI(tab) {
CreateBugReportUIHTMLSource(handler->Init());
// Set up the chrome://bugreport/ source.
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/certificate_viewer_ui.cc b/chrome/browser/ui/webui/certificate_viewer_ui.cc
index e366afe..1c41b09 100644
--- a/chrome/browser/ui/webui/certificate_viewer_ui.cc
+++ b/chrome/browser/ui/webui/certificate_viewer_ui.cc
@@ -61,7 +61,7 @@ CertificateViewerUI::CertificateViewerUI(TabContents* contents)
IDR_CERTIFICATE_VIEWER_CSS);
html_source->set_default_resource(IDR_CERTIFICATE_VIEWER_HTML);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chrome_web_ui.cc b/chrome/browser/ui/webui/chrome_web_ui.cc
index 4663098..91294e5 100644
--- a/chrome/browser/ui/webui/chrome_web_ui.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui.cc
@@ -29,7 +29,7 @@ ChromeWebUI::~ChromeWebUI() {
}
Profile* ChromeWebUI::GetProfile() const {
- return Profile::FromBrowserContext(tab_contents()->browser_context());
+ return Profile::FromBrowserContext(tab_contents()->GetBrowserContext());
}
bool ChromeWebUI::CanShowBookmarkBar() const {
diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_factory.cc
index fe3c031..ad737b6 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_factory.cc
@@ -387,7 +387,7 @@ WebUI* ChromeWebUIFactory::CreateWebUIForURL(
TabContents* tab_contents,
const GURL& url) const {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
WebUIFactoryFunction function = GetWebUIFactoryFunction(tab_contents,
profile, url);
if (!function)
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 7294f2c..7ff1fb5 100644
--- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
@@ -211,7 +211,7 @@ ChooseMobileNetworkUI::ChooseMobileNetworkUI(TabContents* contents)
ChooseMobileNetworkHandler* handler = new ChooseMobileNetworkHandler();
AddMessageHandler((handler)->Attach(this));
// Set up the "chrome://choose-mobile-network" source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateChooseMobileNetworkUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
index 9c64749..f746ecf 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
@@ -414,7 +414,8 @@ void WebUIHandler::OnConfigFileFetched(const ConfigFile&
}
if (!download_manager_) {
- download_manager_ = tab_contents_->browser_context()->GetDownloadManager();
+ download_manager_ =
+ tab_contents_->GetBrowserContext()->GetDownloadManager();
download_manager_->AddObserver(this);
}
if (!state_machine_->download_started()) {
@@ -650,7 +651,7 @@ ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) {
imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents);
AddMessageHandler((handler)->Attach(this));
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateImageburnerUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
index 3f7276a..15ce2bb 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
@@ -314,7 +314,7 @@ void BurnManager::FetchConfigFile(TabContents* tab_contents,
config_file_requested_ = true;
config_file_path_ = GetImageDir().Append(kConfigFileName);
- download_manager_ = tab_contents->browser_context()->GetDownloadManager();
+ download_manager_ = tab_contents->GetBrowserContext()->GetDownloadManager();
download_manager_->AddObserver(this);
downloader()->AddListener(this, config_file_url_);
downloader()->DownloadFile(config_file_url_, config_file_path_, tab_contents);
@@ -438,7 +438,7 @@ void Downloader::OnFileStreamCreatedOnUIThread(const GURL& url,
if (created_file_stream) {
DownloadManager* download_manager =
- tab_contents->browser_context()->GetDownloadManager();
+ tab_contents->GetBrowserContext()->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 512a1d9..29c9022 100644
--- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -287,7 +287,7 @@ void KeyboardOverlayHandler::GetLabelMap(const ListValue* args) {
KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents)
: HtmlDialogUI(contents) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile);
AddMessageHandler((handler)->Attach(this));
diff --git a/chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc
index e98bedc..7dd3e1f 100644
--- a/chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc
@@ -308,7 +308,7 @@ void EnterpriseOAuthEnrollmentScreenHandler::HandleCompleteLogin(
}
Profile* profile =
- Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ Profile::FromBrowserContext(web_ui_->tab_contents()->GetBrowserContext());
oauth_fetcher_.reset(
new GaiaOAuthFetcher(this,
profile->GetRequestContext(),
@@ -353,7 +353,7 @@ void EnterpriseOAuthEnrollmentScreenHandler::ResetAuth() {
return;
Profile* profile =
- Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ Profile::FromBrowserContext(web_ui_->tab_contents()->GetBrowserContext());
browsing_data_remover_ =
new BrowsingDataRemover(profile,
BrowsingDataRemover::EVERYTHING,
@@ -364,7 +364,7 @@ void EnterpriseOAuthEnrollmentScreenHandler::ResetAuth() {
void EnterpriseOAuthEnrollmentScreenHandler::RevokeTokens() {
Profile* profile =
- Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ Profile::FromBrowserContext(web_ui_->tab_contents()->GetBrowserContext());
if (!access_token_.empty()) {
new TokenRevoker(access_token_, access_token_secret_, profile);
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index f3360c3..160fb42 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -148,7 +148,7 @@ OobeUI::OobeUI(TabContents* contents)
DictionaryValue* localized_strings = new DictionaryValue();
GetLocalizedStrings(localized_strings);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
// Set up the chrome://theme/ source, for Chrome logo.
ThemeSource* theme = new ThemeSource(profile);
profile->GetChromeURLDataManager()->AddDataSource(theme);
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index 1554d3a..472d7c5 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -770,7 +770,7 @@ void SigninScreenHandler::StartClearingCookies() {
cookie_remover_->RemoveObserver(this);
cookie_remover_ = new BrowsingDataRemover(
- Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()),
+ Profile::FromBrowserContext(web_ui_->tab_contents()->GetBrowserContext()),
BrowsingDataRemover::EVERYTHING,
base::Time());
cookie_remover_->AddObserver(this);
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index 578a66c..c6963bc 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -1371,7 +1371,7 @@ MobileSetupUI::MobileSetupUI(TabContents* contents) : ChromeWebUI(contents) {
new MobileSetupUIHTMLSource(service_path);
// Set up the chrome://mobilesetup/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
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 dc78e10..bbb063e 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -80,7 +80,7 @@ ProxySettingsUI::ProxySettingsUI(TabContents* contents)
ProxySettingsHTMLSource* source =
new ProxySettingsHTMLSource(localized_strings);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(source);
}
diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
index 8bee89e..e1e582f 100644
--- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
@@ -308,6 +308,6 @@ RegisterPageUI::RegisterPageUI(TabContents* contents) : ChromeWebUI(contents) {
RegisterPageUIHTMLSource* html_source = new RegisterPageUIHTMLSource();
// Set up the chrome://register/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
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 e08e9ed..36ef28e 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -681,7 +681,7 @@ SimUnlockUI::SimUnlockUI(TabContents* contents) : ChromeWebUI(contents) {
SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
// Set up the chrome://sim-unlock/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/system_info_ui.cc b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
index 86273ab..edaf793 100644
--- a/chrome/browser/ui/webui/chromeos/system_info_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
@@ -180,6 +180,6 @@ SystemInfoUI::SystemInfoUI(TabContents* contents) : ChromeWebUI(contents) {
SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource();
// Set up the chrome://system/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index 142bbcf..d410bc5 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -161,7 +161,7 @@ ConflictsUI::ConflictsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new ConflictsDOMHandler())->Attach(this));
// Set up the about:conflicts source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateConflictsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index ddc01ab..d0cf130 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -163,7 +163,7 @@ CrashesUI::CrashesUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new CrashesDOMHandler())->Attach(this));
// Set up the chrome://crashes/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateCrashesUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc
index 0d1ae7f..21da8e9 100644
--- a/chrome/browser/ui/webui/devtools_ui.cc
+++ b/chrome/browser/ui/webui/devtools_ui.cc
@@ -101,7 +101,7 @@ void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) {
DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) {
DevToolsDataSource* data_source = new DevToolsDataSource();
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(data_source);
}
diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc
index 60722e2..9c2edbe 100644
--- a/chrome/browser/ui/webui/downloads_ui.cc
+++ b/chrome/browser/ui/webui/downloads_ui.cc
@@ -93,7 +93,7 @@ DownloadsUI::DownloadsUI(TabContents* contents) : ChromeWebUI(contents) {
handler->Init();
// Set up the chrome://downloads/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateDownloadsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.cc b/chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.cc
index f69b65f..8ead4b7 100644
--- a/chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.cc
+++ b/chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.cc
@@ -47,7 +47,7 @@ EditSearchEngineDialogUI::EditSearchEngineDialogUI(TabContents* contents)
// Set default resource.
source->set_default_resource(IDR_EDIT_SEARCH_ENGINE_DIALOG_HTML);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(source);
}
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc
index 3be781f..1340c3e 100644
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -29,7 +29,7 @@ ChromeWebUIDataSource* CreateExtensionsHTMLSource() {
} // namespace
ExtensionsUI::ExtensionsUI(TabContents* contents) : ChromeWebUI(contents) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
ChromeWebUIDataSource* source = CreateExtensionsHTMLSource();
profile->GetChromeURLDataManager()->AddDataSource(source);
profile->GetChromeURLDataManager()->AddDataSource(
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc
index feeab52..c952feb 100644
--- a/chrome/browser/ui/webui/flags_ui.cc
+++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -159,7 +159,7 @@ FlagsUI::FlagsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new FlagsDOMHandler())->Attach(this));
// Set up the about:flags source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(CreateFlagsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc
index 3924527..d836b90 100644
--- a/chrome/browser/ui/webui/flash_ui.cc
+++ b/chrome/browser/ui/webui/flash_ui.cc
@@ -371,7 +371,7 @@ FlashUI::FlashUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new FlashDOMHandler())->Attach(this));
// Set up the about:flash source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc
index cb9087b..4aed34117 100644
--- a/chrome/browser/ui/webui/gpu_internals_ui.cc
+++ b/chrome/browser/ui/webui/gpu_internals_ui.cc
@@ -247,6 +247,6 @@ GpuInternalsUI::GpuInternalsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new GpuMessageHandler())->Attach(this));
// Set up the chrome://gpu-internals/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource());
}
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 9e6209c..b6f0b10 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -428,7 +428,7 @@ HistoryUI::HistoryUI(TabContents* contents) : ChromeWebUI(contents) {
HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource();
// Set up the chrome://history/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/hung_renderer_dialog_ui.cc b/chrome/browser/ui/webui/hung_renderer_dialog_ui.cc
index 3f896cd..0b3f7e9 100644
--- a/chrome/browser/ui/webui/hung_renderer_dialog_ui.cc
+++ b/chrome/browser/ui/webui/hung_renderer_dialog_ui.cc
@@ -34,7 +34,7 @@ HungRendererDialogUI::HungRendererDialogUI(TabContents* contents)
// Set default resource.
source->set_default_resource(IDR_HUNG_RENDERER_DIALOG_HTML);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(source);
// Set up the chrome://theme/ source.
diff --git a/chrome/browser/ui/webui/input_window_dialog_ui.cc b/chrome/browser/ui/webui/input_window_dialog_ui.cc
index 7b14efc..913d765 100644
--- a/chrome/browser/ui/webui/input_window_dialog_ui.cc
+++ b/chrome/browser/ui/webui/input_window_dialog_ui.cc
@@ -25,7 +25,7 @@ InputWindowDialogUI::InputWindowDialogUI(TabContents* contents)
// Set default resource.
source->set_default_resource(IDR_INPUT_WINDOW_DIALOG_HTML);
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(source);
}
diff --git a/chrome/browser/ui/webui/keyboard_ui.cc b/chrome/browser/ui/webui/keyboard_ui.cc
index b18e21c..cae330e0 100644
--- a/chrome/browser/ui/webui/keyboard_ui.cc
+++ b/chrome/browser/ui/webui/keyboard_ui.cc
@@ -19,7 +19,7 @@
KeyboardUI::KeyboardUI(TabContents* contents)
: ChromeWebUI(contents) {
KeyboardHTMLSource* html_source = new KeyboardHTMLSource();
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/media/media_internals_ui.cc b/chrome/browser/ui/webui/media/media_internals_ui.cc
index fded7ac..7ca2848 100644
--- a/chrome/browser/ui/webui/media/media_internals_ui.cc
+++ b/chrome/browser/ui/webui/media/media_internals_ui.cc
@@ -40,7 +40,7 @@ MediaInternalsUI::MediaInternalsUI(TabContents* contents)
: ChromeWebUI(contents) {
AddMessageHandler((new MediaInternalsMessageHandler())->Attach(this));
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateMediaInternalsHTMLSource());
}
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index e08d377..a4e6907 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -109,7 +109,7 @@ NewTabUI::NewTabUI(TabContents* contents)
InitializeCSSCaches();
NewTabHTMLSource* html_source =
new NewTabHTMLSource(GetProfile()->GetOriginalProfile());
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Listen for theme installation.
diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc
index a32f584..329c03b 100644
--- a/chrome/browser/ui/webui/options/advanced_options_handler.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc
@@ -389,7 +389,7 @@ void AdvancedOptionsHandler::OnCloudPrintSetupClosed() {
void AdvancedOptionsHandler::HandleAutoOpenButton(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
DownloadManager* manager =
- web_ui_->tab_contents()->browser_context()->GetDownloadManager();
+ web_ui_->tab_contents()->GetBrowserContext()->GetDownloadManager();
if (manager)
DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen();
}
@@ -617,7 +617,7 @@ void AdvancedOptionsHandler::SetupAutoOpenFileTypesDisabledAttribute() {
// Set the enabled state for the AutoOpenFileTypesResetToDefault button.
// We enable the button if the user has any auto-open file types registered.
DownloadManager* manager =
- web_ui_->tab_contents()->browser_context()->GetDownloadManager();
+ web_ui_->tab_contents()->GetBrowserContext()->GetDownloadManager();
bool disabled = !(manager &&
DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed());
base::FundamentalValue value(disabled);
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index 51433e9..cdcdde0 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -272,7 +272,7 @@ OptionsUI::OptionsUI(TabContents* contents)
new OptionsUIHTMLSource(localized_strings);
// Set up the chrome://settings/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://theme/ source.
diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc
index 5d53dc5..e0aa630 100644
--- a/chrome/browser/ui/webui/options/personal_options_handler.cc
+++ b/chrome/browser/ui/webui/options/personal_options_handler.cc
@@ -410,7 +410,7 @@ void PersonalOptionsHandler::SendProfilesInfo() {
g_browser_process->profile_manager()->GetProfileInfoCache();
ListValue profile_info_list;
FilePath current_profile_path =
- web_ui_->tab_contents()->browser_context()->GetPath();
+ web_ui_->tab_contents()->GetBrowserContext()->GetPath();
for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) {
DictionaryValue* profile_value = new DictionaryValue();
FilePath profile_path = cache.GetPathOfProfileAtIndex(i);
diff --git a/chrome/browser/ui/webui/options2/advanced_options_handler2.cc b/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
index 72e6f4c..02f8e1b 100644
--- a/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/advanced_options_handler2.cc
@@ -391,7 +391,7 @@ void AdvancedOptionsHandler::OnCloudPrintSetupClosed() {
void AdvancedOptionsHandler::HandleAutoOpenButton(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
DownloadManager* manager =
- web_ui_->tab_contents()->browser_context()->GetDownloadManager();
+ web_ui_->tab_contents()->GetBrowserContext()->GetDownloadManager();
if (manager)
DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen();
}
@@ -619,7 +619,7 @@ void AdvancedOptionsHandler::SetupAutoOpenFileTypesDisabledAttribute() {
// Set the enabled state for the AutoOpenFileTypesResetToDefault button.
// We enable the button if the user has any auto-open file types registered.
DownloadManager* manager =
- web_ui_->tab_contents()->browser_context()->GetDownloadManager();
+ web_ui_->tab_contents()->GetBrowserContext()->GetDownloadManager();
bool disabled = !(manager &&
DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed());
base::FundamentalValue value(disabled);
diff --git a/chrome/browser/ui/webui/options2/options_ui2.cc b/chrome/browser/ui/webui/options2/options_ui2.cc
index fc5cba8..0439ff8 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.cc
+++ b/chrome/browser/ui/webui/options2/options_ui2.cc
@@ -270,7 +270,7 @@ OptionsUI::OptionsUI(TabContents* contents)
new OptionsUIHTMLSource(localized_strings);
// Set up the chrome://settings-frame/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://theme/ source.
diff --git a/chrome/browser/ui/webui/options2/personal_options_handler2.cc b/chrome/browser/ui/webui/options2/personal_options_handler2.cc
index c756cc7..64d5093 100644
--- a/chrome/browser/ui/webui/options2/personal_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/personal_options_handler2.cc
@@ -412,7 +412,7 @@ void PersonalOptionsHandler::SendProfilesInfo() {
g_browser_process->profile_manager()->GetProfileInfoCache();
ListValue profile_info_list;
FilePath current_profile_path =
- web_ui_->tab_contents()->browser_context()->GetPath();
+ web_ui_->tab_contents()->GetBrowserContext()->GetPath();
for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) {
DictionaryValue* profile_value = new DictionaryValue();
FilePath profile_path = cache.GetPathOfProfileAtIndex(i);
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index e4449cb..6f49abd 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -380,7 +380,7 @@ PluginsUI::PluginsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new PluginsDOMHandler())->Attach(this));
// Set up the chrome://plugins/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreatePluginsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index 3d7106c..4bd7ade 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -234,7 +234,7 @@ PolicyUI::PolicyUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new PolicyUIHandler)->Attach(this));
// Set up the chrome://policy/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(CreatePolicyUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview_ui.cc
index f16a03f..543af45 100644
--- a/chrome/browser/ui/webui/print_preview_ui.cc
+++ b/chrome/browser/ui/webui/print_preview_ui.cc
@@ -82,7 +82,7 @@ PrintPreviewUI::PrintPreviewUI(TabContents* contents)
is_dummy_ = (!controller || !controller->is_creating_print_preview_tab());
// Set up the chrome://print/ data source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
new PrintPreviewDataSource(is_dummy_));
if (is_dummy_)
diff --git a/chrome/browser/ui/webui/profiler_ui.cc b/chrome/browser/ui/webui/profiler_ui.cc
index b57a9ab..594ad5b 100644
--- a/chrome/browser/ui/webui/profiler_ui.cc
+++ b/chrome/browser/ui/webui/profiler_ui.cc
@@ -155,7 +155,7 @@ ProfilerUI::ProfilerUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new ProfilerMessageHandler())->Attach(this));
// Set up the chrome://profiler/ source.
- Profile::FromBrowserContext(contents->browser_context())->
+ Profile::FromBrowserContext(contents->GetBrowserContext())->
GetChromeURLDataManager()->AddDataSource(CreateProfilerHTMLSource());
}
diff --git a/chrome/browser/ui/webui/quota_internals_ui.cc b/chrome/browser/ui/webui/quota_internals_ui.cc
index 793bc42..b91ed18 100644
--- a/chrome/browser/ui/webui/quota_internals_ui.cc
+++ b/chrome/browser/ui/webui/quota_internals_ui.cc
@@ -39,7 +39,7 @@ QuotaInternalsUI::QuotaInternalsUI(TabContents* contents)
: ChromeWebUI(contents) {
WebUIMessageHandler* handler = new quota_internals::QuotaInternalsHandler;
AddMessageHandler(handler->Attach(this));
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateQuotaInternalsHTMLSource());
}
diff --git a/chrome/browser/ui/webui/sessions_ui.cc b/chrome/browser/ui/webui/sessions_ui.cc
index 946fc47f..fcc7709 100644
--- a/chrome/browser/ui/webui/sessions_ui.cc
+++ b/chrome/browser/ui/webui/sessions_ui.cc
@@ -262,7 +262,7 @@ SessionsUI::SessionsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new SessionsDOMHandler())->Attach(this));
// Set up the chrome://sessions/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateSessionsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/sync_internals_ui.cc b/chrome/browser/ui/webui/sync_internals_ui.cc
index ef53b9b..8d054c4 100644
--- a/chrome/browser/ui/webui/sync_internals_ui.cc
+++ b/chrome/browser/ui/webui/sync_internals_ui.cc
@@ -76,7 +76,7 @@ SyncInternalsUI::SyncInternalsUI(TabContents* contents)
: ChromeWebUI(contents),
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
// TODO(akalin): Fix.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(
CreateSyncInternalsHTMLSource());
ProfileSyncService* sync_service = GetProfileSyncService(profile);
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 6c809c4..9f92d22 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
@@ -112,7 +112,7 @@ SyncPromoUI::SyncPromoUI(TabContents* contents) : ChromeWebUI(contents) {
handler->Attach(this);
// Set up the chrome://theme/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
ThemeSource* theme = new ThemeSource(profile);
profile->GetChromeURLDataManager()->AddDataSource(theme);
diff --git a/chrome/browser/ui/webui/task_manager_ui.cc b/chrome/browser/ui/webui/task_manager_ui.cc
index 0359b69..5252c55 100644
--- a/chrome/browser/ui/webui/task_manager_ui.cc
+++ b/chrome/browser/ui/webui/task_manager_ui.cc
@@ -85,6 +85,6 @@ TaskManagerUI::TaskManagerUI(TabContents* contents) : ChromeWebUI(contents) {
// Set up the chrome://taskmanager/ source.
ChromeWebUIDataSource* html_source = CreateTaskManagerUIHTMLSource();
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
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 3176cd1..8231c93 100644
--- a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
+++ b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
@@ -38,7 +38,7 @@ WebUI::TypeID TestChromeWebUIFactory::GetWebUIType(
WebUI* TestChromeWebUIFactory::CreateWebUIForURL(TabContents* tab_contents,
const GURL& url) const {
Profile* profile =
- Profile::FromBrowserContext(tab_contents->browser_context());
+ Profile::FromBrowserContext(tab_contents->GetBrowserContext());
WebUIProvider* provider = GetWebUIProvider(profile, url);
return provider ? provider->NewWebUI(tab_contents, url) :
ChromeWebUIFactory::CreateWebUIForURL(tab_contents, url);
diff --git a/chrome/browser/ui/webui/tracing_ui.cc b/chrome/browser/ui/webui/tracing_ui.cc
index 5c83c0d..571f9d2 100644
--- a/chrome/browser/ui/webui/tracing_ui.cc
+++ b/chrome/browser/ui/webui/tracing_ui.cc
@@ -419,6 +419,6 @@ TracingUI::TracingUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new TracingMessageHandler())->Attach(this));
// Set up the chrome://tracing/ source.
- Profile::FromBrowserContext(contents->browser_context())->
+ Profile::FromBrowserContext(contents->GetBrowserContext())->
GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource());
}
diff --git a/chrome/browser/ui/webui/uber/uber_ui.cc b/chrome/browser/ui/webui/uber/uber_ui.cc
index ded7554..97a4778 100644
--- a/chrome/browser/ui/webui/uber/uber_ui.cc
+++ b/chrome/browser/ui/webui/uber/uber_ui.cc
@@ -30,7 +30,7 @@ ChromeWebUIDataSource* CreateUberHTMLSource() {
} // namespace
UberUI::UberUI(TabContents* contents) : ChromeWebUI(contents) {
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(CreateUberHTMLSource());
RegisterSubpage(chrome::kChromeUISettingsFrameURL);
diff --git a/chrome/browser/ui/webui/web_ui_unittest.cc b/chrome/browser/ui/webui/web_ui_unittest.cc
index 40f0eee..dc78455 100644
--- a/chrome/browser/ui/webui/web_ui_unittest.cc
+++ b/chrome/browser/ui/webui/web_ui_unittest.cc
@@ -167,8 +167,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()->browser_context(),
- SiteInstance::CreateSiteInstance(contents()->browser_context()));
+ contents()->GetBrowserContext(),
+ SiteInstance::CreateSiteInstance(contents()->GetBrowserContext()));
tc->GetController().CopyStateFrom(controller());
SetContents(tc);
int page_id = 200;
diff --git a/chrome/browser/ui/webui/workers_ui.cc b/chrome/browser/ui/webui/workers_ui.cc
index 1dc7e0d..a0b0a3c 100644
--- a/chrome/browser/ui/webui/workers_ui.cc
+++ b/chrome/browser/ui/webui/workers_ui.cc
@@ -257,7 +257,7 @@ WorkersUI::WorkersUI(TabContents* contents)
WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource();
// Set up the chrome://workers/ source.
- Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/user_style_sheet_watcher.cc b/chrome/browser/user_style_sheet_watcher.cc
index 114ec39..5b2371d 100644
--- a/chrome/browser/user_style_sheet_watcher.cc
+++ b/chrome/browser/user_style_sheet_watcher.cc
@@ -176,7 +176,7 @@ void UserStyleSheetWatcher::Observe(int type,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(type == content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB);
if (profile_->IsSameProfile(Profile::FromBrowserContext(
- content::Source<TabContents>(source)->browser_context()))) {
+ content::Source<TabContents>(source)->GetBrowserContext()))) {
loader_->NotifyLoaded();
registrar_.RemoveAll();
}