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

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

Issue 9295044: Start moving signin code out of browser/sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up unnecessary inclusions of signin_manager.h Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/profile_sync_service_factory.h" 9 #include "chrome/browser/sync/profile_sync_service_factory.h"
10 #include "content/public/browser/web_ui.h" 10 #include "content/public/browser/web_ui.h"
11 11
12 OptionsSyncSetupHandler::OptionsSyncSetupHandler( 12 OptionsSyncSetupHandler::OptionsSyncSetupHandler(
13 ProfileManager* profile_manager) : SyncSetupHandler(profile_manager) { 13 ProfileManager* profile_manager) : SyncSetupHandler(profile_manager) {
14 } 14 }
15 15
16 OptionsSyncSetupHandler::~OptionsSyncSetupHandler() { 16 OptionsSyncSetupHandler::~OptionsSyncSetupHandler() {
17 } 17 }
18 18
19 void OptionsSyncSetupHandler::StepWizardForShowSetupUI() {
20 ProfileSyncService* service(ProfileSyncServiceFactory::
21 GetInstance()->GetForProfile(Profile::FromWebUI(web_ui())));
22 DCHECK(service);
23
24 // We should bring up either a login or a configure flow based on the state of
25 // sync.
26 if (service->HasSyncSetupCompleted()) {
27 if (service->IsPassphraseRequiredForDecryption()) {
28 service->get_wizard().Step(SyncSetupWizard::ENTER_PASSPHRASE);
29 } else {
30 service->get_wizard().Step(SyncSetupWizard::CONFIGURE);
31 }
32 } else {
33 service->get_wizard().Step(SyncSetupWizard::GetLoginState());
34 }
35 }
36
37 void OptionsSyncSetupHandler::ShowSetupUI() { 19 void OptionsSyncSetupHandler::ShowSetupUI() {
38 // Show the Sync Setup page. 20 // Show the Sync Setup page.
39 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup")); 21 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup"));
40 web_ui()->CallJavascriptFunction("OptionsPage.navigateToPage", *page); 22 web_ui()->CallJavascriptFunction("OptionsPage.navigateToPage", *page);
41 } 23 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_sync_setup_handler.h ('k') | chrome/browser/ui/webui/signin/login_ui_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698