OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_protocols.h" | 5 #include "extensions/browser/extension_protocols.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // check, since the renderer can lie about which extension has made the | 362 // check, since the renderer can lie about which extension has made the |
363 // request. | 363 // request. |
364 if (extension_info_map->process_map().Contains( | 364 if (extension_info_map->process_map().Contains( |
365 request->url().host(), info->GetChildID())) { | 365 request->url().host(), info->GetChildID())) { |
366 return true; | 366 return true; |
367 } | 367 } |
368 | 368 |
369 // PlzNavigate: frame navigations to extensions have already been checked in | 369 // PlzNavigate: frame navigations to extensions have already been checked in |
370 // the ExtensionNavigationThrottle. | 370 // the ExtensionNavigationThrottle. |
371 if (info->GetChildID() == -1 && | 371 if (info->GetChildID() == -1 && |
372 content::IsResourceTypeFrame(info->GetResourceType()) && | 372 info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME && |
373 content::IsBrowserSideNavigationEnabled()) { | 373 content::IsBrowserSideNavigationEnabled()) { |
374 return true; | 374 return true; |
375 } | 375 } |
376 | 376 |
377 // Allow the extension module embedder to grant permission for loads. | 377 // Allow the extension module embedder to grant permission for loads. |
378 if (ExtensionsBrowserClient::Get()->AllowCrossRendererResourceLoad( | 378 if (ExtensionsBrowserClient::Get()->AllowCrossRendererResourceLoad( |
379 request, is_incognito, extension, extension_info_map)) { | 379 request, is_incognito, extension, extension_info_map)) { |
380 return true; | 380 return true; |
381 } | 381 } |
382 | 382 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 } | 583 } |
584 | 584 |
585 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> | 585 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> |
586 CreateExtensionProtocolHandler(bool is_incognito, | 586 CreateExtensionProtocolHandler(bool is_incognito, |
587 extensions::InfoMap* extension_info_map) { | 587 extensions::InfoMap* extension_info_map) { |
588 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, | 588 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, |
589 extension_info_map); | 589 extension_info_map); |
590 } | 590 } |
591 | 591 |
592 } // namespace extensions | 592 } // namespace extensions |
OLD | NEW |