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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/hid_detection_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/chromeos/login/helper.h" 5 #include "chrome/browser/chromeos/login/helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/login/startup_utils.h" 10 #include "chrome/browser/chromeos/login/startup_utils.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 content::WebContents* embedder = GetLoginWebContents(); 146 content::WebContents* embedder = GetLoginWebContents();
147 if (!embedder) 147 if (!embedder)
148 return nullptr; 148 return nullptr;
149 149
150 // Note the partition name must match the sign-in webview used. For now, 150 // Note the partition name must match the sign-in webview used. For now,
151 // this is the default unnamed, shared, in-memory partition. 151 // this is the default unnamed, shared, in-memory partition.
152 return GetPartition(embedder, std::string()); 152 return GetPartition(embedder, std::string());
153 } 153 }
154 154
155 net::URLRequestContextGetter* GetSigninContext() { 155 net::URLRequestContextGetter* GetSigninContext() {
156 if (StartupUtils::IsWebviewSigninEnabled()) 156 if (StartupUtils::IsWebviewSigninEnabled()) {
157 return GetSigninPartition()->GetURLRequestContext(); 157 content::StoragePartition* signin_partition = GetSigninPartition();
158
159 // Special case for unit tests. There's no LoginDisplayHost thus no
160 // webview instance. TODO(nkostylev): Investigate if there's a better
161 // place to address this like dependency injection. http://crbug.com/477402
162 if (!signin_partition && !LoginDisplayHostImpl::default_host())
163 return ProfileHelper::GetSigninProfile()->GetRequestContext();
164
165 if (!signin_partition)
166 return nullptr;
167
168 return signin_partition->GetURLRequestContext();
169 }
158 170
159 return ProfileHelper::GetSigninProfile()->GetRequestContext(); 171 return ProfileHelper::GetSigninProfile()->GetRequestContext();
160 } 172 }
161 173
162 } // namespace login 174 } // namespace login
163 175
164 } // namespace chromeos 176 } // namespace chromeos
OLDNEW
« 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