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

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

Issue 8571022: [Sync Setup UI] Separate stepping the SyncSetupWizard from syncSetup page navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 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 unified diff | Download patch | Annotate | Revision Log
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/options_sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/options/options_sync_setup_handler.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync/profile_sync_service.h" 8 #include "chrome/browser/sync/profile_sync_service.h"
9 9
10 OptionsSyncSetupHandler::OptionsSyncSetupHandler( 10 OptionsSyncSetupHandler::OptionsSyncSetupHandler(
11 ProfileManager* profile_manager) : SyncSetupHandler(profile_manager) { 11 ProfileManager* profile_manager) : SyncSetupHandler(profile_manager) {
12 } 12 }
13 13
14 OptionsSyncSetupHandler::~OptionsSyncSetupHandler() { 14 OptionsSyncSetupHandler::~OptionsSyncSetupHandler() {
15 } 15 }
16 16
17 void OptionsSyncSetupHandler::ShowSetupUI() { 17 void OptionsSyncSetupHandler::StepWizardForShowSetupUI() {
18 ProfileSyncService* service = 18 ProfileSyncService* service =
19 Profile::FromWebUI(web_ui_)->GetProfileSyncService(); 19 Profile::FromWebUI(web_ui_)->GetProfileSyncService();
20 DCHECK(service); 20 DCHECK(service);
21 21
22 // The user is trying to manually load a syncSetup URL. We should bring up 22 // We should bring up either a login or a configure flow based on the state of
23 // either a login or a configure flow based on the state of sync. 23 // sync.
24 if (service->HasSyncSetupCompleted()) { 24 if (service->HasSyncSetupCompleted()) {
25 if (service->IsPassphraseRequiredForDecryption()) { 25 if (service->IsPassphraseRequiredForDecryption()) {
26 service->get_wizard().Step(SyncSetupWizard::ENTER_PASSPHRASE); 26 service->get_wizard().Step(SyncSetupWizard::ENTER_PASSPHRASE);
27 } else { 27 } else {
28 service->get_wizard().Step(SyncSetupWizard::CONFIGURE); 28 service->get_wizard().Step(SyncSetupWizard::CONFIGURE);
29 } 29 }
30 } else { 30 } else {
31 service->get_wizard().Step(SyncSetupWizard::GetLoginState()); 31 service->get_wizard().Step(SyncSetupWizard::GetLoginState());
32 } 32 }
33 }
33 34
35 void OptionsSyncSetupHandler::ShowSetupUI() {
34 // Show the Sync Setup page. 36 // Show the Sync Setup page.
35 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup")); 37 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup"));
36 web_ui_->CallJavascriptFunction("OptionsPage.navigateToPage", *page); 38 web_ui_->CallJavascriptFunction("OptionsPage.navigateToPage", *page);
37 } 39 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_sync_setup_handler.h ('k') | chrome/browser/ui/webui/sync_promo_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698