Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 996743003: Webview-based signin shouldn't create a partition for the embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments, re-enable test on ChromeOS. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/host_zoom_map_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite( 789 std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite(
790 content::BrowserContext* browser_context, 790 content::BrowserContext* browser_context,
791 const GURL& site) { 791 const GURL& site) {
792 std::string partition_id; 792 std::string partition_id;
793 793
794 // The partition ID for webview guest processes is the string value of its 794 // The partition ID for webview guest processes is the string value of its
795 // SiteInstance URL - "chrome-guest://app_id/persist?partition". 795 // SiteInstance URL - "chrome-guest://app_id/persist?partition".
796 if (site.SchemeIs(content::kGuestScheme)) { 796 if (site.SchemeIs(content::kGuestScheme)) {
797 partition_id = site.spec(); 797 partition_id = site.spec();
798 } else if (site.GetOrigin().spec() == kChromeUIChromeSigninURL) { 798 } else if (!switches::IsEnableWebviewBasedSignin() &&
799 // Chrome signin page has an embedded iframe of extension and web content, 799 site.GetOrigin().spec() == kChromeUIChromeSigninURL) {
800 // thus it must be isolated from other webUI pages. 800 // The non-webview Chrome signin page has an embedded iframe of extension
801 // and web content, thus it must be isolated from other webUI pages.
801 partition_id = site.GetOrigin().spec(); 802 partition_id = site.GetOrigin().spec();
802 } 803 }
803 804
804 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); 805 DCHECK(IsValidStoragePartitionId(browser_context, partition_id));
805 return partition_id; 806 return partition_id;
806 } 807 }
807 808
808 bool ChromeContentBrowserClient::IsValidStoragePartitionId( 809 bool ChromeContentBrowserClient::IsValidStoragePartitionId(
809 content::BrowserContext* browser_context, 810 content::BrowserContext* browser_context,
810 const std::string& partition_id) { 811 const std::string& partition_id) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 // the |partition_domain|. The |in_memory| and |partition_name| are only 853 // the |partition_domain|. The |in_memory| and |partition_name| are only
853 // used in guest schemes so they are cleared here. 854 // used in guest schemes so they are cleared here.
854 *partition_domain = site.host(); 855 *partition_domain = site.host();
855 *in_memory = false; 856 *in_memory = false;
856 partition_name->clear(); 857 partition_name->clear();
857 } 858 }
858 success = true; 859 success = true;
859 } 860 }
860 #endif 861 #endif
861 862
862 if (!success && (site.GetOrigin().spec() == kChromeUIChromeSigninURL)) { 863 if (!success && (!switches::IsEnableWebviewBasedSignin() &&
863 // Chrome signin page has an embedded iframe of extension and web content, 864 site.GetOrigin().spec() == kChromeUIChromeSigninURL)) {
864 // thus it must be isolated from other webUI pages. 865 // The non-webview Chrome signin page has an embedded iframe of extension
866 // and web content, thus it must be isolated from other webUI pages.
865 *partition_domain = chrome::kChromeUIChromeSigninHost; 867 *partition_domain = chrome::kChromeUIChromeSigninHost;
866 } 868 }
867 869
868 // Assert that if |can_be_default| is false, the code above must have found a 870 // Assert that if |can_be_default| is false, the code above must have found a
869 // non-default partition. If this fails, the caller has a serious logic 871 // non-default partition. If this fails, the caller has a serious logic
870 // error about which StoragePartition they expect to be in and it is not 872 // error about which StoragePartition they expect to be in and it is not
871 // safe to continue. 873 // safe to continue.
872 CHECK(can_be_default || !partition_domain->empty()); 874 CHECK(can_be_default || !partition_domain->empty());
873 } 875 }
874 876
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 switches::kDisableWebRtcEncryption, 2575 switches::kDisableWebRtcEncryption,
2574 }; 2576 };
2575 to_command_line->CopySwitchesFrom(from_command_line, 2577 to_command_line->CopySwitchesFrom(from_command_line,
2576 kWebRtcDevSwitchNames, 2578 kWebRtcDevSwitchNames,
2577 arraysize(kWebRtcDevSwitchNames)); 2579 arraysize(kWebRtcDevSwitchNames));
2578 } 2580 }
2579 } 2581 }
2580 #endif // defined(ENABLE_WEBRTC) 2582 #endif // defined(ENABLE_WEBRTC)
2581 2583
2582 } // namespace chrome 2584 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/host_zoom_map_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698