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 | |
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')
44 files changed, 152 insertions, 98 deletions
diff --git a/chrome/browser/debugger/browser_list_tabcontents_provider.cc b/chrome/browser/debugger/browser_list_tabcontents_provider.cc index c7570ae..7e193e5 100644 --- a/chrome/browser/debugger/browser_list_tabcontents_provider.cc +++ b/chrome/browser/debugger/browser_list_tabcontents_provider.cc @@ -4,6 +4,7 @@ #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 7c68562..c552ada 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/restore_tab_helper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" diff --git a/chrome/browser/sidebar/sidebar_manager.cc b/chrome/browser/sidebar/sidebar_manager.cc index 0398ba5..c00a5b4 100644 --- a/chrome/browser/sidebar/sidebar_manager.cc +++ b/chrome/browser/sidebar/sidebar_manager.cc @@ -87,16 +87,22 @@ void SidebarManager::NotifyStateChanges( FindSidebarContainerFor(active_sidebar_contents); if (was_active_host != NULL) { + Profile* profile = Profile::FromBrowserContext( + was_active_sidebar_contents->browser_context()); ExtensionSidebarEventRouter::OnStateChanged( - was_active_sidebar_contents->profile(), - was_active_host->tab_contents(), was_active_host->content_id(), + profile, + was_active_host->tab_contents(), + was_active_host->content_id(), extension_sidebar_constants::kShownState); } if (active_host != NULL) { + Profile* profile = Profile::FromBrowserContext( + active_sidebar_contents->browser_context()); ExtensionSidebarEventRouter::OnStateChanged( - active_sidebar_contents->profile(), - active_host->tab_contents(), active_host->content_id(), + profile, + active_host->tab_contents(), + active_host->content_id(), extension_sidebar_constants::kActiveState); } } @@ -115,8 +121,9 @@ void SidebarManager::ShowSidebar(TabContents* tab, host->Show(); + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); ExtensionSidebarEventRouter::OnStateChanged( - tab->profile(), tab, content_id, + profile, tab, content_id, extension_sidebar_constants::kShownState); } @@ -172,8 +179,9 @@ void SidebarManager::HideSidebar(TabContents* tab, UnregisterSidebarContainerFor(tab, content_id); + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); ExtensionSidebarEventRouter::OnStateChanged( - tab->profile(), tab, content_id, + profile, tab, content_id, extension_sidebar_constants::kHiddenState); } diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index 4e70725..62c3b9c 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -150,7 +150,7 @@ void SessionChangeProcessor::Observe(int type, case chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED: { ExtensionTabHelper* extension_tab_helper = Source<ExtensionTabHelper>(source).ptr(); - if (extension_tab_helper->tab_contents()->profile() != profile_) { + if (extension_tab_helper->tab_contents()->browser_context() != 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 2de7627..a089432 100644 --- a/chrome/browser/tab_contents/chrome_interstitial_page.cc +++ b/chrome/browser/tab_contents/chrome_interstitial_page.cc @@ -5,6 +5,7 @@ #include "chrome/browser/tab_contents/chrome_interstitial_page.h" #include "chrome/browser/dom_operation_notification_details.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/tab_contents.h" @@ -15,9 +16,9 @@ ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab, bool new_navigation, const GURL& url) : InterstitialPage(tab, new_navigation, url) { + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); RendererPreferences prefs; - renderer_preferences_util::UpdateFromSystemSettings( - &prefs, tab->profile()); + 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 aa46b85..11a5887 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -190,15 +190,14 @@ RenderViewContextMenu::RenderViewContextMenu( const ContextMenuParams& params) : params_(params), source_tab_contents_(tab_contents), - profile_(tab_contents->profile()), + profile_(Profile::FromBrowserContext(tab_contents->browser_context())), ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)), external_(false), ALLOW_THIS_IN_INITIALIZER_LIST(spellcheck_submenu_model_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(speech_input_submenu_model_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(bidi_submenu_model_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(protocol_handler_submenu_model_(this)), - protocol_handler_registry_( - tab_contents->profile()->GetProtocolHandlerRegistry()) { + protocol_handler_registry_(profile_->GetProtocolHandlerRegistry()) { } RenderViewContextMenu::~RenderViewContextMenu() { @@ -1798,9 +1797,11 @@ void RenderViewContextMenu::OpenURL( details.source_frame_id = frame_id; details.target_url = url; details.target_tab_contents = new_contents; + Profile* profile = + Profile::FromBrowserContext(source_tab_contents_->browser_context()); NotificationService::current()->Notify( content::NOTIFICATION_RETARGETING, - Source<Profile>(source_tab_contents_->profile()), + Source<Profile>(profile), Details<content::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 f605fa1..e173c06 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -244,9 +244,11 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindowFromTabContents( details.source_frame_id = params.opener_frame_id; details.target_url = params.target_url; details.target_tab_contents = new_contents; + Profile* profile = + Profile::FromBrowserContext(tab_contents->browser_context()); NotificationService::current()->Notify( content::NOTIFICATION_RETARGETING, - Source<Profile>(tab_contents->profile()), + Source<Profile>(profile), Details<content::RetargetingDetails>(&details)); if (tab_contents->delegate()) diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc index 36e2560..299b3d6 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->profile(), + SiteInstance::IsSameWebSite(source_contents->browser_context(), 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 d0a86f0..d0cbd9b 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.cc +++ b/chrome/browser/tab_contents/thumbnail_generator.cc @@ -440,9 +440,11 @@ SkBitmap ThumbnailGenerator::GetClippedBitmap(const SkBitmap& bitmap, void ThumbnailGenerator::UpdateThumbnailIfNecessary( TabContents* tab_contents) { const GURL& url = tab_contents->GetURL(); - history::TopSites* top_sites = tab_contents->profile()->GetTopSites(); + Profile* profile = + Profile::FromBrowserContext(tab_contents->browser_context()); + history::TopSites* top_sites = profile->GetTopSites(); // Skip if we don't need to update the thumbnail. - if (!ShouldUpdateThumbnail(tab_contents->profile(), top_sites, url)) + if (!ShouldUpdateThumbnail(profile, top_sites, url)) return; const int options = ThumbnailGenerator::kClippedThumbnail; diff --git a/chrome/browser/tabs/tab_finder.cc b/chrome/browser/tabs/tab_finder.cc index ec2ca0e..af32e1f 100644 --- a/chrome/browser/tabs/tab_finder.cc +++ b/chrome/browser/tabs/tab_finder.cc @@ -182,12 +182,14 @@ void TabFinder::TabDestroyed(TabContentsObserverImpl* observer) { } void TabFinder::CancelRequestsFor(TabContents* tab_contents) { - if (tab_contents->profile()->IsOffTheRecord()) + Profile* profile = + Profile::FromBrowserContext(tab_contents->browser_context()); + if (profile->IsOffTheRecord()) return; tab_contents_to_url_.erase(tab_contents); - HistoryService* history = tab_contents->profile()->GetHistoryService( + HistoryService* history = profile->GetHistoryService( Profile::EXPLICIT_ACCESS); if (history) { CancelableRequestProvider::Handle request_handle; @@ -199,14 +201,15 @@ void TabFinder::CancelRequestsFor(TabContents* tab_contents) { } void TabFinder::FetchRedirectStart(TabContents* tab) { - if (tab->profile()->IsOffTheRecord()) + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); + if (profile->IsOffTheRecord()) return; NavigationEntry* committed_entry = tab->controller().GetLastCommittedEntry(); if (!committed_entry || committed_entry->url().is_empty()) return; - HistoryService* history =tab->profile()->GetHistoryService( + HistoryService* history = profile->GetHistoryService( Profile::EXPLICIT_ACCESS); if (history) { CancelableRequestProvider::Handle request_handle = diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc index a4c3e9a..fc3a59f 100644 --- a/chrome/browser/translate/options_menu_model.cc +++ b/chrome/browser/translate/options_menu_model.cc @@ -36,7 +36,8 @@ OptionsMenuModel::OptionsMenuModel( // Populate the menu. // Incognito mode does not get any preferences related items. - if (!translate_delegate->tab_contents()->profile()->IsOffTheRecord()) { + if (!translate_delegate->tab_contents()-> + browser_context()->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 3677693..813889e 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -99,7 +99,7 @@ void TranslateInfoBarDelegate::SetTargetLanguage(size_t language_index) { void TranslateInfoBarDelegate::Translate() { const std::string& original_language_code = GetOriginalLanguageCode(); - if (!tab_contents()->profile()->IsOffTheRecord()) { + if (!tab_contents()->browser_context()->IsOffTheRecord()) { prefs_.ResetTranslationDeniedCount(original_language_code); prefs_.IncrementTranslationAcceptedCount(original_language_code); } @@ -120,7 +120,7 @@ void TranslateInfoBarDelegate::ReportLanguageDetectionError() { void TranslateInfoBarDelegate::TranslationDeclined() { const std::string& original_language_code = GetOriginalLanguageCode(); - if (!tab_contents()->profile()->IsOffTheRecord()) { + if (!tab_contents()->browser_context()->IsOffTheRecord()) { prefs_.ResetTranslationAcceptedCount(original_language_code); prefs_.IncrementTranslationDeniedCount(original_language_code); } @@ -257,13 +257,13 @@ bool TranslateInfoBarDelegate::ShouldShowMessageInfoBarButton() { bool TranslateInfoBarDelegate::ShouldShowNeverTranslateButton() { DCHECK_EQ(BEFORE_TRANSLATE, type_); - return !tab_contents()->profile()->IsOffTheRecord() && + return !tab_contents()->browser_context()->IsOffTheRecord() && (prefs_.GetTranslationDeniedCount(GetOriginalLanguageCode()) >= 3); } bool TranslateInfoBarDelegate::ShouldShowAlwaysTranslateButton() { DCHECK_EQ(BEFORE_TRANSLATE, type_); - return !tab_contents()->profile()->IsOffTheRecord() && + return !tab_contents()->browser_context()->IsOffTheRecord() && (prefs_.GetTranslationAcceptedCount(GetOriginalLanguageCode()) >= 3); } @@ -318,7 +318,8 @@ TranslateInfoBarDelegate::TranslateInfoBarDelegate( target_language_index_(kNoIndex), error_(error), infobar_view_(NULL), - prefs_(tab_contents_->profile()->GetPrefs()) { + prefs_(Profile::FromBrowserContext( + tab_contents_->browser_context())->GetPrefs()) { DCHECK_NE((type_ == TRANSLATION_ERROR), (error == TranslateErrors::NONE)); std::vector<std::string> language_codes; diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 34f1b64..725e691 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -438,7 +438,8 @@ TranslateManager::TranslateManager() void TranslateManager::InitiateTranslation(TabContents* tab, const std::string& page_lang) { - PrefService* prefs = tab->profile()->GetOriginalProfile()->GetPrefs(); + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); + PrefService* prefs = profile->GetOriginalProfile()->GetPrefs(); if (!prefs->GetBoolean(prefs::kEnableTranslate)) return; @@ -483,7 +484,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->profile()->IsOffTheRecord() && + if (!tab->browser_context()->IsOffTheRecord() && TranslatePrefs::ShouldAutoTranslate(prefs, language_code, &auto_target_lang)) { TranslatePage(tab, language_code, auto_target_lang); @@ -593,8 +594,9 @@ void TranslateManager::ReportLanguageDetectionError(TabContents* tab_contents) { report_error_url += GetLanguageCode(g_browser_process->GetApplicationLocale()); // Open that URL in a new tab so that the user can tell us more. - Browser* browser = BrowserList::GetLastActiveWithProfile( - tab_contents->profile()); + Profile* profile = + Profile::FromBrowserContext(tab_contents->browser_context()); + Browser* browser = BrowserList::GetLastActiveWithProfile(profile); if (!browser) { NOTREACHED(); return; @@ -656,7 +658,8 @@ void TranslateManager::PageTranslated(TabContents* tab, bool TranslateManager::IsAcceptLanguage(TabContents* tab, const std::string& language) { - PrefService* pref_service = tab->profile()->GetOriginalProfile()->GetPrefs(); + Profile* profile = Profile::FromBrowserContext(tab->browser_context()); + PrefService* pref_service = profile->GetOriginalProfile()->GetPrefs(); PrefServiceLanguagesMap::const_iterator iter = accept_languages_.find(pref_service); if (iter == accept_languages_.end()) { @@ -664,7 +667,7 @@ bool TranslateManager::IsAcceptLanguage(TabContents* tab, // Listen for this profile going away, in which case we would need to clear // the accepted languages for the profile. notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, - Source<Profile>(tab->profile())); + Source<Profile>(profile)); // Also start listening for changes in the accept languages. pref_change_registrar_.Add(prefs::kAcceptLanguages, this); 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); } |