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

Side by Side Diff: chrome/browser/chromeos/login/helper.cc

Issue 1866813002: Remove StartupUtils::IsWebviewSigninEnabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 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
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/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/chromeos/login/startup_utils.h"
13 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 12 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
14 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
15 #include "chrome/browser/chromeos/profiles/profile_helper.h" 14 #include "chrome/browser/chromeos/profiles/profile_helper.h"
16 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
17 #include "chromeos/chromeos_switches.h" 16 #include "chromeos/chromeos_switches.h"
18 #include "chromeos/network/managed_network_configuration_handler.h" 17 #include "chromeos/network/managed_network_configuration_handler.h"
19 #include "chromeos/network/network_connection_handler.h" 18 #include "chromeos/network/network_connection_handler.h"
20 #include "chromeos/network/network_handler.h" 19 #include "chromeos/network/network_handler.h"
21 #include "chromeos/network/network_state.h" 20 #include "chromeos/network/network_state.h"
22 #include "chromeos/network/network_state_handler.h" 21 #include "chromeos/network/network_state_handler.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 content::WebContents* embedder = GetLoginWebContents(); 221 content::WebContents* embedder = GetLoginWebContents();
223 if (!embedder) 222 if (!embedder)
224 return nullptr; 223 return nullptr;
225 224
226 // Note the partition name must match the sign-in webview used. For now, 225 // Note the partition name must match the sign-in webview used. For now,
227 // this is the default unnamed, shared, in-memory partition. 226 // this is the default unnamed, shared, in-memory partition.
228 return GetPartition(embedder, std::string()); 227 return GetPartition(embedder, std::string());
229 } 228 }
230 229
231 net::URLRequestContextGetter* GetSigninContext() { 230 net::URLRequestContextGetter* GetSigninContext() {
232 if (StartupUtils::IsWebviewSigninEnabled()) { 231 content::StoragePartition* signin_partition = GetSigninPartition();
233 content::StoragePartition* signin_partition = GetSigninPartition();
234 232
235 // Special case for unit tests. There's no LoginDisplayHost thus no 233 // Special case for unit tests. There's no LoginDisplayHost thus no
236 // webview instance. TODO(nkostylev): Investigate if there's a better 234 // webview instance. TODO(nkostylev): Investigate if there's a better
achuithb 2016/04/07 18:39:48 Replace nkostylev with dzhioev
jdufault 2016/12/07 00:27:55 Hmm, any idea on a better owner now? I can assign
achuithb 2016/12/07 00:37:09 Let's just get rid of the TODO. I don't think anyo
237 // place to address this like dependency injection. http://crbug.com/477402 235 // place to address this like dependency injection. http://crbug.com/477402
238 if (!signin_partition && !LoginDisplayHost::default_host()) 236 if (!signin_partition && !LoginDisplayHost::default_host())
239 return ProfileHelper::GetSigninProfile()->GetRequestContext(); 237 return ProfileHelper::GetSigninProfile()->GetRequestContext();
240 238
241 if (!signin_partition) 239 if (!signin_partition)
242 return nullptr; 240 return nullptr;
243 241
244 return signin_partition->GetURLRequestContext(); 242 return signin_partition->GetURLRequestContext();
245 }
246
247 return ProfileHelper::GetSigninProfile()->GetRequestContext();
248 } 243 }
249 244
250 } // namespace login 245 } // namespace login
251 246
252 } // namespace chromeos 247 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698