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

Unified Diff: content/browser/browser_url_handler.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: slight tweaking for comments Created 9 years, 5 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.h ('k') | content/browser/browser_url_handler_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.cc
diff --git a/content/browser/browser_url_handler.cc b/content/browser/browser_url_handler.cc
index e6e76a0095d7b6d5235d0bb22f680bd6919594a0..65c176c81c62e02277ffbc0eb6fecf97d2cd731c 100644
--- a/content/browser/browser_url_handler.cc
+++ b/content/browser/browser_url_handler.cc
@@ -11,7 +11,8 @@
#include "googleurl/src/gurl.h"
// Handles rewriting view-source URLs for what we'll actually load.
-static bool HandleViewSource(GURL* url, Profile* profile) {
+static bool HandleViewSource(GURL* url,
+ content::BrowserContext* browser_context) {
if (url->SchemeIs(chrome::kViewSourceScheme)) {
// Load the inner URL instead.
*url = GURL(url->path());
@@ -43,7 +44,8 @@ static bool HandleViewSource(GURL* url, Profile* profile) {
}
// Turns a non view-source URL into the corresponding view-source URL.
-static bool ReverseViewSource(GURL* url, Profile* profile) {
+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;
@@ -89,11 +91,13 @@ void BrowserURLHandler::AddHandlerPair(URLHandler handler,
url_handlers_.push_back(HandlerPair(handler, reverse_handler));
}
-void BrowserURLHandler::RewriteURLIfNecessary(GURL* url, Profile* profile,
- bool* reverse_on_redirect) {
+void BrowserURLHandler::RewriteURLIfNecessary(
+ GURL* url,
+ content::BrowserContext* browser_context,
+ bool* reverse_on_redirect) {
for (size_t i = 0; i < url_handlers_.size(); ++i) {
URLHandler handler = *url_handlers_[i].first;
- if (handler && handler(url, profile)) {
+ if (handler && handler(url, browser_context)) {
*reverse_on_redirect = (url_handlers_[i].second != NULL);
return;
}
@@ -101,17 +105,17 @@ void BrowserURLHandler::RewriteURLIfNecessary(GURL* url, Profile* profile,
}
bool BrowserURLHandler::ReverseURLRewrite(
- GURL* url, const GURL& original, Profile* profile) {
+ 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) {
GURL test_url(original);
URLHandler handler = *url_handlers_[i].first;
if (!handler) {
- if (reverse_rewriter(url, profile))
+ if (reverse_rewriter(url, browser_context))
return true;
- } else if (handler(&test_url, profile)) {
- return reverse_rewriter(url, profile);
+ } else if (handler(&test_url, browser_context)) {
+ return reverse_rewriter(url, browser_context);
}
}
}
« no previous file with comments | « content/browser/browser_url_handler.h ('k') | content/browser/browser_url_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698