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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_permissions.cc

Issue 464533002: Move guest_view to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes are made in guest_view_manager_unittest.cc Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/web_request/web_request_permissions.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_permissions.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h" 9 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h"
10 #include "chrome/common/extensions/extension_constants.h" 10 #include "chrome/common/extensions/extension_constants.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // static 80 // static
81 bool WebRequestPermissions::HideRequest( 81 bool WebRequestPermissions::HideRequest(
82 const extensions::InfoMap* extension_info_map, 82 const extensions::InfoMap* extension_info_map,
83 const net::URLRequest* request) { 83 const net::URLRequest* request) {
84 // Hide requests from the Chrome WebStore App or signin process. 84 // Hide requests from the Chrome WebStore App or signin process.
85 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 85 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
86 if (info) { 86 if (info) {
87 int process_id = info->GetChildID(); 87 int process_id = info->GetChildID();
88 // Never hide requests from guest processes. 88 // Never hide requests from guest processes.
89 if (WebViewRendererState::GetInstance()->IsGuest(process_id)) 89 if (extensions::WebViewRendererState::GetInstance()->IsGuest(process_id))
90 return false; 90 return false;
91 91
92 if (extension_info_map && ( 92 if (extension_info_map && (
93 extension_info_map->IsSigninProcess(process_id) || 93 extension_info_map->IsSigninProcess(process_id) ||
94 extension_info_map->process_map().Contains( 94 extension_info_map->process_map().Contains(
95 extension_misc::kWebStoreAppId, process_id))) { 95 extension_misc::kWebStoreAppId, process_id))) {
96 return true; 96 return true;
97 } 97 }
98 } 98 }
99 99
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 break; 135 break;
136 case REQUIRE_ALL_URLS: 136 case REQUIRE_ALL_URLS:
137 if (!extension->permissions_data()->HasEffectiveAccessToAllHosts()) 137 if (!extension->permissions_data()->HasEffectiveAccessToAllHosts())
138 return false; 138 return false;
139 break; 139 break;
140 } 140 }
141 141
142 return true; 142 return true;
143 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698