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_api.h" | 5 #include "extensions/browser/api/web_request/web_request_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 if (!types.empty() && | 1491 if (!types.empty() && |
1492 std::find(types.begin(), types.end(), resource_type) == types.end()) { | 1492 std::find(types.begin(), types.end(), resource_type) == types.end()) { |
1493 continue; | 1493 continue; |
1494 } | 1494 } |
1495 | 1495 |
1496 if (!is_web_view_guest) { | 1496 if (!is_web_view_guest) { |
1497 PermissionsData::AccessType access = | 1497 PermissionsData::AccessType access = |
1498 WebRequestPermissions::CanExtensionAccessURL( | 1498 WebRequestPermissions::CanExtensionAccessURL( |
1499 extension_info_map, listener->id.extension_id, url, | 1499 extension_info_map, listener->id.extension_id, url, |
1500 frame_data.tab_id, crosses_incognito, | 1500 frame_data.tab_id, crosses_incognito, |
1501 WebRequestPermissions::REQUIRE_HOST_PERMISSION); | 1501 WebRequestPermissions::REQUIRE_HOST_PERMISSION, |
| 1502 request->initiator()); |
| 1503 |
1502 if (access != PermissionsData::ACCESS_ALLOWED) { | 1504 if (access != PermissionsData::ACCESS_ALLOWED) { |
1503 if (access == PermissionsData::ACCESS_WITHHELD && | 1505 if (access == PermissionsData::ACCESS_WITHHELD && |
1504 web_request_event_router_delegate_) { | 1506 web_request_event_router_delegate_) { |
1505 web_request_event_router_delegate_->NotifyWebRequestWithheld( | 1507 web_request_event_router_delegate_->NotifyWebRequestWithheld( |
1506 render_process_id, render_frame_id, listener->id.extension_id); | 1508 render_process_id, render_frame_id, listener->id.extension_id); |
1507 } | 1509 } |
1508 continue; | 1510 continue; |
1509 } | 1511 } |
1510 } | 1512 } |
1511 | 1513 |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2444 // Since EventListeners are segmented by browser_context, check that | 2446 // Since EventListeners are segmented by browser_context, check that |
2445 // last, as it is exceedingly unlikely to be different. | 2447 // last, as it is exceedingly unlikely to be different. |
2446 return extension_id == that.extension_id && | 2448 return extension_id == that.extension_id && |
2447 sub_event_name == that.sub_event_name && | 2449 sub_event_name == that.sub_event_name && |
2448 web_view_instance_id == that.web_view_instance_id && | 2450 web_view_instance_id == that.web_view_instance_id && |
2449 embedder_process_id == that.embedder_process_id && | 2451 embedder_process_id == that.embedder_process_id && |
2450 browser_context == that.browser_context; | 2452 browser_context == that.browser_context; |
2451 } | 2453 } |
2452 | 2454 |
2453 } // namespace extensions | 2455 } // namespace extensions |
OLD | NEW |