OLD | NEW |
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 "extensions/browser/api/web_request/web_request_permissions.h" | 5 #include "extensions/browser/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 "content/public/browser/resource_request_info.h" | 9 #include "content/public/browser/resource_request_info.h" |
10 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 10 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const extensions::InfoMap* extension_info_map, | 81 const extensions::InfoMap* extension_info_map, |
82 const net::URLRequest* request) { | 82 const net::URLRequest* request) { |
83 // Hide requests from the Chrome WebStore App or signin process. | 83 // Hide requests from the Chrome WebStore App or signin process. |
84 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 84 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
85 if (info) { | 85 if (info) { |
86 int process_id = info->GetChildID(); | 86 int process_id = info->GetChildID(); |
87 // Never hide requests from guest processes. | 87 // Never hide requests from guest processes. |
88 if (extensions::WebViewRendererState::GetInstance()->IsGuest(process_id)) | 88 if (extensions::WebViewRendererState::GetInstance()->IsGuest(process_id)) |
89 return false; | 89 return false; |
90 | 90 |
91 if (extension_info_map && ( | 91 if (extension_info_map && |
92 extension_info_map->IsSigninProcess(process_id) || | 92 extension_info_map->process_map().Contains(extensions::kWebStoreAppId, |
93 extension_info_map->process_map().Contains( | 93 process_id)) { |
94 extensions::kWebStoreAppId, process_id))) { | |
95 return true; | 94 return true; |
96 } | 95 } |
97 } | 96 } |
98 | 97 |
99 const GURL& url = request->url(); | 98 const GURL& url = request->url(); |
100 return IsSensitiveURL(url) || !HasWebRequestScheme(url); | 99 return IsSensitiveURL(url) || !HasWebRequestScheme(url); |
101 } | 100 } |
102 | 101 |
103 // static | 102 // static |
104 bool WebRequestPermissions::CanExtensionAccessURL( | 103 bool WebRequestPermissions::CanExtensionAccessURL( |
(...skipping 28 matching lines...) Expand all Loading... |
133 } | 132 } |
134 break; | 133 break; |
135 case REQUIRE_ALL_URLS: | 134 case REQUIRE_ALL_URLS: |
136 if (!extension->permissions_data()->HasEffectiveAccessToAllHosts()) | 135 if (!extension->permissions_data()->HasEffectiveAccessToAllHosts()) |
137 return false; | 136 return false; |
138 break; | 137 break; |
139 } | 138 } |
140 | 139 |
141 return true; | 140 return true; |
142 } | 141 } |
OLD | NEW |