Chromium Code Reviews| 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 678 chromeos::VpnServiceFactory::GetForBrowserContext(browser_context); | 678 chromeos::VpnServiceFactory::GetForBrowserContext(browser_context); |
| 679 if (!vpn_service) | 679 if (!vpn_service) |
| 680 return nullptr; | 680 return nullptr; |
| 681 return vpn_service->GetVpnServiceProxy(); | 681 return vpn_service->GetVpnServiceProxy(); |
| 682 #else | 682 #else |
| 683 return nullptr; | 683 return nullptr; |
| 684 #endif | 684 #endif |
| 685 } | 685 } |
| 686 | 686 |
| 687 // static | 687 // static |
| 688 bool ChromeContentBrowserClientExtensionsPart:: | |
| 689 ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation( | |
| 690 const GURL& subframe_url, | |
| 691 content::SiteInstance* parent_site_instance) { | |
| 692 const Extension* extension = | |
| 693 ExtensionRegistry::Get(parent_site_instance->GetBrowserContext()) | |
| 694 ->enabled_extensions() | |
| 695 .GetExtensionOrAppByURL(parent_site_instance->GetSiteURL()); | |
|
Devlin
2017/05/03 22:54:26
Why do we do this unequivocally, rather than check
Łukasz Anforowicz
2017/05/03 23:22:21
parent_site_instance->GetSiteURL() is an *effectiv
Charlie Reis
2017/05/03 23:37:36
Yeah, there's two aspects here:
1) For TDI, we're
Łukasz Anforowicz
2017/05/04 16:17:44
BTW: I should note that GetExtensionOrAppByURL is
Devlin
2017/05/04 17:20:45
Sorry that this was unclear. The call to GetExten
Łukasz Anforowicz
2017/05/04 18:58:19
Agreed - with this CL, hosted apps have *less* iso
| |
| 696 | |
| 697 return extension && extension->is_hosted_app(); | |
| 698 } | |
| 699 | |
| 700 // static | |
| 688 void ChromeContentBrowserClientExtensionsPart::RecordShouldAllowOpenURLFailure( | 701 void ChromeContentBrowserClientExtensionsPart::RecordShouldAllowOpenURLFailure( |
| 689 ShouldAllowOpenURLFailureReason reason, | 702 ShouldAllowOpenURLFailureReason reason, |
| 690 const GURL& site_url) { | 703 const GURL& site_url) { |
| 691 UMA_HISTOGRAM_ENUMERATION("Extensions.ShouldAllowOpenURL.Failure", reason, | 704 UMA_HISTOGRAM_ENUMERATION("Extensions.ShouldAllowOpenURL.Failure", reason, |
| 692 FAILURE_LAST); | 705 FAILURE_LAST); |
| 693 | 706 |
| 694 // Must be kept in sync with the ShouldAllowOpenURLFailureScheme enum. | 707 // Must be kept in sync with the ShouldAllowOpenURLFailureScheme enum. |
| 695 static const char* const kSchemeNames[] = { | 708 static const char* const kSchemeNames[] = { |
| 696 "unknown", | 709 "unknown", |
| 697 "", | 710 "", |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 871 command_line->AppendSwitch(switches::kExtensionProcess); | 884 command_line->AppendSwitch(switches::kExtensionProcess); |
| 872 } | 885 } |
| 873 } | 886 } |
| 874 | 887 |
| 875 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { | 888 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { |
| 876 content::ResourceDispatcherHost::Get()->RegisterInterceptor( | 889 content::ResourceDispatcherHost::Get()->RegisterInterceptor( |
| 877 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); | 890 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); |
| 878 } | 891 } |
| 879 | 892 |
| 880 } // namespace extensions | 893 } // namespace extensions |
| OLD | NEW |