| 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/declarative_webrequest/webrequest_action
.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action
.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 WebRequestAction::~WebRequestAction() {} | 334 WebRequestAction::~WebRequestAction() {} |
| 335 | 335 |
| 336 int WebRequestAction::GetMinimumPriority() const { | 336 int WebRequestAction::GetMinimumPriority() const { |
| 337 return std::numeric_limits<int>::min(); | 337 return std::numeric_limits<int>::min(); |
| 338 } | 338 } |
| 339 | 339 |
| 340 bool WebRequestAction::HasPermission(const ExtensionInfoMap* extension_info_map, | 340 bool WebRequestAction::HasPermission(const ExtensionInfoMap* extension_info_map, |
| 341 const std::string& extension_id, | 341 const std::string& extension_id, |
| 342 const net::URLRequest* request, | 342 const net::URLRequest* request, |
| 343 bool crosses_incognito) const { | 343 bool crosses_incognito) const { |
| 344 if (WebRequestPermissions::HideRequest(request)) | 344 if (WebRequestPermissions::HideRequest(extension_info_map, request)) |
| 345 return false; | 345 return false; |
| 346 | 346 |
| 347 // In unit tests we don't have an extension_info_map object here and skip host | 347 // In unit tests we don't have an extension_info_map object here and skip host |
| 348 // permission checks. | 348 // permission checks. |
| 349 if (!extension_info_map) | 349 if (!extension_info_map) |
| 350 return true; | 350 return true; |
| 351 | 351 |
| 352 return WebRequestPermissions::CanExtensionAccessURL( | 352 return WebRequestPermissions::CanExtensionAccessURL( |
| 353 extension_info_map, extension_id, request->url(), crosses_incognito, | 353 extension_info_map, extension_id, request->url(), crosses_incognito, |
| 354 ShouldEnforceHostPermissions()); | 354 ShouldEnforceHostPermissions()); |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 CHECK(request_data.stage & GetStages()); | 937 CHECK(request_data.stage & GetStages()); |
| 938 LinkedPtrEventResponseDelta result( | 938 LinkedPtrEventResponseDelta result( |
| 939 new extension_web_request_api_helpers::EventResponseDelta( | 939 new extension_web_request_api_helpers::EventResponseDelta( |
| 940 extension_id, extension_install_time)); | 940 extension_id, extension_install_time)); |
| 941 result->response_cookie_modifications.push_back( | 941 result->response_cookie_modifications.push_back( |
| 942 response_cookie_modification_); | 942 response_cookie_modification_); |
| 943 return result; | 943 return result; |
| 944 } | 944 } |
| 945 | 945 |
| 946 } // namespace extensions | 946 } // namespace extensions |
| OLD | NEW |