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

Unified Diff: chrome/browser/chromeos/login/startup_utils.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
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 1a0d47f4220048e79316c71c812a479367ca2571..c136ea3f2a242f2b4e942a436a754cd0c5d66c40 100644
--- a/chrome/browser/chromeos/login/startup_utils.cc
+++ b/chrome/browser/chromeos/login/startup_utils.cc
@@ -13,6 +13,7 @@
#include "base/sys_info.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/features/feature_channel.h"
#include "chrome/common/pref_names.h"
@@ -59,7 +60,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);
+ registry->RegisterBooleanPref(prefs::kWebviewSigninDisabled, false);
}
// static
@@ -179,25 +180,41 @@ std::string StartupUtils::GetInitialLocale() {
// static
bool StartupUtils::IsWebviewSigninAllowed() {
- return extensions::GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebviewSigninFlow);
+ return !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableWebviewSigninFlow);
}
// static
bool StartupUtils::IsWebviewSigninEnabled() {
- return IsWebviewSigninAllowed() &&
- g_browser_process->local_state()->GetBoolean(
- prefs::kWebviewSigninEnabled);
+ policy::DeviceCloudPolicyManagerChromeOS* policy_manager =
+ g_browser_process
+ ? g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceCloudPolicyManager()
+ : nullptr;
+
+ bool is_remora_or_shark_requisition =
+ policy_manager
+ ? policy_manager->IsRemoraRequisition() ||
+ policy_manager->IsSharkRequisition()
+ : false;
+
+ bool is_webview_disabled_pref = g_browser_process->local_state()->GetBoolean(
+ prefs::kWebviewSigninDisabled);
+
+ // TODO(dzhioev): Re-enable webview signin for remora/shark requisition
+ // http://crbug.com/464049
+ return !is_remora_or_shark_requisition && IsWebviewSigninAllowed() &&
+ !is_webview_disabled_pref;
}
// static
bool StartupUtils::EnableWebviewSignin(bool is_enabled) {
- if (!IsWebviewSigninAllowed())
+ if (is_enabled && !IsWebviewSigninAllowed())
return false;
- g_browser_process->local_state()->SetBoolean(prefs::kWebviewSigninEnabled,
- is_enabled);
+ g_browser_process->local_state()->SetBoolean(prefs::kWebviewSigninDisabled,
+ !is_enabled);
return true;
}
« no previous file with comments | « chrome/browser/chromeos/login/signin/oauth2_browsertest.cc ('k') | chrome/browser/chromeos/login/test/oobe_base_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698