Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: content/browser/browser_url_handler_impl.cc

Issue 9688019: Add a Content API around BrowserURLHandler. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix gypis Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/browser_url_handler_impl.h ('k') | content/browser/browser_url_handler_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/browser_url_handler_impl.h ('k') | content/browser/browser_url_handler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698