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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 11316299: Enable web-based sign in flow by default. Can use command line argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/sync_setup_handler.cc
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index 397958db5d142e566156861206536a6dab46aa91..3d5829212ca554d9ff30923fe20c96f8f2861e6e 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/sync/one_click_signin_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
@@ -187,11 +188,6 @@ bool IsKeystoreEncryptionEnabled() {
switches::kSyncKeystoreEncryption);
}
-bool UseWebBasedSigninFlow() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseWebBasedSigninFlow);
-}
-
void BringTabToFront(WebContents* web_contents) {
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
if (browser) {
@@ -504,7 +500,7 @@ void SyncSetupHandler::DisplayConfigureSync(bool show_advanced,
web_ui()->CallJavascriptFunction(
"SyncSetupOverlay.showSyncSetupPage", page, args);
- if (UseWebBasedSigninFlow()) {
+ if (OneClickSigninHelper::UseWebBasedSigninFlow()) {
// Make sure the tab used for the Gaia sign in does not cover this tab.
FocusUI();
}
@@ -585,7 +581,7 @@ SigninManager* SyncSetupHandler::GetSignin() const {
}
void SyncSetupHandler::DisplayGaiaLogin(bool fatal_error) {
- if (UseWebBasedSigninFlow()) {
+ if (OneClickSigninHelper::UseWebBasedSigninFlow()) {
DCHECK(!active_gaia_signin_tab_);
// We are no longer configuring sync if the login screen is visible.
@@ -841,7 +837,7 @@ void SyncSetupHandler::SigninFailed(const GoogleServiceAuthError& error) {
// If using web-based sign in flow, don't show the gaia sign in page again
// since there is no way to show the user an error message.
- if (UseWebBasedSigninFlow()) {
+ if (OneClickSigninHelper::UseWebBasedSigninFlow()) {
CloseSyncSetup();
} else {
// Got a failed signin - this is either just a typical auth error, or a
@@ -1054,7 +1050,7 @@ void SyncSetupHandler::CloseSyncSetup() {
}
// Let the various services know that we're no longer active.
- if (UseWebBasedSigninFlow())
+ if (OneClickSigninHelper::UseWebBasedSigninFlow())
CloseGaiaSigninPage();
GetLoginUIService()->LoginUIClosed(this);
@@ -1119,7 +1115,7 @@ void SyncSetupHandler::OpenSyncSetup(bool force_login) {
DisplayConfigureSync(true, false);
}
- if (!UseWebBasedSigninFlow())
+ if (!OneClickSigninHelper::UseWebBasedSigninFlow())
ShowSetupUI();
}
@@ -1136,7 +1132,7 @@ void SyncSetupHandler::FocusUI() {
// In the case of the web-based sign in flow, |configuring_sync_| true means
// we are focusing to bring the configure popup window to the top, not the
// Gaia sign in page.
- if (UseWebBasedSigninFlow() && !configuring_sync_) {
+ if (OneClickSigninHelper::UseWebBasedSigninFlow() && !configuring_sync_) {
BringTabToFront(active_gaia_signin_tab_);
} else {
WebContents* web_contents = web_ui()->GetWebContents();

Powered by Google App Engine
This is Rietveld 408576698