diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 18:44:52 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 18:44:52 +0000 |
commit | 7a91c555f3e057f8be9010a4e5385678ce822c28 (patch) | |
tree | edb8a4384b09b3ce70b6b58a17afe5470eb5e039 /content/browser/browser_url_handler_impl.cc | |
parent | e2e22a7ab44c2f49d856a9f840893c5462f52679 (diff) | |
download | chromium_src-7a91c555f3e057f8be9010a4e5385678ce822c28.zip chromium_src-7a91c555f3e057f8be9010a4e5385678ce822c28.tar.gz chromium_src-7a91c555f3e057f8be9010a4e5385678ce822c28.tar.bz2 |
content/browser: Move more files into the content namespace.
Fixed most of the files found with the following command line:
$ git grep --files-without-match --name-only "namespace content {" -- content/browser/{*.cc,*.h.*.mm}
R=jam@chromium.org
Review URL: https://codereview.chromium.org/11274038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_url_handler_impl.cc')
-rw-r--r-- | content/browser/browser_url_handler_impl.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc index 2585844..46ed715 100644 --- a/content/browser/browser_url_handler_impl.cc +++ b/content/browser/browser_url_handler_impl.cc @@ -10,11 +10,12 @@ #include "content/public/common/url_constants.h" #include "googleurl/src/gurl.h" -using content::BrowserURLHandler; +namespace content { + +namespace { // Handles rewriting view-source URLs for what we'll actually load. -static bool HandleViewSource(GURL* url, - content::BrowserContext* browser_context) { +bool HandleViewSource(GURL* url, BrowserContext* browser_context) { if (url->SchemeIs(chrome::kViewSourceScheme)) { // Load the inner URL instead. *url = GURL(url->path()); @@ -46,8 +47,7 @@ static bool HandleViewSource(GURL* url, } // Turns a non view-source URL into the corresponding view-source URL. -static bool ReverseViewSource(GURL* url, - content::BrowserContext* browser_context) { +bool ReverseViewSource(GURL* url, BrowserContext* browser_context) { // No action necessary if the URL is already view-source: if (url->SchemeIs(chrome::kViewSourceScheme)) return false; @@ -61,8 +61,7 @@ static bool ReverseViewSource(GURL* url, return true; } -static bool HandleDebugUrl(GURL* url, - content::BrowserContext* browser_context) { +bool HandleDebugUrl(GURL* url, BrowserContext* browser_context) { // Circumvent processing URLs that the renderer process will handle. return *url == GURL(chrome::kChromeUICrashURL) || *url == GURL(chrome::kChromeUIHangURL) || @@ -70,6 +69,8 @@ static bool HandleDebugUrl(GURL* url, *url == GURL(chrome::kChromeUIShorthangURL); } +} // namespace + // static BrowserURLHandler* BrowserURLHandler::GetInstance() { return BrowserURLHandlerImpl::GetInstance(); @@ -89,7 +90,7 @@ BrowserURLHandlerImpl* BrowserURLHandlerImpl::GetInstance() { BrowserURLHandlerImpl::BrowserURLHandlerImpl() { AddHandlerPair(&HandleDebugUrl, BrowserURLHandlerImpl::null_handler()); - content::GetContentClient()->browser()->BrowserURLHandlerCreated(this); + GetContentClient()->browser()->BrowserURLHandlerCreated(this); // view-source: AddHandlerPair(&HandleViewSource, &ReverseViewSource); @@ -105,7 +106,7 @@ void BrowserURLHandlerImpl::AddHandlerPair(URLHandler handler, void BrowserURLHandlerImpl::RewriteURLIfNecessary( GURL* url, - content::BrowserContext* browser_context, + BrowserContext* browser_context, bool* reverse_on_redirect) { for (size_t i = 0; i < url_handlers_.size(); ++i) { URLHandler handler = *url_handlers_[i].first; @@ -116,8 +117,9 @@ void BrowserURLHandlerImpl::RewriteURLIfNecessary( } } -bool BrowserURLHandlerImpl::ReverseURLRewrite( - GURL* url, const GURL& original, content::BrowserContext* browser_context) { +bool BrowserURLHandlerImpl::ReverseURLRewrite(GURL* url, + const GURL& original, + BrowserContext* browser_context) { for (size_t i = 0; i < url_handlers_.size(); ++i) { URLHandler reverse_rewriter = *url_handlers_[i].second; if (reverse_rewriter) { @@ -133,3 +135,5 @@ bool BrowserURLHandlerImpl::ReverseURLRewrite( } return false; } + +} // namespace content |