summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 16:04:12 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 16:04:12 +0000
commite7013f4c21d2f8c9da89c705760dae2498f38edd (patch)
tree964a7df5cb8401e907be83e0696ff79cd0aed87b /chrome/browser/ui
parent3abbed000fefd2f846da29a5c14683bf32ff1867 (diff)
downloadchromium_src-e7013f4c21d2f8c9da89c705760dae2498f38edd.zip
chromium_src-e7013f4c21d2f8c9da89c705760dae2498f38edd.tar.gz
chromium_src-e7013f4c21d2f8c9da89c705760dae2498f38edd.tar.bz2
Removal of Profile from content part 5.
BUG=76788 TEST=no change visible Review URL: http://codereview.chromium.org/7523054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/find_bar/find_backend_unittest.cc3
-rw-r--r--chrome/browser/ui/gtk/collected_cookies_gtk.cc12
-rw-r--r--chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc1
-rw-r--r--chrome/browser/ui/gtk/html_dialog_gtk.cc1
-rw-r--r--chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc2
-rw-r--r--chrome/browser/ui/login/login_prompt_ui.cc6
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.cc14
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc2
-rw-r--r--chrome/browser/ui/views/default_search_view.cc4
-rw-r--r--chrome/browser/ui/views/dom_view.cc1
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc2
-rw-r--r--chrome/browser/ui/webui/active_downloads_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc5
-rw-r--r--chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc5
-rw-r--r--chrome/browser/ui/webui/chromeos/login/login_ui.cc10
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc15
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/register_page_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/system_info_ui.cc3
-rw-r--r--chrome/browser/ui/webui/collected_cookies_ui_delegate.cc20
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc3
-rw-r--r--chrome/browser/ui/webui/new_profile_ui.cc7
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc10
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc6
-rw-r--r--chrome/browser/ui/webui/test_chrome_web_ui_factory.cc4
-rw-r--r--chrome/browser/ui/webui/web_ui_unittest.cc9
32 files changed, 102 insertions, 71 deletions
diff --git a/chrome/browser/ui/find_bar/find_backend_unittest.cc b/chrome/browser/ui/find_bar/find_backend_unittest.cc
index 7b4ae5e..2425021 100644
--- a/chrome/browser/ui/find_bar/find_backend_unittest.cc
+++ b/chrome/browser/ui/find_bar/find_backend_unittest.cc
@@ -27,7 +27,8 @@ class FindBackendTest : public TabContentsWrapperTestHarness {
namespace {
string16 FindPrepopulateText(TabContents* contents) {
- return FindBarState::GetLastPrepopulateText(contents->profile());
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ return FindBarState::GetLastPrepopulateText(profile);
}
} // end namespace
diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.cc b/chrome/browser/ui/gtk/collected_cookies_gtk.cc
index 15a4e86..107d819 100644
--- a/chrome/browser/ui/gtk/collected_cookies_gtk.cc
+++ b/chrome/browser/ui/gtk/collected_cookies_gtk.cc
@@ -238,8 +238,10 @@ GtkWidget* CollectedCookiesGtk::CreateAllowedPane() {
}
GtkWidget* CollectedCookiesGtk::CreateBlockedPane() {
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
HostContentSettingsMap* host_content_settings_map =
- tab_contents_->profile()->GetHostContentSettingsMap();
+ wrapper->profile()->GetHostContentSettingsMap();
GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
@@ -262,9 +264,7 @@ GtkWidget* CollectedCookiesGtk::CreateBlockedPane() {
GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start(GTK_BOX(cookie_list_vbox), scroll_window, TRUE, TRUE, 0);
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->
- content_settings();
+ TabSpecificContentSettings* content_settings = wrapper->content_settings();
blocked_cookies_tree_model_.reset(
content_settings->GetBlockedCookiesTreeModel());
@@ -459,8 +459,10 @@ void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection,
if (!last_domain_name.empty())
multiple_domains_added = true;
last_domain_name = origin_node->GetTitle();
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents_->browser_context());
origin_node->CreateContentException(
- tab_contents_->profile()->GetHostContentSettingsMap(), setting);
+ profile->GetHostContentSettingsMap(), setting);
}
}
g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL);
diff --git a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc
index 445575d..9230621 100644
--- a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc
+++ b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/constrained_html_ui.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/gtk/constrained_window_gtk.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/gtk/tab_contents_container_gtk.h"
diff --git a/chrome/browser/ui/gtk/html_dialog_gtk.cc b/chrome/browser/ui/gtk/html_dialog_gtk.cc
index 11d933d..82216b2 100644
--- a/chrome/browser/ui/gtk/html_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/html_dialog_gtk.cc
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
#include "base/utf_string_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc
index 7f6294a..73f25e2 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc
@@ -52,7 +52,7 @@ DraggedTabGtk::DraggedTabGtk(TabContents* datasource,
bool mini)
: data_source_(datasource),
renderer_(new TabRendererGtk(ThemeServiceFactory::GetForProfile(
- datasource->profile()))),
+ Profile::FromBrowserContext(datasource->browser_context())))),
attached_(false),
mouse_tab_offset_(mouse_tab_offset),
attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()),
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
index 4b87470..ad9e9681 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
@@ -295,7 +295,7 @@ void TabRendererGtk::UpdateData(TabContents* contents,
if (!loading_only) {
data_.title = contents->GetTitle();
- data_.incognito = contents->profile()->IsOffTheRecord();
+ data_.incognito = contents->browser_context()->IsOffTheRecord();
data_.crashed = contents->is_crashed();
SkBitmap* app_icon =
diff --git a/chrome/browser/ui/login/login_prompt_ui.cc b/chrome/browser/ui/login/login_prompt_ui.cc
index 8c8440a..5de7e22 100644
--- a/chrome/browser/ui/login/login_prompt_ui.cc
+++ b/chrome/browser/ui/login/login_prompt_ui.cc
@@ -239,10 +239,12 @@ void LoginHandlerHtml::BuildViewForPasswordManager(
LOG(INFO) << "BuildViewForPasswordManager";
TabContents* tab_contents = GetTabContentsForLogin();
- LoginHandlerSource::RegisterDataSource(tab_contents->profile());
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ LoginHandlerSource::RegisterDataSource(profile);
delegate_ = new LoginHandlerHtmlDelegate(this, tab_contents, explanation);
ConstrainedWindow* dialog = ConstrainedHtmlUI::CreateConstrainedHtmlDialog(
- tab_contents->profile(), delegate_, tab_contents);
+ profile, delegate_, tab_contents);
SetModel(manager);
SetDialog(dialog);
diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc
index 7da33b4..45a89ce 100644
--- a/chrome/browser/ui/views/collected_cookies_win.cc
+++ b/chrome/browser/ui/views/collected_cookies_win.cc
@@ -286,12 +286,12 @@ views::View* CollectedCookiesWin::CreateAllowedPane() {
}
views::View* CollectedCookiesWin::CreateBlockedPane() {
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->
- content_settings();
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
+ TabSpecificContentSettings* content_settings = wrapper->content_settings();
HostContentSettingsMap* host_content_settings_map =
- tab_contents_->profile()->GetHostContentSettingsMap();
+ wrapper->profile()->GetHostContentSettingsMap();
// Create the controls that go into the pane.
blocked_label_ = new views::Label(
@@ -483,8 +483,10 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
ContentSetting setting) {
CookieTreeOriginNode* origin_node =
static_cast<CookieTreeOriginNode*>(tree_view->GetSelectedNode());
- origin_node->CreateContentException(
- tab_contents_->profile()->GetHostContentSettingsMap(), setting);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents_->browser_context());
+ origin_node->CreateContentException(profile->GetHostContentSettingsMap(),
+ setting);
infobar_->UpdateVisibility(true, setting, origin_node->GetTitle());
gfx::Rect bounds = GetWidget()->GetClientAreaScreenBounds();
// NativeWidgetWin::GetBounds returns the bounds relative to the parent
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 344fd78..3fb90de 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -204,7 +204,7 @@ class ConstrainedWindowFrameView
gfx::Rect CalculateClientAreaBounds(int width, int height) const;
SkColor GetTitleColor() const {
- return container_->owner()->profile()->IsOffTheRecord()
+ return container_->owner()->browser_context()->IsOffTheRecord()
#if defined(OS_WIN)
|| !views::NativeWidgetWin::IsAeroGlassEnabled()
#endif
diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc
index 714edb47..da1a8c5 100644
--- a/chrome/browser/ui/views/default_search_view.cc
+++ b/chrome/browser/ui/views/default_search_view.cc
@@ -187,7 +187,9 @@ DefaultSearchView::DefaultSearchView(TabContents* tab_contents,
proposed_provider_button_(NULL),
proposed_turl_(proposed_default_turl),
template_url_service_(template_url_service) {
- PrefService* prefs = tab_contents->profile()->GetPrefs();
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ PrefService* prefs = profile->GetPrefs();
SetupControls(prefs);
// Show the dialog.
diff --git a/chrome/browser/ui/views/dom_view.cc b/chrome/browser/ui/views/dom_view.cc
index c19912f..7645cd7 100644
--- a/chrome/browser/ui/views/dom_view.cc
+++ b/chrome/browser/ui/views/dom_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/dom_view.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "views/focus/focus_manager.h"
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 6800ad2..7bca147 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -439,7 +439,7 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
data->url = contents->GetURL();
data->loading = contents->IsLoading();
data->crashed_status = contents->crashed_status();
- data->incognito = contents->profile()->IsOffTheRecord();
+ data->incognito = contents->browser_context()->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/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc
index a6faa09..816d323 100644
--- a/chrome/browser/ui/webui/active_downloads_ui.cc
+++ b/chrome/browser/ui/webui/active_downloads_ui.cc
@@ -382,7 +382,8 @@ ActiveDownloadsUI::ActiveDownloadsUI(TabContents* contents)
ActiveDownloadsUIHTMLSource* html_source = new ActiveDownloadsUIHTMLSource();
// Set up the chrome://active-downloads/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
// static
diff --git a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
index 243221d..325ef6b 100644
--- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
@@ -252,7 +252,8 @@ ChooseMobileNetworkUI::ChooseMobileNetworkUI(TabContents* contents)
ChooseMobileNetworkHTMLSource* html_source =
new ChooseMobileNetworkHTMLSource();
// Set up the "chrome://choose-mobile-network" source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
index 71bfb67..2ea3a32 100644
--- a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc
@@ -167,7 +167,9 @@ void EnterpriseEnrollmentUI::RenderViewCreated(
ChromeURLDataManager::DataSource::SetFontAndTextDirection(
localized_strings.get());
// Set up the data source, so the enrollment page can be loaded.
- tab_contents()->profile()->GetChromeURLDataManager()->AddDataSource(
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents()->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(
new EnterpriseEnrollmentDataSource(localized_strings.release()));
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
index e8bdd0b..9e54398 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc
@@ -433,7 +433,7 @@ void WebUIHandler::OnConfigFileFetched(const ConfigFile&
}
if (!download_manager_) {
- download_manager_ = tab_contents_->profile()->GetDownloadManager();
+ download_manager_ = tab_contents_->browser_context()->GetDownloadManager();
download_manager_->AddObserver(this);
}
if (!state_machine_->download_started()) {
@@ -668,5 +668,6 @@ ImageBurnUI::ImageBurnUI(TabContents* contents) : ChromeWebUI(contents) {
imageburner::WebUIHandler* handler = new imageburner::WebUIHandler(contents);
AddMessageHandler((handler)->Attach(this));
imageburner::UIHTMLSource* html_source = new imageburner::UIHTMLSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
index eec9b4a..ee7e03c 100644
--- a/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
+++ b/chrome/browser/ui/webui/chromeos/imageburner/imageburner_utils.cc
@@ -305,7 +305,7 @@ void BurnManager::FetchConfigFile(TabContents* tab_contents,
config_file_requested_ = true;
config_file_path_ = GetImageDir().Append(kConfigFileName);
- download_manager_ = tab_contents->profile()->GetDownloadManager();
+ download_manager_ = tab_contents->browser_context()->GetDownloadManager();
download_manager_->AddObserver(this);
downloader()->AddListener(this, config_file_url_);
downloader()->DownloadFile(config_file_url_, config_file_path_, tab_contents);
@@ -429,7 +429,7 @@ void Downloader::OnFileStreamCreatedOnUIThread(const GURL& url,
if (created_file_stream) {
DownloadManager* download_manager =
- tab_contents->profile()->GetDownloadManager();
+ tab_contents->browser_context()->GetDownloadManager();
DownloadSaveInfo save_info;
save_info.file_path = file_path;
save_info.file_stream = linked_ptr<net::FileStream>(created_file_stream);
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
index 51000d2..112d012 100644
--- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -317,11 +317,12 @@ void KeyboardOverlayHandler::GetLabelMap(const ListValue* args) {
KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents)
: HtmlDialogUI(contents) {
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
KeyboardOverlayHandler* handler =
- new KeyboardOverlayHandler(contents->profile());
+ new KeyboardOverlayHandler(profile);
AddMessageHandler((handler)->Attach(this));
KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource();
// Set up the chrome://keyboardoverlay/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/login/login_ui.cc b/chrome/browser/ui/webui/chromeos/login/login_ui.cc
index 0b83815..c140263 100644
--- a/chrome/browser/ui/webui/chromeos/login/login_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/login_ui.cc
@@ -74,20 +74,20 @@ LoginUI::LoginUI(TabContents* contents)
AddMessageHandler(signin_screen_handler->Attach(this));
signin_screen_handler->GetLocalizedStrings(localized_strings.get());
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
LoginUIHTMLSource* html_source =
new LoginUIHTMLSource(localized_strings.release());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Load the theme URLs.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Load the user-image URLs
// Set up the chrome://userimage/ source.
chromeos::UserImageSource* user_image_source =
new chromeos::UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index e225c4d..4ec88d0 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -224,22 +224,21 @@ OobeUI::OobeUI(TabContents* contents)
DictionaryValue* localized_strings = new DictionaryValue();
GetLocalizedStrings(localized_strings);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
// Set up the chrome://theme/ source, for Chrome logo.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the chrome://terms/ data source, for EULA content.
- InitializeAboutDataSource(chrome::kChromeUITermsHost, contents->profile());
+ InitializeAboutDataSource(chrome::kChromeUITermsHost, profile);
// Set up the chrome://oobe/ source.
- OobeUIHTMLSource* html_source =
- new OobeUIHTMLSource(localized_strings);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ OobeUIHTMLSource* html_source = new OobeUIHTMLSource(localized_strings);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://userimage/ source.
UserImageSource* user_image_source = new UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
}
void OobeUI::ShowScreen(WizardScreen* screen) {
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index 9bde86e..ef94964 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -1329,5 +1329,6 @@ MobileSetupUI::MobileSetupUI(TabContents* contents) : ChromeWebUI(contents) {
new MobileSetupUIHTMLSource(service_path);
// Set up the chrome://mobilesetup/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
index 6477137..4f0e51f 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -80,7 +80,8 @@ ProxySettingsUI::ProxySettingsUI(TabContents* contents)
ProxySettingsHTMLSource* source =
new ProxySettingsHTMLSource(localized_strings);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(source);
}
ProxySettingsUI::~ProxySettingsUI() {
diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
index 14480c8..19768ce 100644
--- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
@@ -310,5 +310,6 @@ RegisterPageUI::RegisterPageUI(TabContents* contents) : ChromeWebUI(contents) {
RegisterPageUIHTMLSource* html_source = new RegisterPageUIHTMLSource();
// Set up the chrome://register/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
index 7cea5a8..9e6e04f 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -656,7 +656,8 @@ SimUnlockUI::SimUnlockUI(TabContents* contents) : ChromeWebUI(contents) {
SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
// Set up the chrome://sim-unlock/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/system_info_ui.cc b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
index 872e987..baa5fcf 100644
--- a/chrome/browser/ui/webui/chromeos/system_info_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
@@ -178,5 +178,6 @@ SystemInfoUI::SystemInfoUI(TabContents* contents) : ChromeWebUI(contents) {
SystemInfoUIHTMLSource* html_source = new SystemInfoUIHTMLSource();
// Set up the chrome://system/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc b/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
index ca18acb..86018d6 100644
--- a/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
+++ b/chrome/browser/ui/webui/collected_cookies_ui_delegate.cc
@@ -133,7 +133,9 @@ void CollectedCookiesSource::StartDataRequest(const std::string& path,
void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) {
CollectedCookiesUIDelegate* delegate =
new CollectedCookiesUIDelegate(tab_contents);
- ConstrainedHtmlUI::CreateConstrainedHtmlDialog(tab_contents->profile(),
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile,
delegate,
tab_contents);
}
@@ -142,11 +144,11 @@ CollectedCookiesUIDelegate::CollectedCookiesUIDelegate(
TabContents* tab_contents)
: tab_contents_(tab_contents),
closed_(false) {
- TabSpecificContentSettings* content_settings =
- TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)->
- content_settings();
+ TabContentsWrapper* wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
+ TabSpecificContentSettings* content_settings = wrapper->content_settings();
HostContentSettingsMap* host_content_settings_map =
- tab_contents_->profile()->GetHostContentSettingsMap();
+ wrapper->profile()->GetHostContentSettingsMap();
registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN,
Source<TabSpecificContentSettings>(content_settings));
@@ -158,7 +160,7 @@ CollectedCookiesUIDelegate::CollectedCookiesUIDelegate(
CollectedCookiesSource* source = new CollectedCookiesSource(
host_content_settings_map->BlockThirdPartyCookies());
- tab_contents->profile()->GetChromeURLDataManager()->AddDataSource(source);
+ wrapper->profile()->GetChromeURLDataManager()->AddDataSource(source);
}
CollectedCookiesUIDelegate::~CollectedCookiesUIDelegate() {
@@ -227,8 +229,10 @@ void CollectedCookiesUIDelegate::SetInfobarLabel(const std::string& text) {
void CollectedCookiesUIDelegate::AddContentException(
CookieTreeOriginNode* origin_node, ContentSetting setting) {
if (origin_node->CanCreateContentException()) {
- origin_node->CreateContentException(
- tab_contents_->profile()->GetHostContentSettingsMap(), setting);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents_->browser_context());
+ origin_node->CreateContentException(profile->GetHostContentSettingsMap(),
+ setting);
SetInfobarLabel(GetInfobarLabel(setting, origin_node->GetTitle()));
}
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index a3d5296..4c1d3ea 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -157,7 +157,8 @@ ConflictsUI::ConflictsUI(TabContents* contents) : ChromeWebUI(contents) {
AddMessageHandler((new ConflictsDOMHandler())->Attach(this));
// Set up the about:conflicts source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(
CreateConflictsUIHTMLSource());
}
diff --git a/chrome/browser/ui/webui/new_profile_ui.cc b/chrome/browser/ui/webui/new_profile_ui.cc
index 1f6ba0a..9bda595 100644
--- a/chrome/browser/ui/webui/new_profile_ui.cc
+++ b/chrome/browser/ui/webui/new_profile_ui.cc
@@ -96,8 +96,9 @@ NewProfileUI::NewProfileUI(TabContents* contents) : ChromeWebUI(contents) {
handler->Attach(this);
// Set up the chrome://theme/ source.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the new profile source.
NewProfileUIHTMLSource* html_source =
@@ -105,5 +106,5 @@ NewProfileUI::NewProfileUI(TabContents* contents) : ChromeWebUI(contents) {
html_source->set_json_path(kStringsJsFile);
html_source->add_resource_path(kNewProfileJsFile, IDR_NEW_PROFILE_JS);
html_source->set_default_resource(IDR_NEW_PROFILE_HTML);
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
}
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index de75ec6..ede0fcd 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -260,18 +260,18 @@ OptionsUI::OptionsUI(TabContents* contents)
new OptionsUIHTMLSource(localized_strings);
// Set up the chrome://settings/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
+ profile->GetChromeURLDataManager()->AddDataSource(html_source);
// Set up the chrome://theme/ source.
- ThemeSource* theme = new ThemeSource(contents->profile());
- contents->profile()->GetChromeURLDataManager()->AddDataSource(theme);
+ ThemeSource* theme = new ThemeSource(profile);
+ profile->GetChromeURLDataManager()->AddDataSource(theme);
#if defined(OS_CHROMEOS)
// Set up the chrome://userimage/ source.
chromeos::UserImageSource* user_image_source =
new chromeos::UserImageSource();
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
- user_image_source);
+ profile->GetChromeURLDataManager()->AddDataSource(user_image_source);
#endif
}
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index d7ab1b0..397e6fc 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -305,11 +305,11 @@ PluginsUI::PluginsUI(TabContents* contents) : ChromeWebUI(contents) {
// Set up the chrome://plugins/ source.
bool enable_controls = true;
+ Profile* profile = Profile::FromBrowserContext(contents->browser_context());
#if !defined(OS_CHROMEOS)
- enable_controls = contents->profile()->GetOriginalProfile()->
- first_launched();
+ enable_controls = profile->GetOriginalProfile()->first_launched();
#endif
- contents->profile()->GetChromeURLDataManager()->AddDataSource(
+ profile->GetChromeURLDataManager()->AddDataSource(
CreatePluginsUIHTMLSource(enable_controls));
}
diff --git a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
index c4a51d9..3176cd1 100644
--- a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
+++ b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc
@@ -37,7 +37,9 @@ WebUI::TypeID TestChromeWebUIFactory::GetWebUIType(
WebUI* TestChromeWebUIFactory::CreateWebUIForURL(TabContents* tab_contents,
const GURL& url) const {
- WebUIProvider* provider = GetWebUIProvider(tab_contents->profile(), url);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ WebUIProvider* provider = GetWebUIProvider(profile, url);
return provider ? provider->NewWebUI(tab_contents, url) :
ChromeWebUIFactory::CreateWebUIForURL(tab_contents, url);
}
diff --git a/chrome/browser/ui/webui/web_ui_unittest.cc b/chrome/browser/ui/webui/web_ui_unittest.cc
index 93578fc..e027039 100644
--- a/chrome/browser/ui/webui/web_ui_unittest.cc
+++ b/chrome/browser/ui/webui/web_ui_unittest.cc
@@ -158,8 +158,9 @@ TEST_F(WebUITest, StandardToWebUI) {
class TabContentsForFocusTest : public TestTabContents {
public:
- TabContentsForFocusTest(Profile* profile, SiteInstance* instance)
- : TestTabContents(profile, instance), focus_called_(0) {
+ TabContentsForFocusTest(content::BrowserContext* browser_context,
+ SiteInstance* instance)
+ : TestTabContents(browser_context, instance), focus_called_(0) {
}
virtual void SetFocusToLocationBar(bool select_all) { ++focus_called_; }
@@ -172,8 +173,8 @@ class TabContentsForFocusTest : public TestTabContents {
TEST_F(WebUITest, FocusOnNavigate) {
// Setup. |tc| will be used to track when we try to focus the location bar.
TabContentsForFocusTest* tc = new TabContentsForFocusTest(
- contents()->profile(),
- SiteInstance::CreateSiteInstance(contents()->profile()));
+ contents()->browser_context(),
+ SiteInstance::CreateSiteInstance(contents()->browser_context()));
tc->controller().CopyStateFrom(controller());
SetContents(tc);
int page_id = 200;