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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 | 795 |
796 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( | 796 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( |
797 content::BrowserContext* browser_context, | 797 content::BrowserContext* browser_context, |
798 const GURL& site) { | 798 const GURL& site) { |
799 std::string partition_id; | 799 std::string partition_id; |
800 | 800 |
801 // The partition ID for webview guest processes is the string value of its | 801 // The partition ID for webview guest processes is the string value of its |
802 // SiteInstance URL - "chrome-guest://app_id/persist?partition". | 802 // SiteInstance URL - "chrome-guest://app_id/persist?partition". |
803 if (site.SchemeIs(content::kGuestScheme)) { | 803 if (site.SchemeIs(content::kGuestScheme)) { |
804 partition_id = site.spec(); | 804 partition_id = site.spec(); |
805 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL && | 805 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL) { |
806 !switches::IsEnableWebviewBasedSignin()) { | |
807 // Chrome signin page has an embedded iframe of extension and web content, | 806 // Chrome signin page has an embedded iframe of extension and web content, |
808 // thus it must be isolated from other webUI pages. | 807 // thus it must be isolated from other webUI pages. |
809 partition_id = site.GetOrigin().spec(); | 808 partition_id = site.GetOrigin().spec(); |
810 } | 809 } |
811 | 810 |
812 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 811 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
813 return partition_id; | 812 return partition_id; |
814 } | 813 } |
815 | 814 |
816 bool ChromeContentBrowserClient::IsValidStoragePartitionId( | 815 bool ChromeContentBrowserClient::IsValidStoragePartitionId( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 // the |partition_domain|. The |in_memory| and |partition_name| are only | 859 // the |partition_domain|. The |in_memory| and |partition_name| are only |
861 // used in guest schemes so they are cleared here. | 860 // used in guest schemes so they are cleared here. |
862 *partition_domain = site.host(); | 861 *partition_domain = site.host(); |
863 *in_memory = false; | 862 *in_memory = false; |
864 partition_name->clear(); | 863 partition_name->clear(); |
865 } | 864 } |
866 success = true; | 865 success = true; |
867 } | 866 } |
868 #endif | 867 #endif |
869 | 868 |
870 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL) && | 869 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { |
871 !switches::IsEnableWebviewBasedSignin()) { | |
872 // Chrome signin page has an embedded iframe of extension and web content, | 870 // Chrome signin page has an embedded iframe of extension and web content, |
873 // thus it must be isolated from other webUI pages. | 871 // thus it must be isolated from other webUI pages. |
874 *partition_domain = chrome::kChromeUIChromeSigninHost; | 872 *partition_domain = chrome::kChromeUIChromeSigninHost; |
875 } | 873 } |
876 | 874 |
877 // Assert that if |can_be_default| is false, the code above must have found a | 875 // Assert that if |can_be_default| is false, the code above must have found a |
878 // non-default partition. If this fails, the caller has a serious logic | 876 // non-default partition. If this fails, the caller has a serious logic |
879 // error about which StoragePartition they expect to be in and it is not | 877 // error about which StoragePartition they expect to be in and it is not |
880 // safe to continue. | 878 // safe to continue. |
881 CHECK(can_be_default || !partition_domain->empty()); | 879 CHECK(can_be_default || !partition_domain->empty()); |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 switches::kEnableBenchmarking, | 1457 switches::kEnableBenchmarking, |
1460 switches::kEnableNaCl, | 1458 switches::kEnableNaCl, |
1461 #if !defined(DISABLE_NACL) | 1459 #if !defined(DISABLE_NACL) |
1462 switches::kEnableNaClDebug, | 1460 switches::kEnableNaClDebug, |
1463 switches::kEnableNaClNonSfiMode, | 1461 switches::kEnableNaClNonSfiMode, |
1464 #endif | 1462 #endif |
1465 switches::kEnableNetBenchmarking, | 1463 switches::kEnableNetBenchmarking, |
1466 switches::kEnableOutOfProcessPdf, | 1464 switches::kEnableOutOfProcessPdf, |
1467 switches::kEnablePluginPlaceholderShadowDom, | 1465 switches::kEnablePluginPlaceholderShadowDom, |
1468 switches::kEnableShowModalDialog, | 1466 switches::kEnableShowModalDialog, |
1469 switches::kEnableWebBasedSignin, | |
1470 switches::kJavaScriptHarmony, | 1467 switches::kJavaScriptHarmony, |
1471 switches::kMessageLoopHistogrammer, | 1468 switches::kMessageLoopHistogrammer, |
1472 switches::kPlaybackMode, | 1469 switches::kPlaybackMode, |
1473 switches::kPpapiFlashArgs, | 1470 switches::kPpapiFlashArgs, |
1474 switches::kPpapiFlashPath, | 1471 switches::kPpapiFlashPath, |
1475 switches::kPpapiFlashVersion, | 1472 switches::kPpapiFlashVersion, |
1476 switches::kProfilingAtStart, | 1473 switches::kProfilingAtStart, |
1477 switches::kProfilingFile, | 1474 switches::kProfilingFile, |
1478 switches::kProfilingFlush, | 1475 switches::kProfilingFlush, |
1479 switches::kRecordMode, | 1476 switches::kRecordMode, |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 switches::kDisableWebRtcEncryption, | 2619 switches::kDisableWebRtcEncryption, |
2623 }; | 2620 }; |
2624 to_command_line->CopySwitchesFrom(from_command_line, | 2621 to_command_line->CopySwitchesFrom(from_command_line, |
2625 kWebRtcDevSwitchNames, | 2622 kWebRtcDevSwitchNames, |
2626 arraysize(kWebRtcDevSwitchNames)); | 2623 arraysize(kWebRtcDevSwitchNames)); |
2627 } | 2624 } |
2628 } | 2625 } |
2629 #endif // defined(ENABLE_WEBRTC) | 2626 #endif // defined(ENABLE_WEBRTC) |
2630 | 2627 |
2631 } // namespace chrome | 2628 } // namespace chrome |
OLD | NEW |