Index: chrome/browser/sync/sync_setup_wizard.cc |
diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc |
index 61113fdf962a9c91d0d5daebf42573de46f48bc8..614b7c275a306db344e461d0a8a9129f51495134 100644 |
--- a/chrome/browser/sync/sync_setup_wizard.cc |
+++ b/chrome/browser/sync/sync_setup_wizard.cc |
@@ -91,11 +91,19 @@ bool SyncSetupWizard::IsVisible() const { |
flow_container_->get_flow()->IsAttached(); |
} |
+// Returns true iff Sync is using OAuth-based authentication. See also |
+// GetLoginState(). |
+// static |
+bool SyncSetupWizard::IsUsingOAuth() { |
+ return CommandLine::ForCurrentProcess()->HasSwitch( |
akalin
2011/08/10 19:42:01
Consider adding it to about:flags, too. It's easy
Rick Campbell
2011/08/11 03:58:23
Done, and thanks for that pointer!
|
+ switches::kEnableSyncOAuth); |
+} |
+ |
// static |
SyncSetupWizard::State SyncSetupWizard::GetLoginState() { |
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSyncOAuth)) |
- return SyncSetupWizard::OAUTH_LOGIN; |
- return SyncSetupWizard::GAIA_LOGIN; |
+ return IsUsingOAuth() ? |
+ SyncSetupWizard::OAUTH_LOGIN : |
+ SyncSetupWizard::GAIA_LOGIN; |
} |
void SyncSetupWizard::Focus() { |