summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_setup_flow.cc
diff options
context:
space:
mode:
authordantasse@chromium.org <dantasse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 18:33:43 +0000
committerdantasse@chromium.org <dantasse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 18:33:43 +0000
commita04f8002d45c2d368faf275d0d019e0b3f60844c (patch)
treeca645b4ea258424ccf1e5469449b880c3918dcb6 /chrome/browser/sync/sync_setup_flow.cc
parent1f62584462a6bd7fcc1715a3c9b14e30670c326c (diff)
downloadchromium_src-a04f8002d45c2d368faf275d0d019e0b3f60844c.zip
chromium_src-a04f8002d45c2d368faf275d0d019e0b3f60844c.tar.gz
chromium_src-a04f8002d45c2d368faf275d0d019e0b3f60844c.tar.bz2
Make it impossible to click OK if you've selected 0 datatypes.
BUG=40880 TEST=try to Customize Sync so you're syncing 0 datatypes. You shouldn't be able to. Review URL: http://codereview.chromium.org/1641001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_setup_flow.cc')
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 595b3a3..b7f5bae 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -107,6 +107,19 @@ void FlowHandler::HandleSubmitAuth(const Value* value) {
if (json.empty())
return;
+ // If ClickOk() returns false (indicating that there's a problem in the
+ // CustomizeSyncWindowView), don't do anything; the CSWV will focus itself,
+ // indicating that there's something to do there.
+ // ClickOk() has no side effects if the singleton dialog is not present.
+ if (!flow_->ClickCustomizeOk()) {
+ // TODO(dantasse): this results in a kinda ugly experience for this edge
+ // case; come back here and add a nice message explaining that you can't
+ // sync zero datatypes. (OR just make the CSWV modal to the Gaia Login
+ // box, like we want to do anyway.
+ flow_->Advance(SyncSetupWizard::GAIA_LOGIN);
+ return;
+ }
+
if (!GetAuthData(json, &username, &password, &captcha)) {
// The page sent us something that we didn't understand.
// This probably indicates a programming error.