Commit bb94ec50 authored by dzhioev@chromium.org's avatar dzhioev@chromium.org

Added ability to use new GAIA endpoint on CrOS login screen.

This feature can be enabled with "enable-embedded-singin" command-line switch.

BUG=308312
TEST=manually
NOTRY=true

Review URL: https://codereview.chromium.org/296173008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272971 0039d316-1c4b-4281-b951-d872f2087c98
parent 9cb430b8
...@@ -256,12 +256,20 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { ...@@ -256,12 +256,20 @@ login.createScreen('GaiaSigninScreen', 'gaia-signin', function() {
if (data.localizedStrings) if (data.localizedStrings)
params.localizedStrings = data.localizedStrings; params.localizedStrings = data.localizedStrings;
if (data.useEmbedded)
params.gaiaPath = 'EmbeddedSignIn';
if (data.forceReload || if (data.forceReload ||
JSON.stringify(this.gaiaAuthParams_) != JSON.stringify(params)) { JSON.stringify(this.gaiaAuthParams_) != JSON.stringify(params)) {
this.error_ = 0; this.error_ = 0;
this.gaiaAuthHost_.load(data.useOffline ?
cr.login.GaiaAuthHost.AuthMode.OFFLINE : var authMode = cr.login.GaiaAuthHost.AuthMode.DEFAULT;
cr.login.GaiaAuthHost.AuthMode.DEFAULT, if (data.useOffline)
authMode = cr.login.GaiaAuthHost.AuthMode.OFFLINE;
else if (data.useEmbedded)
authMode = cr.login.GaiaAuthHost.AuthMode.DESKTOP;
this.gaiaAuthHost_.load(authMode,
params, params,
this.onAuthCompleted_.bind(this)); this.onAuthCompleted_.bind(this));
this.gaiaAuthParams_ = params; this.gaiaAuthParams_ = params;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "chrome/browser/chromeos/login/users/user_manager.h" #include "chrome/browser/chromeos/login/users/user_manager.h"
#include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h" #include "chromeos/settings/cros_settings_names.h"
#include "google_apis/gaia/gaia_switches.h" #include "google_apis/gaia/gaia_switches.h"
#include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/gaia_urls.h"
...@@ -138,13 +139,17 @@ void GaiaScreenHandler::LoadGaia(const GaiaContext& context) { ...@@ -138,13 +139,17 @@ void GaiaScreenHandler::LoadGaia(const GaiaContext& context) {
params.Set("localizedStrings", localized_strings); params.Set("localizedStrings", localized_strings);
} }
CommandLine* command_line = CommandLine::ForCurrentProcess();
const GURL gaia_url = const GURL gaia_url =
CommandLine::ForCurrentProcess()->HasSwitch(::switches::kGaiaUrl) command_line->HasSwitch(::switches::kGaiaUrl)
? GURL(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( ? GURL(command_line->GetSwitchValueASCII(::switches::kGaiaUrl))
::switches::kGaiaUrl))
: GaiaUrls::GetInstance()->gaia_url(); : GaiaUrls::GetInstance()->gaia_url();
params.SetString("gaiaUrl", gaia_url.spec()); params.SetString("gaiaUrl", gaia_url.spec());
if (command_line->HasSwitch(chromeos::switches::kEnableEmbeddedSignin))
params.SetBoolean("useEmbedded", true);
frame_state_ = FRAME_STATE_LOADING; frame_state_ = FRAME_STATE_LOADING;
CallJS("loadAuthExtension", params); CallJS("loadAuthExtension", params);
} }
......
...@@ -8,15 +8,15 @@ namespace chromeos { ...@@ -8,15 +8,15 @@ namespace chromeos {
namespace switches { namespace switches {
// Path for app's OEM manifest file. // Path for app's OEM manifest file.
const char kAppOemManifestFile[] = "app-mode-oem-manifest"; const char kAppOemManifestFile[] = "app-mode-oem-manifest";
// When wallpaper boot animation is not disabled this switch // When wallpaper boot animation is not disabled this switch
// is used to override OOBE/sign in WebUI init type. // is used to override OOBE/sign in WebUI init type.
// Possible values: parallel|postpone. Default: parallel. // Possible values: parallel|postpone. Default: parallel.
const char kAshWebUIInit[] = "ash-webui-init"; const char kAshWebUIInit[] = "ash-webui-init";
// Specifies the URL of the consumer device management backend. // Specifies the URL of the consumer device management backend.
const char kConsumerDeviceManagementUrl[] = "consumer-device-management-url"; const char kConsumerDeviceManagementUrl[] = "consumer-device-management-url";
// Forces the stub implementation of dbus clients. // Forces the stub implementation of dbus clients.
const char kDbusStub[] = "dbus-stub"; const char kDbusStub[] = "dbus-stub";
...@@ -28,26 +28,26 @@ const char kDerelictDetectionTimeout[] = "derelict-detection-timeout"; ...@@ -28,26 +28,26 @@ const char kDerelictDetectionTimeout[] = "derelict-detection-timeout";
const char kDerelictIdleTimeout[] = "derelict-idle-timeout"; const char kDerelictIdleTimeout[] = "derelict-idle-timeout";
// Disables wallpaper boot animation (except of OOBE case). // Disables wallpaper boot animation (except of OOBE case).
const char kDisableBootAnimation[] = "disable-boot-animation"; const char kDisableBootAnimation[] = "disable-boot-animation";
// Disables the ChromeOS demo. // Disables the ChromeOS demo.
const char kDisableDemoMode[] = "disable-demo-mode"; const char kDisableDemoMode[] = "disable-demo-mode";
// Disable Genius App and use the original Help App instead. // Disable Genius App and use the original Help App instead.
const char kDisableGeniusApp[] = "disable-genius-app"; const char kDisableGeniusApp[] = "disable-genius-app";
// Avoid doing expensive animations upon login. // Avoid doing expensive animations upon login.
const char kDisableLoginAnimations[] = "disable-login-animations"; const char kDisableLoginAnimations[] = "disable-login-animations";
// Disable login UI (user pods) scrolling into view on JS side when virtual // Disable login UI (user pods) scrolling into view on JS side when virtual
// keyboard is shown. // keyboard is shown.
const char kDisableLoginScrollIntoView[] = "disable-login-scroll-into-view"; const char kDisableLoginScrollIntoView[] = "disable-login-scroll-into-view";
// Disable new channel switcher UI. // Disable new channel switcher UI.
const char kDisableNewChannelSwitcherUI[] = "disable-new-channel-switcher-ui"; const char kDisableNewChannelSwitcherUI[] = "disable-new-channel-switcher-ui";
// Disables new Kiosk UI when kiosk apps are represented as user pods. // Disables new Kiosk UI when kiosk apps are represented as user pods.
const char kDisableNewKioskUI[] = "disable-new-kiosk-ui"; const char kDisableNewKioskUI[] = "disable-new-kiosk-ui";
// Disable Quickoffice component app thus handlers won't be registered so // Disable Quickoffice component app thus handlers won't be registered so
// it will be possible to install another version as normal app for testing. // it will be possible to install another version as normal app for testing.
...@@ -62,21 +62,25 @@ const char kDisableNetworkPortalNotification[] = ...@@ -62,21 +62,25 @@ const char kDisableNetworkPortalNotification[] =
"disable-network-portal-notification"; "disable-network-portal-notification";
// Enables switching between different cellular carriers from the UI. // Enables switching between different cellular carriers from the UI.
const char kEnableCarrierSwitching[] = "enable-carrier-switching"; const char kEnableCarrierSwitching[] = "enable-carrier-switching";
// Enables the next generation version of ChromeVox. Only valid with // Enables the next generation version of ChromeVox. Only valid with
// use_chromevox_next=1 within your GYP_DEFINES. // use_chromevox_next=1 within your GYP_DEFINES.
const char kEnableChromeVoxNext[] = "enable-chromevox-next"; const char kEnableChromeVoxNext[] = "enable-chromevox-next";
// Enables consumer management, which allows user to enroll, remotely lock and // Enables consumer management, which allows user to enroll, remotely lock and
// locate the device. // locate the device.
const char kEnableConsumerManagement[] = "enable-consumer-management"; const char kEnableConsumerManagement[] = "enable-consumer-management";
// If this switch is set, Chrome OS login screen uses |EmbeddedSignin| endpoint
// of GAIA.
const char kEnableEmbeddedSignin[] = "enable-embedded-signin";
// Enables MTP support in Files.app. // Enables MTP support in Files.app.
const char kEnableFileManagerMTP[] = "enable-filemanager-mtp"; const char kEnableFileManagerMTP[] = "enable-filemanager-mtp";
// Enable explicit HID detection on OOBE. // Enable explicit HID detection on OOBE.
const char kEnableHIDDetectionOnOOBE[] = "enable-hid-detection-on-oobe"; const char kEnableHIDDetectionOnOOBE[] = "enable-hid-detection-on-oobe";
// Enables notifications about captive portals in session. // Enables notifications about captive portals in session.
const char kEnableNetworkPortalNotification[] = const char kEnableNetworkPortalNotification[] =
...@@ -88,13 +92,13 @@ const char kEnableTouchpadThreeFingerClick[] ...@@ -88,13 +92,13 @@ const char kEnableTouchpadThreeFingerClick[]
// Enable Kiosk mode for ChromeOS. Note this switch refers to retail mode rather // Enable Kiosk mode for ChromeOS. Note this switch refers to retail mode rather
// than the kiosk app mode. // than the kiosk app mode.
const char kEnableKioskMode[] = "enable-kiosk-mode"; const char kEnableKioskMode[] = "enable-kiosk-mode";
// Enables rollback option for resetting ChromeOS. // Enables rollback option for resetting ChromeOS.
const char kEnableRollbackOption[] = "enable-rollback-option"; const char kEnableRollbackOption[] = "enable-rollback-option";
// Enables request of tablet site (via user agent override). // Enables request of tablet site (via user agent override).
const char kEnableRequestTabletSite[] = "enable-request-tablet-site"; const char kEnableRequestTabletSite[] = "enable-request-tablet-site";
// Whether to enable forced enterprise re-enrollment. // Whether to enable forced enterprise re-enrollment.
const char kEnterpriseEnableForcedReEnrollment[] = const char kEnterpriseEnableForcedReEnrollment[] =
...@@ -121,22 +125,22 @@ const char kFileManagerEnableNewAudioPlayer[] = ...@@ -121,22 +125,22 @@ const char kFileManagerEnableNewAudioPlayer[] =
// Passed to Chrome the first time that it's run after the system boots. // Passed to Chrome the first time that it's run after the system boots.
// Not passed on restart after sign out. // Not passed on restart after sign out.
const char kFirstExecAfterBoot[] = "first-exec-after-boot"; const char kFirstExecAfterBoot[] = "first-exec-after-boot";
// Usually in browser tests the usual login manager bringup is skipped so that // Usually in browser tests the usual login manager bringup is skipped so that
// tests can change how it's brought up. This flag disables that. // tests can change how it's brought up. This flag disables that.
const char kForceLoginManagerInTests[] = "force-login-manager-in-tests"; const char kForceLoginManagerInTests[] = "force-login-manager-in-tests";
// Indicates that the browser is in "browse without sign-in" (Guest session) // Indicates that the browser is in "browse without sign-in" (Guest session)
// mode. Should completely disable extensions, sync and bookmarks. // mode. Should completely disable extensions, sync and bookmarks.
const char kGuestSession[] = "bwsi"; const char kGuestSession[] = "bwsi";
// If true, the Chromebook has a Chrome OS keyboard. Don't use the flag for // If true, the Chromebook has a Chrome OS keyboard. Don't use the flag for
// Chromeboxes. // Chromeboxes.
const char kHasChromeOSKeyboard[] = "has-chromeos-keyboard"; const char kHasChromeOSKeyboard[] = "has-chromeos-keyboard";
// If true, the Chromebook has a keyboard with a diamond key. // If true, the Chromebook has a keyboard with a diamond key.
const char kHasChromeOSDiamondKey[] = "has-chromeos-diamond-key"; const char kHasChromeOSDiamondKey[] = "has-chromeos-diamond-key";
// Defines user homedir. This defaults to primary user homedir. // Defines user homedir. This defaults to primary user homedir.
const char kHomedir[] = "homedir"; const char kHomedir[] = "homedir";
...@@ -149,32 +153,32 @@ const char kIgnoreUserProfileMappingForTests[] = ...@@ -149,32 +153,32 @@ const char kIgnoreUserProfileMappingForTests[] =
"ignore-user-profile-mapping-for-tests"; "ignore-user-profile-mapping-for-tests";
// Path for the screensaver used in Kiosk mode // Path for the screensaver used in Kiosk mode
const char kKioskModeScreensaverPath[] = "kiosk-mode-screensaver-path"; const char kKioskModeScreensaverPath[] = "kiosk-mode-screensaver-path";
// Enables Chrome-as-a-login-manager behavior. // Enables Chrome-as-a-login-manager behavior.
const char kLoginManager[] = "login-manager"; const char kLoginManager[] = "login-manager";
// Specifies a password to be used to login (along with login-user). // Specifies a password to be used to login (along with login-user).
const char kLoginPassword[] = "login-password"; const char kLoginPassword[] = "login-password";
// Specifies the profile to use once a chromeos user is logged in. This is // Specifies the profile to use once a chromeos user is logged in. This is
// required unless --multi-profile is set. // required unless --multi-profile is set.
const char kLoginProfile[] = "login-profile"; const char kLoginProfile[] = "login-profile";
// Specifies the user which is already logged in. // Specifies the user which is already logged in.
const char kLoginUser[] = "login-user"; const char kLoginUser[] = "login-user";
// Enables natural scroll by default. // Enables natural scroll by default.
const char kNaturalScrollDefault[] = "enable-natural-scroll-default"; const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
// Skips all other OOBE pages after user login. // Skips all other OOBE pages after user login.
const char kOobeSkipPostLogin[] = "oobe-skip-postlogin"; const char kOobeSkipPostLogin[] = "oobe-skip-postlogin";
// Interval at which we check for total time on OOBE. // Interval at which we check for total time on OOBE.
const char kOobeTimerInterval[] = "oobe-timer-interval"; const char kOobeTimerInterval[] = "oobe-timer-interval";
// Indicates that a guest session has been started before OOBE completion. // Indicates that a guest session has been started before OOBE completion.
const char kOobeGuestSession[] = "oobe-guest-session"; const char kOobeGuestSession[] = "oobe-guest-session";
// Specifies power stub behavior: // Specifies power stub behavior:
// 'cycle=2' - Cycles power states every 2 seconds. // 'cycle=2' - Cycles power states every 2 seconds.
...@@ -196,15 +200,15 @@ const char kPowerStub[] = "power-stub"; ...@@ -196,15 +200,15 @@ const char kPowerStub[] = "power-stub";
const char kShillStub[] = "shill-stub"; const char kShillStub[] = "shill-stub";
// Sends test messages on first call to RequestUpdate (stub only). // Sends test messages on first call to RequestUpdate (stub only).
const char kSmsTestMessages[] = "sms-test-messages"; const char kSmsTestMessages[] = "sms-test-messages";
// Indicates that a stub implementation of CrosSettings that stores settings in // Indicates that a stub implementation of CrosSettings that stores settings in
// memory without signing should be used, treating current user as the owner. // memory without signing should be used, treating current user as the owner.
// This option is for testing the chromeos build of chrome on the desktop only. // This option is for testing the chromeos build of chrome on the desktop only.
const char kStubCrosSettings[] = "stub-cros-settings"; const char kStubCrosSettings[] = "stub-cros-settings";
// Disables SAML sigin support. // Disables SAML sigin support.
const char kDisableSamlSignin[] = "disable-saml-signin"; const char kDisableSamlSignin[] = "disable-saml-signin";
// Enables animated transitions during first-run tutorial. // Enables animated transitions during first-run tutorial.
const char kEnableFirstRunUITransitions[] = "enable-first-run-ui-transitions"; const char kEnableFirstRunUITransitions[] = "enable-first-run-ui-transitions";
......
...@@ -39,6 +39,7 @@ CHROMEOS_EXPORT extern const char kDisableVolumeAdjustSound[]; ...@@ -39,6 +39,7 @@ CHROMEOS_EXPORT extern const char kDisableVolumeAdjustSound[];
CHROMEOS_EXPORT extern const char kEnableCarrierSwitching[]; CHROMEOS_EXPORT extern const char kEnableCarrierSwitching[];
CHROMEOS_EXPORT extern const char kEnableChromeVoxNext[]; CHROMEOS_EXPORT extern const char kEnableChromeVoxNext[];
CHROMEOS_EXPORT extern const char kEnableConsumerManagement[]; CHROMEOS_EXPORT extern const char kEnableConsumerManagement[];
CHROMEOS_EXPORT extern const char kEnableEmbeddedSignin[];
CHROMEOS_EXPORT extern const char kEnableFileManagerMTP[]; CHROMEOS_EXPORT extern const char kEnableFileManagerMTP[];
CHROMEOS_EXPORT extern const char kEnableRollbackOption[]; CHROMEOS_EXPORT extern const char kEnableRollbackOption[];
CHROMEOS_EXPORT extern const char kEnableHIDDetectionOnOOBE[]; CHROMEOS_EXPORT extern const char kEnableHIDDetectionOnOOBE[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment