| 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 "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/extensions/extension_renderer_state.h" | 9 #include "chrome/browser/extensions/extension_renderer_state.h" |
| 10 #include "chrome/common/extensions/extension.h" | |
| 11 #include "chrome/common/extensions/extension_constants.h" | 10 #include "chrome/common/extensions/extension_constants.h" |
| 12 #include "chrome/common/extensions/permissions/permissions_data.h" | |
| 13 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 14 #include "content/public/browser/resource_request_info.h" | 12 #include "content/public/browser/resource_request_info.h" |
| 15 #include "extensions/browser/info_map.h" | 13 #include "extensions/browser/info_map.h" |
| 16 #include "extensions/common/constants.h" | 14 #include "extensions/common/constants.h" |
| 15 #include "extensions/common/extension.h" |
| 16 #include "extensions/common/permissions/permissions_data.h" |
| 17 #include "net/url_request/url_request.h" | 17 #include "net/url_request/url_request.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 using content::ResourceRequestInfo; | 20 using content::ResourceRequestInfo; |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Returns true if the URL is sensitive and requests to this URL must not be | 24 // Returns true if the URL is sensitive and requests to this URL must not be |
| 25 // modified/canceled by extensions, e.g. because it is targeted to the webstore | 25 // modified/canceled by extensions, e.g. because it is targeted to the webstore |
| 26 // to check for updates, extension blacklisting, etc. | 26 // to check for updates, extension blacklisting, etc. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 break; | 138 break; |
| 139 case REQUIRE_ALL_URLS: | 139 case REQUIRE_ALL_URLS: |
| 140 if (!extensions::PermissionsData::HasEffectiveAccessToAllHosts(extension)) | 140 if (!extensions::PermissionsData::HasEffectiveAccessToAllHosts(extension)) |
| 141 return false; | 141 return false; |
| 142 break; | 142 break; |
| 143 } | 143 } |
| 144 | 144 |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| OLD | NEW |