diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-01 14:30:39 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-01 14:30:39 +0000 |
commit | 4c1865ad4cd7176d6bea8b3632872e8dd4e19c51 (patch) | |
tree | 749993bd283c2ca64f4460cefcb32a64760c079b /chrome/browser/ui | |
parent | 68bec8591fedbe3db84cf38d1deae260412c1751 (diff) | |
download | chromium_src-4c1865ad4cd7176d6bea8b3632872e8dd4e19c51.zip chromium_src-4c1865ad4cd7176d6bea8b3632872e8dd4e19c51.tar.gz chromium_src-4c1865ad4cd7176d6bea8b3632872e8dd4e19c51.tar.bz2 |
Removal of Profile from content part 4.
BUG=76788
TEST=no change visible
Review URL: http://codereview.chromium.org/7531004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
31 files changed, 95 insertions, 65 deletions
diff --git a/chrome/browser/ui/autologin_infobar_delegate.cc b/chrome/browser/ui/autologin_infobar_delegate.cc index 58581ab..15b9a5a 100644 --- a/chrome/browser/ui/autologin_infobar_delegate.cc +++ b/chrome/browser/ui/autologin_infobar_delegate.cc @@ -76,8 +76,7 @@ AutoLoginRedirector::AutoLoginRedirector( registrar_.Add(this, chrome::NOTIFICATION_TOKEN_REQUEST_FAILED, NotificationService::AllSources()); - tab_contents_wrapper_->tab_contents()->profile()->GetTokenService()-> - StartFetchingTokens(); + tab_contents_wrapper_->profile()->GetTokenService()->StartFetchingTokens(); } AutoLoginRedirector::~AutoLoginRedirector() { @@ -190,26 +189,25 @@ void AutoLoginInfoBarDelegate::ShowInfoBarIfNeeded(const std::string& account, if (!tab_contents) return; - // If auto-login is turned off, then simply return. - if (!tab_contents->profile()->GetPrefs()->GetBoolean( - prefs::kAutologinEnabled)) - return; - TabContentsWrapper* tab_contents_wrapper = TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); // tab_contents_wrapper is NULL for TabContents hosted in HTMLDialog. if (!tab_contents_wrapper) return; + // If auto-login is turned off, then simply return. + if (!tab_contents_wrapper->profile()->GetPrefs()->GetBoolean( + prefs::kAutologinEnabled)) + return; + // Make sure that the account specified matches the logged in user. // However, account is usually empty. In an incognito window, there may // not be a profile sync service and/or signin manager. - if (!tab_contents_wrapper->tab_contents()->profile()->HasProfileSyncService()) + if (!tab_contents_wrapper->profile()->HasProfileSyncService()) return; SigninManager* signin_manager = - tab_contents_wrapper->tab_contents()->profile()-> - GetProfileSyncService()->signin(); + tab_contents_wrapper->profile()->GetProfileSyncService()->signin(); if (!signin_manager) return; @@ -219,7 +217,7 @@ void AutoLoginInfoBarDelegate::ShowInfoBarIfNeeded(const std::string& account, // Make sure there are credentials in the token manager, otherwise there is // no way to craft the TokenAuth URL. - if (!tab_contents_wrapper->tab_contents()->profile()->GetTokenService()-> + if (!tab_contents_wrapper->profile()->GetTokenService()-> AreCredentialsValid()) { return; } @@ -297,8 +295,7 @@ bool AutoLoginInfoBarDelegate::Accept() { } bool AutoLoginInfoBarDelegate::Cancel() { - PrefService* user_prefs = tab_contents_wrapper_->tab_contents()->profile()-> - GetPrefs(); + PrefService* user_prefs = tab_contents_wrapper_->profile()->GetPrefs(); user_prefs->SetBoolean(prefs::kAutologinEnabled, false); user_prefs->ScheduleSavePersistentPrefs(); return true; 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 2f7eab9..3e4e257 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc @@ -83,9 +83,11 @@ void BlockedContentTabHelper::AddPopup(TabContentsWrapper* new_contents, // because it returns the active entry. NavigationEntry* entry = tab_contents()->controller().GetLastCommittedEntry(); GURL creator = entry ? entry->virtual_url() : GURL::EmptyGURL(); + Profile* profile = + Profile::FromBrowserContext(tab_contents()->browser_context()); if (creator.is_valid() && - tab_contents()->profile()->GetHostContentSettingsMap()->GetContentSetting( + profile->GetHostContentSettingsMap()->GetContentSetting( creator, creator, CONTENT_SETTINGS_TYPE_POPUPS, diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc index c7c6d72..56e19f8 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc @@ -96,7 +96,9 @@ BookmarkTabHelper::BookmarkDrag* } void BookmarkTabHelper::UpdateStarredStateForCurrentURL() { - BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); + Profile* profile = + Profile::FromBrowserContext(tab_contents()->browser_context()); + 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_init.cc b/chrome/browser/ui/browser_init.cc index d6a6f34..fa1ed9e 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -168,7 +168,7 @@ class DefaultBrowserInfoBarDelegate : public ConfirmInfoBarDelegate { DefaultBrowserInfoBarDelegate::DefaultBrowserInfoBarDelegate( TabContents* contents) : ConfirmInfoBarDelegate(contents), - profile_(contents->profile()), + profile_(Profile::FromBrowserContext(contents->browser_context())), action_taken_(false), should_expire_(false), ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { @@ -318,7 +318,7 @@ SessionCrashedInfoBarDelegate::SessionCrashedInfoBarDelegate( TabContents* contents) : ConfirmInfoBarDelegate(contents), browser_(browser), - profile_(contents->profile()) { + profile_(Profile::FromBrowserContext(contents->browser_context())) { } SessionCrashedInfoBarDelegate::~SessionCrashedInfoBarDelegate() { diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm index b9490e2..fa0e705 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm @@ -184,8 +184,9 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { [infoBar_ setStrokeColor:bannerStrokeColor]; // Change the label of the blocked cookies part if necessary. - if (tabContents_->profile()->GetHostContentSettingsMap()-> - BlockThirdPartyCookies()) { + Profile* profile = + Profile::FromBrowserContext(tabContents_->browser_context()); + if (profile->GetHostContentSettingsMap()->BlockThirdPartyCookies()) { [blockedCookiesText_ setStringValue:l10n_util::GetNSString( IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED)]; CGFloat textDeltaY = [GTMUILocalizerAndLayoutTweaker @@ -241,11 +242,12 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { CookieTreeNode::DetailedInfo::TYPE_ORIGIN) { continue; } + Profile* profile = + Profile::FromBrowserContext(tabContents_->browser_context()); CookieTreeOriginNode* origin_node = static_cast<CookieTreeOriginNode*>(cookie); - origin_node->CreateContentException( - tabContents_->profile()->GetHostContentSettingsMap(), - setting); + origin_node->CreateContentException(profile->GetHostContentSettingsMap(), + setting); if (!lastDomain.empty()) multipleDomainsChanged = YES; lastDomain = origin_node->GetTitle(); diff --git a/chrome/browser/ui/cocoa/keystone_infobar.mm b/chrome/browser/ui/cocoa/keystone_infobar.mm index fd1ba9f..81700f4 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar.mm @@ -69,7 +69,7 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate { KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate( TabContents* tab_contents) : ConfirmInfoBarDelegate(tab_contents), - profile_(tab_contents->profile()), + profile_(Profile::FromBrowserContext(tab_contents->browser_context())), can_expire_(false), ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { const int kCanExpireOnNavigationAfterMilliseconds = 8 * 1000; diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc index 80eaf8a..cbd473f 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc @@ -111,12 +111,12 @@ void ContentSettingBlockedImageModel::UpdateFromTabContents( const int* explanatory_string_ids = kBlockedExplanatoryTextIDs; // If a content type is blocked by default and was accessed, display the // accessed icon. - TabSpecificContentSettings* content_settings = - TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> - content_settings(); + TabContentsWrapper* wrapper = + TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); + TabSpecificContentSettings* content_settings = wrapper->content_settings(); if (!content_settings->IsContentBlocked(get_content_settings_type())) { if (!content_settings->IsContentAccessed(get_content_settings_type()) || - (tab_contents->profile()->GetHostContentSettingsMap()-> + (wrapper->profile()->GetHostContentSettingsMap()-> GetDefaultContentSetting(get_content_settings_type()) != CONTENT_SETTING_BLOCK)) return; diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc index f51d77e..a595e53 100644 --- a/chrome/browser/ui/find_bar/find_tab_helper.cc +++ b/chrome/browser/ui/find_bar/find_tab_helper.cc @@ -38,8 +38,10 @@ void FindTabHelper::StartFinding(string16 search_string, // If search_string is empty, it means FindNext was pressed with a keyboard // 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()); string16 last_search_prepopulate_text = - FindBarState::GetLastPrepopulateText(tab_contents()->profile()); + FindBarState::GetLastPrepopulateText(profile); // Try the last thing we searched for on this tab, then the last thing // searched for on any tab. @@ -73,7 +75,9 @@ void FindTabHelper::StartFinding(string16 search_string, find_op_aborted_ = false; // Keep track of what the last search was across the tabs. - FindBarState* find_bar_state = tab_contents()->profile()->GetFindBarState(); + Profile* profile = + Profile::FromBrowserContext(tab_contents()->browser_context()); + FindBarState* find_bar_state = profile->GetFindBarState(); find_bar_state->set_last_prepopulate_text(find_text_); WebFindOptions options; 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 af32620..5a9772db 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -58,11 +58,13 @@ 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()); if (!tab_contents()->IsActiveEntry(page_id)) return; - if (!tab_contents()->profile()->GetTemplateURLFetcher()) + if (!profile->GetTemplateURLFetcher()) return; - if (tab_contents()->profile()->IsOffTheRecord()) + if (profile->IsOffTheRecord()) return; TemplateURLFetcher::ProviderType provider_type; @@ -116,7 +118,7 @@ void SearchEngineTabHelper::OnPageHasOSDD( // Download the OpenSearch description document. If this is successful, a // new keyword will be created when done. - tab_contents()->profile()->GetTemplateURLFetcher()->ScheduleDownload( + profile->GetTemplateURLFetcher()->ScheduleDownload( keyword, doc_url, base_entry->favicon().url(), @@ -129,7 +131,9 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary( if (!params.searchable_form_url.is_valid()) return; - if (tab_contents()->profile()->IsOffTheRecord()) + Profile* profile = + Profile::FromBrowserContext(tab_contents()->browser_context()); + if (profile->IsOffTheRecord()) return; const NavigationController& controller = tab_contents()->controller(); @@ -156,7 +160,7 @@ void SearchEngineTabHelper::GenerateKeywordIfNecessary( return; TemplateURLService* url_service = - TemplateURLServiceFactory::GetForProfile(tab_contents()->profile()); + TemplateURLServiceFactory::GetForProfile(profile); if (!url_service) return; diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index 1ba37e0..b1902fb0 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -85,9 +85,10 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const { // Return the entry title, escaping any '&' characters and eliding it if it's // super long. NavigationEntry* entry = GetNavigationEntry(index); + Profile* profile = + Profile::FromBrowserContext(GetTabContents()->browser_context()); string16 menu_text(entry->GetTitleForDisplay( - GetTabContents()->profile()->GetPrefs()-> - GetString(prefs::kAcceptLanguages))); + profile->GetPrefs()->GetString(prefs::kAcceptLanguages))); menu_text = ui::ElideText(menu_text, gfx::Font(), kMaxWidth, false); #if !defined(OS_MACOSX) diff --git a/chrome/browser/ui/webui/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks_ui.cc index f532e7d..6c78bcc 100644 --- a/chrome/browser/ui/webui/bookmarks_ui.cc +++ b/chrome/browser/ui/webui/bookmarks_ui.cc @@ -51,7 +51,8 @@ BookmarksUI::BookmarksUI(TabContents* contents) : ChromeWebUI(contents) { BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource(); // Set up the chrome://bookmarks/ 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/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc index 54a78a6..c29af14 100644 --- a/chrome/browser/ui/webui/bug_report_ui.cc +++ b/chrome/browser/ui/webui/bug_report_ui.cc @@ -461,8 +461,8 @@ 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 - tab_->profile()->GetChromeURLDataManager()->AddDataSource( - new ScreenshotSource(NULL)); + Profile* profile = Profile::FromBrowserContext(tab_->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(new ScreenshotSource(NULL)); // clobber last screenshot if (browser::last_screenshot_png) @@ -472,11 +472,11 @@ void BugReportHandler::ClobberScreenshotsSource() { void BugReportHandler::SetupScreenshotsSource() { // If we don't already have a screenshot source object created, create one. if (!screenshot_source_) - screenshot_source_ = new ScreenshotSource( - browser::last_screenshot_png); + screenshot_source_ = new ScreenshotSource(browser::last_screenshot_png); // Add the source to the data manager. - tab_->profile()->GetChromeURLDataManager()->AddDataSource(screenshot_source_); + Profile* profile = Profile::FromBrowserContext(tab_->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(screenshot_source_); } WebUIMessageHandler* BugReportHandler::Attach(WebUI* web_ui) { @@ -753,5 +753,6 @@ BugReportUI::BugReportUI(TabContents* tab) : HtmlDialogUI(tab) { BugReportUIHTMLSource* html_source = new BugReportUIHTMLSource(handler->Init()); // Set up the chrome://bugreport/ source. - tab->profile()->GetChromeURLDataManager()->AddDataSource(html_source); + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(html_source); } diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_factory.cc index 5af10a8..f42a052 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_factory.cc @@ -91,7 +91,8 @@ template<> ChromeWebUI* NewWebUI<ExtensionWebUI>(TabContents* contents, const GURL& url) { // Don't use a WebUI for incognito tabs because we require extensions to run // within a single process. - ExtensionService* service = contents->profile()->GetExtensionService(); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + ExtensionService* service = profile->GetExtensionService(); if (service && service->ExtensionBindingsAllowed(url)) return new ExtensionWebUI(contents, url); return NULL; diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc index c5e7fc3..5bb00a8 100644 --- a/chrome/browser/ui/webui/crashes_ui.cc +++ b/chrome/browser/ui/webui/crashes_ui.cc @@ -159,7 +159,8 @@ CrashesUI::CrashesUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new CrashesDOMHandler())->Attach(this)); // Set up the chrome://crashes/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( CreateCrashesUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc index 6960ded..450e22f 100644 --- a/chrome/browser/ui/webui/devtools_ui.cc +++ b/chrome/browser/ui/webui/devtools_ui.cc @@ -97,7 +97,8 @@ void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) { DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { DevToolsDataSource* data_source = new DevToolsDataSource(); - contents->profile()->GetChromeURLDataManager()->AddDataSource(data_source); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(data_source); } void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc index e130a5c..9dddc89 100644 --- a/chrome/browser/ui/webui/downloads_ui.cc +++ b/chrome/browser/ui/webui/downloads_ui.cc @@ -87,7 +87,8 @@ DownloadsUI::DownloadsUI(TabContents* contents) : ChromeWebUI(contents) { handler->Init(); // Set up the chrome://downloads/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( CreateDownloadsUIHTMLSource()); } diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index 834914b..b9ed86a 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc @@ -155,8 +155,8 @@ FlagsUI::FlagsUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new FlagsDOMHandler())->Attach(this)); // Set up the about:flags source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( - CreateFlagsUIHTMLSource()); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(CreateFlagsUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc index bcf7cff..77cd15f 100644 --- a/chrome/browser/ui/webui/flash_ui.cc +++ b/chrome/browser/ui/webui/flash_ui.cc @@ -331,8 +331,8 @@ FlashUI::FlashUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new FlashDOMHandler())->Attach(this)); // Set up the about:flash source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( - CreateFlashUIHTMLSource()); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(CreateFlashUIHTMLSource()); } // static diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index 940133f..a6c8d79 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -602,6 +602,6 @@ GpuInternalsUI::GpuInternalsUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new GpuMessageHandler())->Attach(this)); // Set up the chrome://gpu-internals/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( - CreateGpuHTMLSource()); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource()); } diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc index 4e5fc27..726b0e9 100644 --- a/chrome/browser/ui/webui/history2_ui.cc +++ b/chrome/browser/ui/webui/history2_ui.cc @@ -394,7 +394,8 @@ HistoryUI2::HistoryUI2(TabContents* contents) : ChromeWebUI(contents) { HistoryUIHTMLSource2* html_source = new HistoryUIHTMLSource2(); // Set up the chrome://history2/ 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/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index e1b25a2..9fa45b7 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -389,7 +389,8 @@ HistoryUI::HistoryUI(TabContents* contents) : ChromeWebUI(contents) { HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource(); // Set up the chrome://history/ 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/media/media_internals_ui.cc b/chrome/browser/ui/webui/media/media_internals_ui.cc index b794ff9..01c4b37 100644 --- a/chrome/browser/ui/webui/media/media_internals_ui.cc +++ b/chrome/browser/ui/webui/media/media_internals_ui.cc @@ -77,6 +77,7 @@ MediaInternalsUI::MediaInternalsUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new MediaInternalsMessageHandler())->Attach(this)); - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( new MediaInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc index 0b17b88..4bd36ac 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc @@ -247,7 +247,8 @@ NewTabUI::NewTabUI(TabContents* contents) InitializeCSSCaches(); NewTabHTMLSource* html_source = new NewTabHTMLSource(GetProfile()->GetOriginalProfile()); - contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(html_source); // Listen for theme installation. registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, diff --git a/chrome/browser/ui/webui/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview_ui.cc index bb3c037..dac6199 100644 --- a/chrome/browser/ui/webui/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview_ui.cc @@ -23,7 +23,8 @@ PrintPreviewUI::PrintPreviewUI(TabContents* contents) AddMessageHandler(handler_->Attach(this)); // Set up the chrome://print/ data source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( new PrintPreviewDataSource()); // Store the PrintPreviewUIAddress as a string. diff --git a/chrome/browser/ui/webui/quota_internals_ui.cc b/chrome/browser/ui/webui/quota_internals_ui.cc index ea81ebb..1e15f18 100644 --- a/chrome/browser/ui/webui/quota_internals_ui.cc +++ b/chrome/browser/ui/webui/quota_internals_ui.cc @@ -20,8 +20,9 @@ QuotaInternalsUI::QuotaInternalsUI(TabContents* contents) : ChromeWebUI(contents) { WebUIMessageHandler* handler = new quota_internals::QuotaInternalsHandler; AddMessageHandler(handler->Attach(this)); - contents->profile()->GetChromeURLDataManager()-> - AddDataSource(new quota_internals::QuotaInternalsHTMLSource); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( + new quota_internals::QuotaInternalsHTMLSource); } namespace quota_internals { diff --git a/chrome/browser/ui/webui/sessions_ui.cc b/chrome/browser/ui/webui/sessions_ui.cc index b8eafb8..7d78573 100644 --- a/chrome/browser/ui/webui/sessions_ui.cc +++ b/chrome/browser/ui/webui/sessions_ui.cc @@ -251,7 +251,8 @@ SessionsUI::SessionsUI(TabContents* contents) : ChromeWebUI(contents) { AddMessageHandler((new SessionsDOMHandler())->Attach(this)); // Set up the chrome://sessions/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + 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 30b2659b..a559788 100644 --- a/chrome/browser/ui/webui/sync_internals_ui.cc +++ b/chrome/browser/ui/webui/sync_internals_ui.cc @@ -32,7 +32,8 @@ SyncInternalsUI::SyncInternalsUI(TabContents* contents) // If this PostTask() call fails, it's most likely because this is // being run from a unit test. The created objects will be cleaned // up, anyway. - contents->profile()->GetChromeURLDataManager()->AddDataSource( + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource( new SyncInternalsHTMLSource()); } diff --git a/chrome/browser/ui/webui/task_manager_ui.cc b/chrome/browser/ui/webui/task_manager_ui.cc index e7baae6..efa1cf3 100644 --- a/chrome/browser/ui/webui/task_manager_ui.cc +++ b/chrome/browser/ui/webui/task_manager_ui.cc @@ -74,6 +74,7 @@ TaskManagerUI::TaskManagerUI(TabContents* contents) : ChromeWebUI(contents) { // Set up the chrome://taskmanager/ source. ChromeWebUIDataSource* html_source = CreateTaskManagerUIHTMLSource(); - 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/test_chrome_web_ui_factory.cc b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc index d404abf..c4a51d9 100644 --- a/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc +++ b/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/test_chrome_web_ui_factory.h" +#include "chrome/browser/profiles/profile.h" #include "content/browser/tab_contents/tab_contents.h" TestChromeWebUIFactory::WebUIProvider::~WebUIProvider() { diff --git a/chrome/browser/ui/webui/textfields_ui.cc b/chrome/browser/ui/webui/textfields_ui.cc index c7385f6..ea25bc3 100644 --- a/chrome/browser/ui/webui/textfields_ui.cc +++ b/chrome/browser/ui/webui/textfields_ui.cc @@ -66,5 +66,6 @@ TextfieldsUI::TextfieldsUI(TabContents* contents) : ChromeWebUI(contents) { TextfieldsUIHTMLSource* html_source = new TextfieldsUIHTMLSource(); // Set up the chrome://textfields/ 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/workers_ui.cc b/chrome/browser/ui/webui/workers_ui.cc index f2220a3..3c538eb 100644 --- a/chrome/browser/ui/webui/workers_ui.cc +++ b/chrome/browser/ui/webui/workers_ui.cc @@ -155,5 +155,6 @@ WorkersUI::WorkersUI(TabContents* contents) : ChromeWebUI(contents) { WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource(); // Set up the chrome://workers/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); + Profile* profile = Profile::FromBrowserContext(contents->browser_context()); + profile->GetChromeURLDataManager()->AddDataSource(html_source); } |