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

Side by Side Diff: chrome/browser/ui/webui/options/sync_setup_handler.cc

Issue 7466024: [Sync] Support receiving early passphrase required information in Sync UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed + fix unit test Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/sync_setup_wizard_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/google/google_util.h" 10 #include "chrome/browser/google/google_util.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 // If the wizard is already visible, focus it. 462 // If the wizard is already visible, focus it.
463 if (service->get_wizard().IsVisible()) { 463 if (service->get_wizard().IsVisible()) {
464 web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay"); 464 web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay");
465 service->get_wizard().Focus(); 465 service->get_wizard().Focus();
466 return; 466 return;
467 } 467 }
468 468
469 // The user is trying to manually load a syncSetup URL. We should bring up 469 // The user is trying to manually load a syncSetup URL. We should bring up
470 // either a login or a configure flow based on the state of sync. 470 // either a login or a configure flow based on the state of sync.
471 if (service->HasSyncSetupCompleted()) 471 if (service->HasSyncSetupCompleted()) {
472 service->get_wizard().Step(SyncSetupWizard::CONFIGURE); 472 if (service->IsPassphraseRequiredForDecryption()) {
473 else 473 service->get_wizard().Step(SyncSetupWizard::ENTER_PASSPHRASE);
474 } else {
475 service->get_wizard().Step(SyncSetupWizard::CONFIGURE);
476 }
477 } else {
474 service->get_wizard().Step(SyncSetupWizard::GAIA_LOGIN); 478 service->get_wizard().Step(SyncSetupWizard::GAIA_LOGIN);
479 }
475 480
476 // Show the Sync Setup page. 481 // Show the Sync Setup page.
477 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup")); 482 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup"));
478 web_ui_->CallJavascriptFunction("OptionsPage.navigateToPage", *page); 483 web_ui_->CallJavascriptFunction("OptionsPage.navigateToPage", *page);
479 } 484 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_setup_wizard_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698