| Index: content/browser/browser_url_handler_impl.cc
|
| ===================================================================
|
| --- content/browser/browser_url_handler_impl.cc (revision 126145)
|
| +++ content/browser/browser_url_handler_impl.cc (working copy)
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/browser/browser_url_handler.h"
|
| +#include "content/browser/browser_url_handler_impl.h"
|
|
|
| #include "base/string_util.h"
|
| #include "content/browser/webui/web_ui_impl.h"
|
| @@ -10,6 +10,8 @@
|
| #include "content/public/common/url_constants.h"
|
| #include "googleurl/src/gurl.h"
|
|
|
| +using content::BrowserURLHandler;
|
| +
|
| // Handles rewriting view-source URLs for what we'll actually load.
|
| static bool HandleViewSource(GURL* url,
|
| content::BrowserContext* browser_context) {
|
| @@ -70,7 +72,7 @@
|
|
|
| // static
|
| BrowserURLHandler* BrowserURLHandler::GetInstance() {
|
| - return Singleton<BrowserURLHandler>::get();
|
| + return BrowserURLHandlerImpl::GetInstance();
|
| }
|
|
|
| // static
|
| @@ -79,24 +81,29 @@
|
| return NULL;
|
| }
|
|
|
| -BrowserURLHandler::BrowserURLHandler() {
|
| - AddHandlerPair(&HandleDebugUrl, BrowserURLHandler::null_handler());
|
| +// static
|
| +BrowserURLHandlerImpl* BrowserURLHandlerImpl::GetInstance() {
|
| + return Singleton<BrowserURLHandlerImpl>::get();
|
| +}
|
|
|
| +BrowserURLHandlerImpl::BrowserURLHandlerImpl() {
|
| + AddHandlerPair(&HandleDebugUrl, BrowserURLHandlerImpl::null_handler());
|
| +
|
| content::GetContentClient()->browser()->BrowserURLHandlerCreated(this);
|
|
|
| // view-source:
|
| AddHandlerPair(&HandleViewSource, &ReverseViewSource);
|
| }
|
|
|
| -BrowserURLHandler::~BrowserURLHandler() {
|
| +BrowserURLHandlerImpl::~BrowserURLHandlerImpl() {
|
| }
|
|
|
| -void BrowserURLHandler::AddHandlerPair(URLHandler handler,
|
| - URLHandler reverse_handler) {
|
| +void BrowserURLHandlerImpl::AddHandlerPair(URLHandler handler,
|
| + URLHandler reverse_handler) {
|
| url_handlers_.push_back(HandlerPair(handler, reverse_handler));
|
| }
|
|
|
| -void BrowserURLHandler::RewriteURLIfNecessary(
|
| +void BrowserURLHandlerImpl::RewriteURLIfNecessary(
|
| GURL* url,
|
| content::BrowserContext* browser_context,
|
| bool* reverse_on_redirect) {
|
| @@ -109,7 +116,7 @@
|
| }
|
| }
|
|
|
| -bool BrowserURLHandler::ReverseURLRewrite(
|
| +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;
|
|
|