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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/webui/chromeos/login/gaia_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 "stringEmptyEmail", 205 "stringEmptyEmail",
206 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL)); 206 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_EMAIL));
207 localized_strings->SetString( 207 localized_strings->SetString(
208 "stringEmptyPassword", 208 "stringEmptyPassword",
209 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD)); 209 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_EMPTY_PASSWORD));
210 localized_strings->SetString( 210 localized_strings->SetString(
211 "stringError", l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR)); 211 "stringError", l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_ERROR));
212 params.Set("localizedStrings", localized_strings); 212 params.Set("localizedStrings", localized_strings);
213 } 213 }
214 214
215 CommandLine* command_line = CommandLine::ForCurrentProcess(); 215 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
216 216
217 const GURL gaia_url = 217 const GURL gaia_url =
218 command_line->HasSwitch(::switches::kGaiaUrl) 218 command_line->HasSwitch(::switches::kGaiaUrl)
219 ? GURL(command_line->GetSwitchValueASCII(::switches::kGaiaUrl)) 219 ? GURL(command_line->GetSwitchValueASCII(::switches::kGaiaUrl))
220 : GaiaUrls::GetInstance()->gaia_url(); 220 : GaiaUrls::GetInstance()->gaia_url();
221 params.SetString("gaiaUrl", gaia_url.spec()); 221 params.SetString("gaiaUrl", gaia_url.spec());
222 222
223 if (context.embedded_signin_enabled) { 223 if (context.embedded_signin_enabled) {
224 params.SetBoolean("useEmbedded", true); 224 params.SetBoolean("useEmbedded", true);
225 // We set 'constrained' here to switch troubleshooting page on embedded 225 // We set 'constrained' here to switch troubleshooting page on embedded
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 password_changed_for_.count(populated_email_); 713 password_changed_for_.count(populated_email_);
714 context.use_offline = offline; 714 context.use_offline = offline;
715 context.email = populated_email_; 715 context.email = populated_email_;
716 context.is_enrolling_consumer_management = is_enrolling_consumer_management_; 716 context.is_enrolling_consumer_management = is_enrolling_consumer_management_;
717 if (Delegate()) { 717 if (Delegate()) {
718 context.show_users = Delegate()->IsShowUsers(); 718 context.show_users = Delegate()->IsShowUsers();
719 context.has_users = !Delegate()->GetUsers().empty(); 719 context.has_users = !Delegate()->GetUsers().empty();
720 } 720 }
721 721
722 context.embedded_signin_enabled = 722 context.embedded_signin_enabled =
723 CommandLine::ForCurrentProcess()->HasSwitch( 723 base::CommandLine::ForCurrentProcess()->HasSwitch(
724 chromeos::switches::kEnableEmbeddedSignin) || 724 chromeos::switches::kEnableEmbeddedSignin) ||
725 embedded_signin_enabled_by_shortcut_; 725 embedded_signin_enabled_by_shortcut_;
726 726
727 populated_email_.clear(); 727 populated_email_.clear();
728 728
729 LoadGaia(context); 729 LoadGaia(context);
730 } 730 }
731 731
732 void GaiaScreenHandler::UpdateState(ErrorScreenActor::ErrorReason reason) { 732 void GaiaScreenHandler::UpdateState(ErrorScreenActor::ErrorReason reason) {
733 if (signin_screen_handler_) 733 if (signin_screen_handler_)
734 signin_screen_handler_->UpdateState(reason); 734 signin_screen_handler_->UpdateState(reason);
735 } 735 }
736 736
737 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { 737 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() {
738 DCHECK(signin_screen_handler_); 738 DCHECK(signin_screen_handler_);
739 return signin_screen_handler_->delegate_; 739 return signin_screen_handler_->delegate_;
740 } 740 }
741 741
742 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { 742 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) {
743 signin_screen_handler_ = handler; 743 signin_screen_handler_ = handler;
744 } 744 }
745 } // namespace chromeos 745 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/demo_mode_detector.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698