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

Side by Side Diff: chrome/browser/renderer_host/transfer_navigation_resource_handler.cc

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer_host/transfer_navigation_resource_handler.h" 5 #include "chrome/browser/renderer_host/transfer_navigation_resource_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/profiles/profile_io_data.h" 8 #include "chrome/browser/profiles/profile_io_data.h"
9 #include "chrome/browser/extensions/extension_info_map.h" 9 #include "chrome/browser/extensions/extension_info_map.h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
11 #include "content/browser/renderer_host/render_view_host_delegate.h" 11 #include "content/browser/renderer_host/render_view_host_delegate.h"
12 #include "content/browser/renderer_host/resource_dispatcher_host.h" 12 #include "content/browser/renderer_host/resource_dispatcher_host.h"
13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 13 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
14 #include "content/public/common/referrer.h" 14 #include "content/public/common/referrer.h"
15 15
16 namespace { 16 namespace {
17 17
18 // This code is borrowed from ChromeContentRendererClient. We want to mimic 18 // This code is borrowed from ChromeContentRendererClient. We want to mimic
19 // the logic used by the renderer. 19 // the logic used by the renderer.
20 // TODO(mpcomplete): move to common and share with the renderer logic. 20 // TODO(mpcomplete): move to common and share with the renderer logic.
21 // http://crbug.com/79520 21 // http://crbug.com/79520
22 const Extension* GetNonBookmarkAppExtension( 22 const Extension* GetNonBookmarkAppExtension(
23 const ExtensionSet& extensions, const GURL& url) { 23 const ExtensionSet& extensions, const GURL& url) {
24 // Exclude bookmark apps, which do not use the app process model. 24 // Exclude bookmark apps, which do not use the app process model.
25 const Extension* extension = extensions.GetByURL(ExtensionURLInfo(url)); 25 const Extension* extension = extensions.GetExtensionOrAppByURL(
26 ExtensionURLInfo(url));
26 if (extension && extension->from_bookmark()) 27 if (extension && extension->from_bookmark())
27 extension = NULL; 28 extension = NULL;
28 return extension; 29 return extension;
29 } 30 }
30 31
31 bool CrossesExtensionExtents( 32 bool CrossesExtensionExtents(
32 const ExtensionSet& extensions, 33 const ExtensionSet& extensions,
33 const GURL& old_url, 34 const GURL& old_url,
34 const GURL& new_url) { 35 const GURL& new_url) {
35 const Extension* new_url_extension = GetNonBookmarkAppExtension(extensions, 36 const Extension* new_url_extension = GetNonBookmarkAppExtension(extensions,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 bool TransferNavigationResourceHandler::OnResponseCompleted( 165 bool TransferNavigationResourceHandler::OnResponseCompleted(
165 int request_id, 166 int request_id,
166 const net::URLRequestStatus& status, 167 const net::URLRequestStatus& status,
167 const std::string& security_info) { 168 const std::string& security_info) {
168 return next_handler_->OnResponseCompleted(request_id, status, security_info); 169 return next_handler_->OnResponseCompleted(request_id, status, security_info);
169 } 170 }
170 171
171 void TransferNavigationResourceHandler::OnRequestClosed() { 172 void TransferNavigationResourceHandler::OnRequestClosed() {
172 next_handler_->OnRequestClosed(); 173 next_handler_->OnRequestClosed();
173 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698