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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
811 | 811 |
812 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( | 812 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( |
813 content::BrowserContext* browser_context, | 813 content::BrowserContext* browser_context, |
814 const GURL& site) { | 814 const GURL& site) { |
815 std::string partition_id; | 815 std::string partition_id; |
816 | 816 |
817 // The partition ID for webview guest processes is the string value of its | 817 // The partition ID for webview guest processes is the string value of its |
818 // SiteInstance URL - "chrome-guest://app_id/persist?partition". | 818 // SiteInstance URL - "chrome-guest://app_id/persist?partition". |
819 if (site.SchemeIs(content::kGuestScheme)) { | 819 if (site.SchemeIs(content::kGuestScheme)) { |
820 partition_id = site.spec(); | 820 partition_id = site.spec(); |
821 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL) { | 821 } else if (!switches::IsEnableWebviewBasedSignin() && |
822 // Chrome signin page has an embedded iframe of extension and web content, | 822 site.GetOrigin().spec() == kChromeUIChromeSigninURL) { |
823 // thus it must be isolated from other webUI pages. | 823 // The non-webview Chrome signin page has an embedded iframe of extension |
824 // and web content, thus it must be isolated from other webUI pages. | |
824 partition_id = site.GetOrigin().spec(); | 825 partition_id = site.GetOrigin().spec(); |
825 } | 826 } |
826 | 827 |
827 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 828 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
828 return partition_id; | 829 return partition_id; |
829 } | 830 } |
830 | 831 |
831 bool ChromeContentBrowserClient::IsValidStoragePartitionId( | 832 bool ChromeContentBrowserClient::IsValidStoragePartitionId( |
832 content::BrowserContext* browser_context, | 833 content::BrowserContext* browser_context, |
833 const std::string& partition_id) { | 834 const std::string& partition_id) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
875 // the |partition_domain|. The |in_memory| and |partition_name| are only | 876 // the |partition_domain|. The |in_memory| and |partition_name| are only |
876 // used in guest schemes so they are cleared here. | 877 // used in guest schemes so they are cleared here. |
877 *partition_domain = site.host(); | 878 *partition_domain = site.host(); |
878 *in_memory = false; | 879 *in_memory = false; |
879 partition_name->clear(); | 880 partition_name->clear(); |
880 } | 881 } |
881 success = true; | 882 success = true; |
882 } | 883 } |
883 #endif | 884 #endif |
884 | 885 |
885 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { | 886 if (!success && (!switches::IsEnableWebviewBasedSignin() && |
887 site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { | |
886 // Chrome signin page has an embedded iframe of extension and web content, | 888 // Chrome signin page has an embedded iframe of extension and web content, |
Charlie Reis
2015/03/11 20:23:10
Please update this comment as well.
wjmaclean
2015/03/23 15:31:52
Done.
| |
887 // thus it must be isolated from other webUI pages. | 889 // thus it must be isolated from other webUI pages. |
888 *partition_domain = chrome::kChromeUIChromeSigninHost; | 890 *partition_domain = chrome::kChromeUIChromeSigninHost; |
889 } | 891 } |
890 | 892 |
891 // Assert that if |can_be_default| is false, the code above must have found a | 893 // Assert that if |can_be_default| is false, the code above must have found a |
892 // non-default partition. If this fails, the caller has a serious logic | 894 // non-default partition. If this fails, the caller has a serious logic |
893 // error about which StoragePartition they expect to be in and it is not | 895 // error about which StoragePartition they expect to be in and it is not |
894 // safe to continue. | 896 // safe to continue. |
895 CHECK(can_be_default || !partition_domain->empty()); | 897 CHECK(can_be_default || !partition_domain->empty()); |
896 } | 898 } |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2641 switches::kDisableWebRtcEncryption, | 2643 switches::kDisableWebRtcEncryption, |
2642 }; | 2644 }; |
2643 to_command_line->CopySwitchesFrom(from_command_line, | 2645 to_command_line->CopySwitchesFrom(from_command_line, |
2644 kWebRtcDevSwitchNames, | 2646 kWebRtcDevSwitchNames, |
2645 arraysize(kWebRtcDevSwitchNames)); | 2647 arraysize(kWebRtcDevSwitchNames)); |
2646 } | 2648 } |
2647 } | 2649 } |
2648 #endif // defined(ENABLE_WEBRTC) | 2650 #endif // defined(ENABLE_WEBRTC) |
2649 | 2651 |
2650 } // namespace chrome | 2652 } // namespace chrome |
OLD | NEW |