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

Unified Diff: chrome/browser/chromeos/login/helper.cc

Issue 1079083002: [cros New-GAIA] Webview login and new GAIA endpoint enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix saml test Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/hid_detection_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/helper.cc
diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc
index afe1bf41c12aceddfa83632945d7c3b89c4394fa..f949875e9bb9bc4ef2d9b36ad5f167fd175cfa21 100644
--- a/chrome/browser/chromeos/login/helper.cc
+++ b/chrome/browser/chromeos/login/helper.cc
@@ -153,8 +153,20 @@ content::StoragePartition* GetSigninPartition() {
}
net::URLRequestContextGetter* GetSigninContext() {
- if (StartupUtils::IsWebviewSigninEnabled())
- return GetSigninPartition()->GetURLRequestContext();
+ if (StartupUtils::IsWebviewSigninEnabled()) {
+ content::StoragePartition* signin_partition = GetSigninPartition();
+
+ // Special case for unit tests. There's no LoginDisplayHost thus no
+ // webview instance. TODO(nkostylev): Investigate if there's a better
+ // place to address this like dependency injection. http://crbug.com/477402
+ if (!signin_partition && !LoginDisplayHostImpl::default_host())
+ return ProfileHelper::GetSigninProfile()->GetRequestContext();
+
+ if (!signin_partition)
+ return nullptr;
+
+ return signin_partition->GetURLRequestContext();
+ }
return ProfileHelper::GetSigninProfile()->GetRequestContext();
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/hid_detection_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698