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

Side by Side Diff: chrome/browser/extensions/extension_protocols.cc

Issue 6697012: Remove 'off the record' references from ChromeURLContext. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed 'off the record' references from ChromeURLRequestContext. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/chrome_url_request_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_protocols.h" 5 #include "chrome/browser/extensions/extension_protocols.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (!info) { 79 if (!info) {
80 LOG(ERROR) << "Allowing load of " << request->url().spec() 80 LOG(ERROR) << "Allowing load of " << request->url().spec()
81 << "from unknown origin. Could not find user data for " 81 << "from unknown origin. Could not find user data for "
82 << "request."; 82 << "request.";
83 return true; 83 return true;
84 } 84 }
85 85
86 // Don't allow toplevel navigations to extension resources in incognito mode. 86 // Don't allow toplevel navigations to extension resources in incognito mode.
87 // This is because an extension must run in a single process, and an 87 // This is because an extension must run in a single process, and an
88 // incognito tab prevents that. 88 // incognito tab prevents that.
89 if (context->is_off_the_record() && 89 if (context->is_incognito() &&
90 info->resource_type() == ResourceType::MAIN_FRAME && 90 info->resource_type() == ResourceType::MAIN_FRAME &&
91 !context->extension_info_map()-> 91 !context->extension_info_map()->
92 ExtensionCanLoadInIncognito(request->url().host())) { 92 ExtensionCanLoadInIncognito(request->url().host())) {
93 LOG(ERROR) << "Denying load of " << request->url().spec() << " from " 93 LOG(ERROR) << "Denying load of " << request->url().spec() << " from "
94 << "incognito tab."; 94 << "incognito tab.";
95 return false; 95 return false;
96 } 96 }
97 97
98 return true; 98 return true;
99 } 99 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 return new net::URLRequestFileJob(request, resource.GetFilePath()); 179 return new net::URLRequestFileJob(request, resource.GetFilePath());
180 } 180 }
181 181
182 void RegisterExtensionProtocols() { 182 void RegisterExtensionProtocols() {
183 net::URLRequest::RegisterProtocolFactory(chrome::kExtensionScheme, 183 net::URLRequest::RegisterProtocolFactory(chrome::kExtensionScheme,
184 &CreateExtensionURLRequestJob); 184 &CreateExtensionURLRequestJob);
185 net::URLRequest::RegisterProtocolFactory(chrome::kUserScriptScheme, 185 net::URLRequest::RegisterProtocolFactory(chrome::kUserScriptScheme,
186 &CreateUserScriptURLRequestJob); 186 &CreateUserScriptURLRequestJob);
187 } 187 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698