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

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 8502007: Show sync setup when user clicks Advanced link in bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | 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/ntp/ntp_login_handler.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY); 121 NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY);
122 } 122 }
123 } 123 }
124 124
125 void NTPLoginHandler::HandleLoginMessageSeen(const ListValue* args) { 125 void NTPLoginHandler::HandleLoginMessageSeen(const ListValue* args) {
126 Profile::FromWebUI(web_ui_)->GetPrefs()->SetBoolean( 126 Profile::FromWebUI(web_ui_)->GetPrefs()->SetBoolean(
127 prefs::kSyncPromoShowNTPBubble, false); 127 prefs::kSyncPromoShowNTPBubble, false);
128 } 128 }
129 129
130 void NTPLoginHandler::HandleShowAdvancedLoginUI(const ListValue* args) { 130 void NTPLoginHandler::HandleShowAdvancedLoginUI(const ListValue* args) {
131 Profile::FromWebUI(web_ui_)->GetProfileSyncService()->ShowLoginDialog(); 131 std::string url(chrome::kChromeUISettingsURL);
James Hawkins 2011/11/08 16:55:44 What does ShowLoginDialog() do differently?
sail 2011/11/08 18:42:50 It calls SyncSetupWizard::Step(SyncSetupWizard::GA
132 url += chrome::kSyncSetupSubPage;
133 web_ui_->tab_contents()->OpenURL(GURL(url), GURL(), CURRENT_TAB,
134 content::PAGE_TRANSITION_LINK);
132 } 135 }
133 136
134 void NTPLoginHandler::UpdateLogin() { 137 void NTPLoginHandler::UpdateLogin() {
135 Profile* profile = Profile::FromWebUI(web_ui_); 138 Profile* profile = Profile::FromWebUI(web_ui_);
136 std::string username = profile->GetPrefs()->GetString( 139 std::string username = profile->GetPrefs()->GetString(
137 prefs::kGoogleServicesUsername); 140 prefs::kGoogleServicesUsername);
138 141
139 string16 header, sub_header; 142 string16 header, sub_header;
140 if (!username.empty()) { 143 if (!username.empty()) {
141 header = UTF8ToUTF16(username); 144 header = UTF8ToUTF16(username);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); 192 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
190 values->SetString("login_status_url", 193 values->SetString("login_status_url",
191 google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL)); 194 google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL));
192 values->SetString("login_status_learn_more", 195 values->SetString("login_status_learn_more",
193 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 196 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
194 values->SetString("login_status_advanced", 197 values->SetString("login_status_advanced",
195 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 198 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
196 values->SetString("login_status_dismiss", 199 values->SetString("login_status_dismiss",
197 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 200 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
198 } 201 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698