| 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_api.h" | 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 if (it->filter.tab_id != -1 && tab_id != it->filter.tab_id) | 1281 if (it->filter.tab_id != -1 && tab_id != it->filter.tab_id) |
| 1282 continue; | 1282 continue; |
| 1283 if (it->filter.window_id != -1 && window_id != it->filter.window_id) | 1283 if (it->filter.window_id != -1 && window_id != it->filter.window_id) |
| 1284 continue; | 1284 continue; |
| 1285 if (!it->filter.types.empty() && | 1285 if (!it->filter.types.empty() && |
| 1286 std::find(it->filter.types.begin(), it->filter.types.end(), | 1286 std::find(it->filter.types.begin(), it->filter.types.end(), |
| 1287 resource_type) == it->filter.types.end()) | 1287 resource_type) == it->filter.types.end()) |
| 1288 continue; | 1288 continue; |
| 1289 | 1289 |
| 1290 if (!WebRequestPermissions::CanExtensionAccessURL( | 1290 if (!WebRequestPermissions::CanExtensionAccessURL( |
| 1291 extension_info_map, it->extension_id, url, crosses_incognito, true)) | 1291 extension_info_map, it->extension_id, url, crosses_incognito, |
| 1292 WebRequestPermissions::REQUIRE_HOST_PERMISSION)) |
| 1292 continue; | 1293 continue; |
| 1293 | 1294 |
| 1294 bool blocking_listener = | 1295 bool blocking_listener = |
| 1295 (it->extra_info_spec & | 1296 (it->extra_info_spec & |
| 1296 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) != 0; | 1297 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) != 0; |
| 1297 | 1298 |
| 1298 // We do not want to notify extensions about XHR requests that are | 1299 // We do not want to notify extensions about XHR requests that are |
| 1299 // triggered by themselves. This is a workaround to prevent deadlocks | 1300 // triggered by themselves. This is a workaround to prevent deadlocks |
| 1300 // in case of synchronous XHR requests that block the extension renderer | 1301 // in case of synchronous XHR requests that block the extension renderer |
| 1301 // and therefore prevent the extension from processing the request | 1302 // and therefore prevent the extension from processing the request |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2179 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 2179 adblock = true; | 2180 adblock = true; |
| 2180 } else { | 2181 } else { |
| 2181 other = true; | 2182 other = true; |
| 2182 } | 2183 } |
| 2183 } | 2184 } |
| 2184 } | 2185 } |
| 2185 | 2186 |
| 2186 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2187 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 2187 } | 2188 } |
| OLD | NEW |