| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 771 |
| 772 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( | 772 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( |
| 773 content::BrowserContext* browser_context, | 773 content::BrowserContext* browser_context, |
| 774 const GURL& site) { | 774 const GURL& site) { |
| 775 std::string partition_id; | 775 std::string partition_id; |
| 776 | 776 |
| 777 // The partition ID for webview guest processes is the string value of its | 777 // The partition ID for webview guest processes is the string value of its |
| 778 // SiteInstance URL - "chrome-guest://app_id/persist?partition". | 778 // SiteInstance URL - "chrome-guest://app_id/persist?partition". |
| 779 if (site.SchemeIs(content::kGuestScheme)) { | 779 if (site.SchemeIs(content::kGuestScheme)) { |
| 780 partition_id = site.spec(); | 780 partition_id = site.spec(); |
| 781 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL && | 781 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL) { |
| 782 !switches::IsEnableWebviewBasedSignin()) { | |
| 783 // Chrome signin page has an embedded iframe of extension and web content, | 782 // Chrome signin page has an embedded iframe of extension and web content, |
| 784 // thus it must be isolated from other webUI pages. | 783 // thus it must be isolated from other webUI pages. |
| 785 partition_id = site.GetOrigin().spec(); | 784 partition_id = site.GetOrigin().spec(); |
| 786 } | 785 } |
| 787 | 786 |
| 788 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 787 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
| 789 return partition_id; | 788 return partition_id; |
| 790 } | 789 } |
| 791 | 790 |
| 792 bool ChromeContentBrowserClient::IsValidStoragePartitionId( | 791 bool ChromeContentBrowserClient::IsValidStoragePartitionId( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 // the |partition_domain|. The |in_memory| and |partition_name| are only | 835 // the |partition_domain|. The |in_memory| and |partition_name| are only |
| 837 // used in guest schemes so they are cleared here. | 836 // used in guest schemes so they are cleared here. |
| 838 *partition_domain = site.host(); | 837 *partition_domain = site.host(); |
| 839 *in_memory = false; | 838 *in_memory = false; |
| 840 partition_name->clear(); | 839 partition_name->clear(); |
| 841 } | 840 } |
| 842 success = true; | 841 success = true; |
| 843 } | 842 } |
| 844 #endif | 843 #endif |
| 845 | 844 |
| 846 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL) && | 845 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { |
| 847 !switches::IsEnableWebviewBasedSignin()) { | |
| 848 // Chrome signin page has an embedded iframe of extension and web content, | 846 // Chrome signin page has an embedded iframe of extension and web content, |
| 849 // thus it must be isolated from other webUI pages. | 847 // thus it must be isolated from other webUI pages. |
| 850 *partition_domain = chrome::kChromeUIChromeSigninHost; | 848 *partition_domain = chrome::kChromeUIChromeSigninHost; |
| 851 } | 849 } |
| 852 | 850 |
| 853 // Assert that if |can_be_default| is false, the code above must have found a | 851 // Assert that if |can_be_default| is false, the code above must have found a |
| 854 // non-default partition. If this fails, the caller has a serious logic | 852 // non-default partition. If this fails, the caller has a serious logic |
| 855 // error about which StoragePartition they expect to be in and it is not | 853 // error about which StoragePartition they expect to be in and it is not |
| 856 // safe to continue. | 854 // safe to continue. |
| 857 CHECK(can_be_default || !partition_domain->empty()); | 855 CHECK(can_be_default || !partition_domain->empty()); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 switches::kEnableNaCl, | 1433 switches::kEnableNaCl, |
| 1436 #if !defined(DISABLE_NACL) | 1434 #if !defined(DISABLE_NACL) |
| 1437 switches::kEnableNaClDebug, | 1435 switches::kEnableNaClDebug, |
| 1438 switches::kEnableNaClNonSfiMode, | 1436 switches::kEnableNaClNonSfiMode, |
| 1439 #endif | 1437 #endif |
| 1440 switches::kEnableNetBenchmarking, | 1438 switches::kEnableNetBenchmarking, |
| 1441 switches::kEnableNewBookmarkApps, | 1439 switches::kEnableNewBookmarkApps, |
| 1442 switches::kEnableOutOfProcessPdf, | 1440 switches::kEnableOutOfProcessPdf, |
| 1443 switches::kEnablePluginPlaceholderShadowDom, | 1441 switches::kEnablePluginPlaceholderShadowDom, |
| 1444 switches::kEnableShowModalDialog, | 1442 switches::kEnableShowModalDialog, |
| 1445 switches::kEnableWebBasedSignin, | |
| 1446 switches::kJavaScriptHarmony, | 1443 switches::kJavaScriptHarmony, |
| 1447 switches::kMessageLoopHistogrammer, | 1444 switches::kMessageLoopHistogrammer, |
| 1448 switches::kPlaybackMode, | 1445 switches::kPlaybackMode, |
| 1449 switches::kPpapiFlashArgs, | 1446 switches::kPpapiFlashArgs, |
| 1450 switches::kPpapiFlashPath, | 1447 switches::kPpapiFlashPath, |
| 1451 switches::kPpapiFlashVersion, | 1448 switches::kPpapiFlashVersion, |
| 1452 switches::kProfilingAtStart, | 1449 switches::kProfilingAtStart, |
| 1453 switches::kProfilingFile, | 1450 switches::kProfilingFile, |
| 1454 switches::kProfilingFlush, | 1451 switches::kProfilingFlush, |
| 1455 switches::kRecordMode, | 1452 switches::kRecordMode, |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 switches::kDisableWebRtcEncryption, | 2661 switches::kDisableWebRtcEncryption, |
| 2665 }; | 2662 }; |
| 2666 to_command_line->CopySwitchesFrom(from_command_line, | 2663 to_command_line->CopySwitchesFrom(from_command_line, |
| 2667 kWebRtcDevSwitchNames, | 2664 kWebRtcDevSwitchNames, |
| 2668 arraysize(kWebRtcDevSwitchNames)); | 2665 arraysize(kWebRtcDevSwitchNames)); |
| 2669 } | 2666 } |
| 2670 } | 2667 } |
| 2671 #endif // defined(ENABLE_WEBRTC) | 2668 #endif // defined(ENABLE_WEBRTC) |
| 2672 | 2669 |
| 2673 } // namespace chrome | 2670 } // namespace chrome |
| OLD | NEW |