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

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: address review comments 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 Profile::FromWebUI(web_ui_)->GetProfileSyncService()->ShowConfigure(false);
132 } 132 }
133 133
134 void NTPLoginHandler::UpdateLogin() { 134 void NTPLoginHandler::UpdateLogin() {
135 Profile* profile = Profile::FromWebUI(web_ui_); 135 Profile* profile = Profile::FromWebUI(web_ui_);
136 std::string username = profile->GetPrefs()->GetString( 136 std::string username = profile->GetPrefs()->GetString(
137 prefs::kGoogleServicesUsername); 137 prefs::kGoogleServicesUsername);
138 138
139 string16 header, sub_header; 139 string16 header, sub_header;
140 if (!username.empty()) { 140 if (!username.empty()) {
141 header = UTF8ToUTF16(username); 141 header = UTF8ToUTF16(username);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); 189 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
190 values->SetString("login_status_url", 190 values->SetString("login_status_url",
191 google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL)); 191 google_util::StringAppendGoogleLocaleParam(chrome::kSyncLearnMoreURL));
192 values->SetString("login_status_learn_more", 192 values->SetString("login_status_learn_more",
193 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 193 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
194 values->SetString("login_status_advanced", 194 values->SetString("login_status_advanced",
195 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 195 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
196 values->SetString("login_status_dismiss", 196 values->SetString("login_status_dismiss",
197 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 197 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
198 } 198 }
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