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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 | 705 |
706 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( | 706 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( |
707 content::BrowserContext* browser_context, | 707 content::BrowserContext* browser_context, |
708 const GURL& site) { | 708 const GURL& site) { |
709 std::string partition_id; | 709 std::string partition_id; |
710 | 710 |
711 // The partition ID for webview guest processes is the string value of its | 711 // The partition ID for webview guest processes is the string value of its |
712 // SiteInstance URL - "chrome-guest://app_id/persist?partition". | 712 // SiteInstance URL - "chrome-guest://app_id/persist?partition". |
713 if (site.SchemeIs(content::kGuestScheme)) { | 713 if (site.SchemeIs(content::kGuestScheme)) { |
714 partition_id = site.spec(); | 714 partition_id = site.spec(); |
715 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL) { | 715 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL && |
| 716 !switches::IsEnableWebviewBasedSignin()) { |
716 // Chrome signin page has an embedded iframe of extension and web content, | 717 // Chrome signin page has an embedded iframe of extension and web content, |
717 // thus it must be isolated from other webUI pages. | 718 // thus it must be isolated from other webUI pages. |
718 partition_id = site.GetOrigin().spec(); | 719 partition_id = site.GetOrigin().spec(); |
719 } | 720 } |
720 | 721 |
721 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 722 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
722 return partition_id; | 723 return partition_id; |
723 } | 724 } |
724 | 725 |
725 bool ChromeContentBrowserClient::IsValidStoragePartitionId( | 726 bool ChromeContentBrowserClient::IsValidStoragePartitionId( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // the |partition_domain|. The |in_memory| and |partition_name| are only | 770 // the |partition_domain|. The |in_memory| and |partition_name| are only |
770 // used in guest schemes so they are cleared here. | 771 // used in guest schemes so they are cleared here. |
771 *partition_domain = site.host(); | 772 *partition_domain = site.host(); |
772 *in_memory = false; | 773 *in_memory = false; |
773 partition_name->clear(); | 774 partition_name->clear(); |
774 } | 775 } |
775 success = true; | 776 success = true; |
776 } | 777 } |
777 #endif | 778 #endif |
778 | 779 |
779 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { | 780 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL) && |
| 781 !switches::IsEnableWebviewBasedSignin()) { |
780 // 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, |
781 // thus it must be isolated from other webUI pages. | 783 // thus it must be isolated from other webUI pages. |
782 *partition_domain = chrome::kChromeUIChromeSigninHost; | 784 *partition_domain = chrome::kChromeUIChromeSigninHost; |
783 } | 785 } |
784 | 786 |
785 // Assert that if |can_be_default| is false, the code above must have found a | 787 // Assert that if |can_be_default| is false, the code above must have found a |
786 // non-default partition. If this fails, the caller has a serious logic | 788 // non-default partition. If this fails, the caller has a serious logic |
787 // error about which StoragePartition they expect to be in and it is not | 789 // error about which StoragePartition they expect to be in and it is not |
788 // safe to continue. | 790 // safe to continue. |
789 CHECK(can_be_default || !partition_domain->empty()); | 791 CHECK(can_be_default || !partition_domain->empty()); |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2610 switches::kDisableWebRtcEncryption, | 2612 switches::kDisableWebRtcEncryption, |
2611 }; | 2613 }; |
2612 to_command_line->CopySwitchesFrom(from_command_line, | 2614 to_command_line->CopySwitchesFrom(from_command_line, |
2613 kWebRtcDevSwitchNames, | 2615 kWebRtcDevSwitchNames, |
2614 arraysize(kWebRtcDevSwitchNames)); | 2616 arraysize(kWebRtcDevSwitchNames)); |
2615 } | 2617 } |
2616 } | 2618 } |
2617 #endif // defined(ENABLE_WEBRTC) | 2619 #endif // defined(ENABLE_WEBRTC) |
2618 | 2620 |
2619 } // namespace chrome | 2621 } // namespace chrome |
OLD | NEW |