diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 23:46:31 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 23:46:31 +0000 |
commit | a23abe47768829383eb8ddbb155d8655d29b801d (patch) | |
tree | 38b037cc2ae4d7940acb10a303b6223990bdbc5d /chrome/browser/ui/browser.cc | |
parent | 4a971fa56b5ea21e31fd71f4b5c7262cc01b9708 (diff) | |
download | chromium_src-a23abe47768829383eb8ddbb155d8655d29b801d.zip chromium_src-a23abe47768829383eb8ddbb155d8655d29b801d.tar.gz chromium_src-a23abe47768829383eb8ddbb155d8655d29b801d.tar.bz2 |
Use content::BrowserContext where possible in c/b/custom_handler, c/b/ui/content_settings
BUG=397320
R=sky@chromium.org
Review URL: https://codereview.chromium.org/429003002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r-- | chrome/browser/ui/browser.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index c8caf53..0981432 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1639,16 +1639,15 @@ void Browser::RegisterProtocolHandler(WebContents* web_contents, const std::string& protocol, const GURL& url, bool user_gesture) { - Profile* profile = - Profile::FromBrowserContext(web_contents->GetBrowserContext()); - if (profile->IsOffTheRecord()) + content::BrowserContext* context = web_contents->GetBrowserContext(); + if (context->IsOffTheRecord()) return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); ProtocolHandlerRegistry* registry = - ProtocolHandlerRegistryFactory::GetForProfile(profile); + ProtocolHandlerRegistryFactory::GetForBrowserContext(context); if (registry->SilentlyHandleRegisterHandlerRequest(handler)) return; @@ -1687,16 +1686,15 @@ void Browser::UnregisterProtocolHandler(WebContents* web_contents, bool user_gesture) { // user_gesture will be used in case we decide to have confirmation bubble // for user while un-registering the handler. - Profile* profile = - Profile::FromBrowserContext(web_contents->GetBrowserContext()); - if (profile->IsOffTheRecord()) + content::BrowserContext* context = web_contents->GetBrowserContext(); + if (context->IsOffTheRecord()) return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); ProtocolHandlerRegistry* registry = - ProtocolHandlerRegistryFactory::GetForProfile(profile); + ProtocolHandlerRegistryFactory::GetForBrowserContext(context); registry->RemoveHandler(handler); } |