| Index: content/browser/browser_url_handler_impl.cc
|
| ===================================================================
|
| --- content/browser/browser_url_handler_impl.cc (revision 164121)
|
| +++ content/browser/browser_url_handler_impl.cc (working copy)
|
| @@ -10,12 +10,11 @@
|
| #include "content/public/common/url_constants.h"
|
| #include "googleurl/src/gurl.h"
|
|
|
| -namespace content {
|
| +using content::BrowserURLHandler;
|
|
|
| -namespace {
|
| -
|
| // Handles rewriting view-source URLs for what we'll actually load.
|
| -bool HandleViewSource(GURL* url, BrowserContext* browser_context) {
|
| +static bool HandleViewSource(GURL* url,
|
| + content::BrowserContext* browser_context) {
|
| if (url->SchemeIs(chrome::kViewSourceScheme)) {
|
| // Load the inner URL instead.
|
| *url = GURL(url->path());
|
| @@ -47,7 +46,8 @@
|
| }
|
|
|
| // Turns a non view-source URL into the corresponding view-source URL.
|
| -bool ReverseViewSource(GURL* url, BrowserContext* browser_context) {
|
| +static bool ReverseViewSource(GURL* url,
|
| + content::BrowserContext* browser_context) {
|
| // No action necessary if the URL is already view-source:
|
| if (url->SchemeIs(chrome::kViewSourceScheme))
|
| return false;
|
| @@ -61,7 +61,8 @@
|
| return true;
|
| }
|
|
|
| -bool HandleDebugUrl(GURL* url, BrowserContext* browser_context) {
|
| +static bool HandleDebugUrl(GURL* url,
|
| + content::BrowserContext* browser_context) {
|
| // Circumvent processing URLs that the renderer process will handle.
|
| return *url == GURL(chrome::kChromeUICrashURL) ||
|
| *url == GURL(chrome::kChromeUIHangURL) ||
|
| @@ -69,8 +70,6 @@
|
| *url == GURL(chrome::kChromeUIShorthangURL);
|
| }
|
|
|
| -} // namespace
|
| -
|
| // static
|
| BrowserURLHandler* BrowserURLHandler::GetInstance() {
|
| return BrowserURLHandlerImpl::GetInstance();
|
| @@ -90,7 +89,7 @@
|
| BrowserURLHandlerImpl::BrowserURLHandlerImpl() {
|
| AddHandlerPair(&HandleDebugUrl, BrowserURLHandlerImpl::null_handler());
|
|
|
| - GetContentClient()->browser()->BrowserURLHandlerCreated(this);
|
| + content::GetContentClient()->browser()->BrowserURLHandlerCreated(this);
|
|
|
| // view-source:
|
| AddHandlerPair(&HandleViewSource, &ReverseViewSource);
|
| @@ -106,7 +105,7 @@
|
|
|
| void BrowserURLHandlerImpl::RewriteURLIfNecessary(
|
| GURL* url,
|
| - BrowserContext* browser_context,
|
| + content::BrowserContext* browser_context,
|
| bool* reverse_on_redirect) {
|
| for (size_t i = 0; i < url_handlers_.size(); ++i) {
|
| URLHandler handler = *url_handlers_[i].first;
|
| @@ -117,9 +116,8 @@
|
| }
|
| }
|
|
|
| -bool BrowserURLHandlerImpl::ReverseURLRewrite(GURL* url,
|
| - const GURL& original,
|
| - BrowserContext* browser_context) {
|
| +bool BrowserURLHandlerImpl::ReverseURLRewrite(
|
| + GURL* url, const GURL& original, content::BrowserContext* browser_context) {
|
| for (size_t i = 0; i < url_handlers_.size(); ++i) {
|
| URLHandler reverse_rewriter = *url_handlers_[i].second;
|
| if (reverse_rewriter) {
|
| @@ -135,5 +133,3 @@
|
| }
|
| return false;
|
| }
|
| -
|
| -} // namespace content
|
|
|