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

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

Issue 789353004: Host Chrome OS GAIA signin page in webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + switch to messages instead of listener interface Created 5 years, 11 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 | « chrome/browser/chromeos/login/startup_utils.h ('k') | chrome/browser/chromeos/login/ui/webui_login_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/startup_utils.cc
diff --git a/chrome/browser/chromeos/login/startup_utils.cc b/chrome/browser/chromeos/login/startup_utils.cc
index f47506994adce8e231b396d3def5d6497d88f925..4488a65f7089ee98dcd691dac8312accee9b480c 100644
--- a/chrome/browser/chromeos/login/startup_utils.cc
+++ b/chrome/browser/chromeos/login/startup_utils.cc
@@ -57,6 +57,7 @@ void StartupUtils::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kEnrollmentRecoveryRequired, false);
registry->RegisterStringPref(prefs::kInitialLocale, "en-US");
registry->RegisterBooleanPref(prefs::kNewOobe, false);
+ registry->RegisterBooleanPref(prefs::kWebviewSigninEnabled, false);
}
// static
@@ -175,6 +176,28 @@ std::string StartupUtils::GetInitialLocale() {
}
// static
+bool StartupUtils::IsWebviewSigninAllowed() {
+ return extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV;
+}
+
+// static
+bool StartupUtils::IsWebviewSigninEnabled() {
+ return IsWebviewSigninAllowed() &&
+ g_browser_process->local_state()->GetBoolean(
+ prefs::kWebviewSigninEnabled);
+}
+
+// static
+bool StartupUtils::EnableWebviewSignin(bool is_enabled) {
+ if (!IsWebviewSigninAllowed())
+ return false;
+
+ g_browser_process->local_state()->SetBoolean(prefs::kWebviewSigninEnabled,
+ is_enabled);
+ return true;
+}
+
+// static
void StartupUtils::SetInitialLocale(const std::string& locale) {
if (l10n_util::IsValidLocaleSyntax(locale))
SaveStringPreferenceForced(prefs::kInitialLocale, locale);
« no previous file with comments | « chrome/browser/chromeos/login/startup_utils.h ('k') | chrome/browser/chromeos/login/ui/webui_login_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698