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

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

Issue 7399015: Sync Promo: Add a way to collapse the sync promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/options/options_sync_setup_handler.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync/profile_sync_service.h"
9
10 void OptionsSyncSetupHandler::ShowSetupUI() {
11 ProfileSyncService* service =
12 web_ui_->GetProfile()->GetProfileSyncService();
13 DCHECK(service);
14
15 // If the wizard is already visible, focus it.
16 if (service->get_wizard().IsVisible()) {
17 web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay");
18 service->get_wizard().Focus();
19 return;
20 }
21
22 // The user is trying to manually load a syncSetup URL. We should bring up
23 // either a login or a configure flow based on the state of sync.
24 if (service->HasSyncSetupCompleted())
25 service->get_wizard().Step(SyncSetupWizard::CONFIGURE);
26 else
27 service->get_wizard().Step(SyncSetupWizard::GAIA_LOGIN);
28
29 // Show the Sync Setup page.
30 scoped_ptr<Value> page(Value::CreateStringValue("syncSetup"));
31 web_ui_->CallJavascriptFunction("OptionsPage.navigateToPage", *page);
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698