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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 10911169: Setup field trial for one-click signin inforbar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 3 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/sync/one_click_signin_helper.h" 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/field_trial.h"
10 #include "base/string_split.h" 11 #include "base/string_split.h"
11 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" 13 #include "chrome/browser/api/infobars/one_click_signin_infobar_delegate.h"
13 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/defaults.h"
14 #include "chrome/browser/infobars/infobar_tab_helper.h" 16 #include "chrome/browser/infobars/infobar_tab_helper.h"
15 #include "chrome/browser/prefs/pref_service.h" 17 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/prefs/scoped_user_pref_update.h" 18 #include "chrome/browser/prefs/scoped_user_pref_update.h"
17 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/profiles/profile_info_cache.h" 20 #include "chrome/browser/profiles/profile_info_cache.h"
19 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/signin/signin_manager.h" 22 #include "chrome/browser/signin/signin_manager.h"
21 #include "chrome/browser/signin/signin_manager_factory.h" 23 #include "chrome/browser/signin/signin_manager_factory.h"
22 #include "chrome/browser/sync/profile_sync_service.h" 24 #include "chrome/browser/sync/profile_sync_service.h"
23 #include "chrome/browser/tab_contents/tab_util.h" 25 #include "chrome/browser/tab_contents/tab_util.h"
24 #include "chrome/browser/ui/browser_finder.h" 26 #include "chrome/browser/ui/browser_finder.h"
25 #include "chrome/browser/ui/browser_window.h" 27 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/sync/one_click_signin_histogram.h" 28 #include "chrome/browser/ui/sync/one_click_signin_histogram.h"
27 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" 29 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
28 #include "chrome/browser/ui/tab_contents/tab_contents.h" 30 #include "chrome/browser/ui/tab_contents/tab_contents.h"
31 #include "chrome/common/chrome_version_info.h"
29 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
30 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
31 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/page_navigator.h" 35 #include "content/public/browser/page_navigator.h"
33 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
34 #include "content/public/browser/web_contents_view.h" 37 #include "content/public/browser/web_contents_view.h"
35 #include "content/public/common/frame_navigate_params.h" 38 #include "content/public/common/frame_navigate_params.h"
36 #include "content/public/common/page_transition_types.h" 39 #include "content/public/common/page_transition_types.h"
37 #include "googleurl/src/gurl.h" 40 #include "googleurl/src/gurl.h"
38 #include "grit/chromium_strings.h" 41 #include "grit/chromium_strings.h"
39 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
40 #include "grit/theme_resources.h" 43 #include "grit/theme_resources.h"
41 #include "net/cookies/cookie_monster.h" 44 #include "net/cookies/cookie_monster.h"
42 #include "net/url_request/url_request.h" 45 #include "net/url_request/url_request.h"
43 #include "ui/base/l10n/l10n_util.h" 46 #include "ui/base/l10n/l10n_util.h"
44 #include "ui/base/resource/resource_bundle.h" 47 #include "ui/base/resource/resource_bundle.h"
45 #include "webkit/forms/password_form.h" 48 #include "webkit/forms/password_form.h"
46 #include "webkit/forms/password_form_dom_manager.h" 49 #include "webkit/forms/password_form_dom_manager.h"
47 50
51 namespace {
52
53 // Set to true if this chrome instance is in the blue-button-on-white-bar
54 // experimental group.
55 bool use_blue_on_white = false;
56
57 // Start syncing with the given user information.
58 void StartSync(content::WebContents* web_contents,
59 const std::string& session_index,
60 const std::string& email,
61 const std::string& password,
62 OneClickSigninSyncStarter::StartSyncMode start_mode) {
63 // The starter deletes itself once its done.
64 Browser* browser = browser::FindBrowserWithWebContents(web_contents);
65 new OneClickSigninSyncStarter(browser, session_index, email, password,
66 start_mode);
67 }
68
69 } // namespace
70
SteveT 2012/09/11 02:16:25 nit: Is this extra break necessary?
Roger Tawa OOO till Jul 10th 2012/09/11 19:23:21 Done.
71
48 // The infobar asking the user if they want to use one-click sign in. 72 // The infobar asking the user if they want to use one-click sign in.
49 class OneClickLoginInfoBarDelegate : public ConfirmInfoBarDelegate { 73 class OneClickInfoBarDelegateImpl : public OneClickSigninInfoBarDelegate {
50 public: 74 public:
51 OneClickLoginInfoBarDelegate(InfoBarTabHelper* owner, 75 OneClickInfoBarDelegateImpl(InfoBarTabHelper* owner,
52 const std::string& session_index, 76 const std::string& session_index,
53 const std::string& email, 77 const std::string& email,
54 const std::string& password); 78 const std::string& password);
55 virtual ~OneClickLoginInfoBarDelegate(); 79 virtual ~OneClickInfoBarDelegateImpl();
56 80
57 private: 81 private:
58 // ConfirmInfoBarDelegate overrides. 82 // InfoBarDelegate overrides.
83 virtual InfoBarAutomationType GetInfoBarAutomationType() const OVERRIDE;
59 virtual void InfoBarDismissed() OVERRIDE; 84 virtual void InfoBarDismissed() OVERRIDE;
60 virtual gfx::Image* GetIcon() const OVERRIDE; 85 virtual gfx::Image* GetIcon() const OVERRIDE;
61 virtual Type GetInfoBarType() const OVERRIDE; 86 virtual Type GetInfoBarType() const OVERRIDE;
62 virtual string16 GetMessageText() const OVERRIDE; 87 virtual string16 GetMessageText() const OVERRIDE;
88
89 // ConfirmInfoBarDelegate overrides.
63 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 90 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
64 virtual bool Accept() OVERRIDE; 91 virtual bool Accept() OVERRIDE;
65 virtual bool Cancel() OVERRIDE; 92 virtual bool Cancel() OVERRIDE;
66 virtual string16 GetLinkText() const OVERRIDE; 93 virtual string16 GetLinkText() const OVERRIDE;
67 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 94 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
68 95
69 virtual InfoBarAutomationType GetInfoBarAutomationType() const OVERRIDE; 96 // OneClickSigninInfoBarDelegate overrides.
97 virtual void GetAlternateColors(AlternateColors* alt_colors) OVERRIDE;
70 98
71 // Set the profile preference to turn off one-click sign in so that it won't 99 // Set the profile preference to turn off one-click sign in so that it won't
72 // show again in this profile. 100 // show again in this profile.
73 void DisableOneClickSignIn(); 101 void DisableOneClickSignIn();
74 102
75 // Add a specific email to the list of emails rejected for one-click 103 // Add a specific email to the list of emails rejected for one-click
76 // sign-in, for this profile. 104 // sign-in, for this profile.
77 void AddEmailToOneClickRejectedList(const std::string& email); 105 void AddEmailToOneClickRejectedList(const std::string& email);
78 106
79 // Record the specified action in the histogram for one-click sign in. 107 // Record the specified action in the histogram for one-click sign in.
80 void RecordHistogramAction(int action); 108 void RecordHistogramAction(int action);
81 109
82 // Information about the account that has just logged in. 110 // Information about the account that has just logged in.
83 std::string session_index_; 111 std::string session_index_;
84 std::string email_; 112 std::string email_;
85 std::string password_; 113 std::string password_;
86 114
87 // Whether any UI controls in the infobar were pressed or not. 115 // Whether any UI controls in the infobar were pressed or not.
88 bool button_pressed_; 116 bool button_pressed_;
89 117
90 DISALLOW_COPY_AND_ASSIGN(OneClickLoginInfoBarDelegate); 118 DISALLOW_COPY_AND_ASSIGN(OneClickInfoBarDelegateImpl);
91 }; 119 };
92 120
93 OneClickLoginInfoBarDelegate::OneClickLoginInfoBarDelegate( 121 OneClickInfoBarDelegateImpl::OneClickInfoBarDelegateImpl(
94 InfoBarTabHelper* owner, 122 InfoBarTabHelper* owner,
95 const std::string& session_index, 123 const std::string& session_index,
96 const std::string& email, 124 const std::string& email,
97 const std::string& password) 125 const std::string& password)
98 : ConfirmInfoBarDelegate(owner), 126 : OneClickSigninInfoBarDelegate(owner),
99 session_index_(session_index), 127 session_index_(session_index),
100 email_(email), 128 email_(email),
101 password_(password), 129 password_(password),
102 button_pressed_(false) { 130 button_pressed_(false) {
103 RecordHistogramAction(one_click_signin::HISTOGRAM_SHOWN); 131 RecordHistogramAction(one_click_signin::HISTOGRAM_SHOWN);
104 } 132 }
105 133
106 OneClickLoginInfoBarDelegate::~OneClickLoginInfoBarDelegate() { 134 OneClickInfoBarDelegateImpl::~OneClickInfoBarDelegateImpl() {
107 if (!button_pressed_) 135 if (!button_pressed_)
108 RecordHistogramAction(one_click_signin::HISTOGRAM_IGNORED); 136 RecordHistogramAction(one_click_signin::HISTOGRAM_IGNORED);
109 } 137 }
110 138
111 void OneClickLoginInfoBarDelegate::InfoBarDismissed() { 139 InfoBarDelegate::InfoBarAutomationType
140 OneClickInfoBarDelegateImpl::GetInfoBarAutomationType() const {
141 return ONE_CLICK_LOGIN_INFOBAR;
142 }
143
144 void OneClickInfoBarDelegateImpl::InfoBarDismissed() {
112 RecordHistogramAction(one_click_signin::HISTOGRAM_DISMISSED); 145 RecordHistogramAction(one_click_signin::HISTOGRAM_DISMISSED);
113 button_pressed_ = true; 146 button_pressed_ = true;
114 } 147 }
115 148
116 gfx::Image* OneClickLoginInfoBarDelegate::GetIcon() const { 149 gfx::Image* OneClickInfoBarDelegateImpl::GetIcon() const {
117 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 150 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
118 IDR_INFOBAR_SYNC); 151 IDR_INFOBAR_SYNC);
119 } 152 }
120 153
121 InfoBarDelegate::Type OneClickLoginInfoBarDelegate::GetInfoBarType() const { 154 InfoBarDelegate::Type OneClickInfoBarDelegateImpl::GetInfoBarType() const {
122 return PAGE_ACTION_TYPE; 155 return PAGE_ACTION_TYPE;
123 } 156 }
124 157
125 string16 OneClickLoginInfoBarDelegate::GetMessageText() const { 158 string16 OneClickInfoBarDelegateImpl::GetMessageText() const {
126 return l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_INFOBAR_MESSAGE); 159 return l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_INFOBAR_MESSAGE);
127 } 160 }
128 161
129 string16 OneClickLoginInfoBarDelegate::GetButtonLabel( 162 string16 OneClickInfoBarDelegateImpl::GetButtonLabel(
130 InfoBarButton button) const { 163 InfoBarButton button) const {
131 return l10n_util::GetStringUTF16( 164 return l10n_util::GetStringUTF16(
132 (button == BUTTON_OK) ? IDS_ONE_CLICK_SIGNIN_INFOBAR_OK_BUTTON 165 (button == BUTTON_OK) ? IDS_ONE_CLICK_SIGNIN_INFOBAR_OK_BUTTON
133 : IDS_ONE_CLICK_SIGNIN_INFOBAR_CANCEL_BUTTON); 166 : IDS_ONE_CLICK_SIGNIN_INFOBAR_CANCEL_BUTTON);
134 } 167 }
135 168
136 namespace { 169 bool OneClickInfoBarDelegateImpl::Accept() {
137
138 // Start syncing with the given user information.
139 void StartSync(content::WebContents* web_contents,
140 const std::string& session_index,
141 const std::string& email,
142 const std::string& password,
143 OneClickSigninSyncStarter::StartSyncMode start_mode) {
144 // The starter deletes itself once its done.
145 Browser* browser = browser::FindBrowserWithWebContents(web_contents);
146 new OneClickSigninSyncStarter(browser, session_index, email, password,
147 start_mode);
148 }
149
150 } // namespace
151
152 bool OneClickLoginInfoBarDelegate::Accept() {
153 // User has accepted one-click sign-in for this account. Never ask again for 170 // User has accepted one-click sign-in for this account. Never ask again for
154 // this profile. 171 // this profile.
155 DisableOneClickSignIn(); 172 DisableOneClickSignIn();
156 content::WebContents* web_contents = owner()->GetWebContents(); 173 content::WebContents* web_contents = owner()->GetWebContents();
157 RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED); 174 RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED);
158 browser::FindBrowserWithWebContents(web_contents)->window()-> 175 browser::FindBrowserWithWebContents(web_contents)->window()->
159 ShowOneClickSigninBubble(base::Bind(&StartSync, web_contents, 176 ShowOneClickSigninBubble(base::Bind(&StartSync, web_contents,
160 session_index_, email_, password_)); 177 session_index_, email_, password_));
161 button_pressed_ = true; 178 button_pressed_ = true;
162 return true; 179 return true;
163 } 180 }
164 181
165 bool OneClickLoginInfoBarDelegate::Cancel() { 182 bool OneClickInfoBarDelegateImpl::Cancel() {
166 AddEmailToOneClickRejectedList(email_); 183 AddEmailToOneClickRejectedList(email_);
167 RecordHistogramAction(one_click_signin::HISTOGRAM_REJECTED); 184 RecordHistogramAction(one_click_signin::HISTOGRAM_REJECTED);
168 button_pressed_ = true; 185 button_pressed_ = true;
169 return true; 186 return true;
170 } 187 }
171 188
172 string16 OneClickLoginInfoBarDelegate::GetLinkText() const { 189 string16 OneClickInfoBarDelegateImpl::GetLinkText() const {
173 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 190 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
174 } 191 }
175 192
176 bool OneClickLoginInfoBarDelegate::LinkClicked( 193 bool OneClickInfoBarDelegateImpl::LinkClicked(
177 WindowOpenDisposition disposition) { 194 WindowOpenDisposition disposition) {
178 RecordHistogramAction(one_click_signin::HISTOGRAM_LEARN_MORE); 195 RecordHistogramAction(one_click_signin::HISTOGRAM_LEARN_MORE);
179 content::OpenURLParams params( 196 content::OpenURLParams params(
180 GURL(chrome::kChromeSyncLearnMoreURL), content::Referrer(), disposition, 197 GURL(chrome::kChromeSyncLearnMoreURL), content::Referrer(), disposition,
181 content::PAGE_TRANSITION_LINK, false); 198 content::PAGE_TRANSITION_LINK, false);
182 owner()->GetWebContents()->OpenURL(params); 199 owner()->GetWebContents()->OpenURL(params);
183 return false; 200 return false;
184 } 201 }
185 202
203 void OneClickInfoBarDelegateImpl::GetAlternateColors(
204 AlternateColors* alt_colors) {
205 if (use_blue_on_white) {
206 alt_colors->infobar_bottom_color = SK_ColorWHITE;
207 alt_colors->infobar_top_color = SK_ColorWHITE;
208 alt_colors->button_text_color = SK_ColorWHITE;
209 alt_colors->button_background_color = SkColorSetRGB(71, 135, 237);
210 alt_colors->button_border_color = SkColorSetRGB(48, 121, 237);
211 return;
212 }
186 213
187 InfoBarDelegate::InfoBarAutomationType 214 return OneClickSigninInfoBarDelegate::GetAlternateColors(alt_colors);
188 OneClickLoginInfoBarDelegate::GetInfoBarAutomationType() const {
189 return ONE_CLICK_LOGIN_INFOBAR;
190 } 215 }
191 216
192 void OneClickLoginInfoBarDelegate::DisableOneClickSignIn() { 217 void OneClickInfoBarDelegateImpl::DisableOneClickSignIn() {
193 PrefService* pref_service = 218 PrefService* pref_service =
194 TabContents::FromWebContents(owner()->GetWebContents())-> 219 TabContents::FromWebContents(owner()->GetWebContents())->
195 profile()->GetPrefs(); 220 profile()->GetPrefs();
196 pref_service->SetBoolean(prefs::kReverseAutologinEnabled, false); 221 pref_service->SetBoolean(prefs::kReverseAutologinEnabled, false);
197 } 222 }
198 223
199 void OneClickLoginInfoBarDelegate::AddEmailToOneClickRejectedList( 224 void OneClickInfoBarDelegateImpl::AddEmailToOneClickRejectedList(
200 const std::string& email) { 225 const std::string& email) {
201 PrefService* pref_service = 226 PrefService* pref_service =
202 TabContents::FromWebContents(owner()->GetWebContents())-> 227 TabContents::FromWebContents(owner()->GetWebContents())->
203 profile()->GetPrefs(); 228 profile()->GetPrefs();
204 ListPrefUpdate updater(pref_service, 229 ListPrefUpdate updater(pref_service,
205 prefs::kReverseAutologinRejectedEmailList); 230 prefs::kReverseAutologinRejectedEmailList);
206 updater->AppendIfNotPresent(base::Value::CreateStringValue(email)); 231 updater->AppendIfNotPresent(base::Value::CreateStringValue(email));
207 } 232 }
208 233
209 void OneClickLoginInfoBarDelegate::RecordHistogramAction(int action) { 234 void OneClickInfoBarDelegateImpl::RecordHistogramAction(int action) {
210 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action, 235 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", action,
211 one_click_signin::HISTOGRAM_MAX); 236 one_click_signin::HISTOGRAM_MAX);
212 } 237 }
213 238
214 // static 239 // static
215 bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents, 240 bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents,
216 const std::string& email, 241 const std::string& email,
217 bool check_connected) { 242 bool check_connected) {
218 if (!web_contents) 243 if (!web_contents)
219 return false; 244 return false;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 if (iter != rejected_emails->end()) 299 if (iter != rejected_emails->end())
275 return false; 300 return false;
276 } 301 }
277 } 302 }
278 } 303 }
279 304
280 return true; 305 return true;
281 } 306 }
282 307
283 // static 308 // static
309 void OneClickSigninHelper::InitializeFieldTrial() {
310 scoped_refptr<base::FieldTrial> trial(
311 base::FieldTrialList::FactoryGetFieldTrial("OneClickSignIn", 100,
312 "Standard", 2013, 9, 1, NULL));
313
314 // For dev and beta, we'll give half the people the new experience. For
315 // stable, only 1%. These numbers are overridable on the server.
316 const bool kIsStableChannel =
317 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE;
318 const int kBlueOnWhiteGroup = trial->AppendGroup("BlueOnWhite",
319 kIsStableChannel ? 1 : 50);
320 use_blue_on_white = trial->group() == kBlueOnWhiteGroup;
321 }
322
323 // static
284 void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request, 324 void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request,
285 int child_id, 325 int child_id,
286 int route_id) { 326 int route_id) {
287 // See if the response contains the Google-Accounts-SignIn header. 327 // See if the response contains the Google-Accounts-SignIn header.
288 std::string value; 328 std::string value;
289 request->GetResponseHeaderByName("Google-Accounts-SignIn", &value); 329 request->GetResponseHeaderByName("Google-Accounts-SignIn", &value);
290 if (value.empty()) 330 if (value.empty())
291 return; 331 return;
292 332
293 std::vector<std::pair<std::string, std::string> > pairs; 333 std::vector<std::pair<std::string, std::string> > pairs;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 } 398 }
359 399
360 void OneClickSigninHelper::DidStopLoading( 400 void OneClickSigninHelper::DidStopLoading(
361 content::RenderViewHost* render_view_host) { 401 content::RenderViewHost* render_view_host) {
362 if (email_.empty() || password_.empty()) 402 if (email_.empty() || password_.empty())
363 return; 403 return;
364 404
365 TabContents* tab_contents = TabContents::FromWebContents(web_contents()); 405 TabContents* tab_contents = TabContents::FromWebContents(web_contents());
366 406
367 tab_contents->infobar_tab_helper()->AddInfoBar( 407 tab_contents->infobar_tab_helper()->AddInfoBar(
368 new OneClickLoginInfoBarDelegate(tab_contents->infobar_tab_helper(), 408 new OneClickInfoBarDelegateImpl(tab_contents->infobar_tab_helper(),
369 session_index_, email_, password_)); 409 session_index_, email_, password_));
SteveT 2012/09/11 02:16:25 nit: Line up second line here.
Roger Tawa OOO till Jul 10th 2012/09/11 19:23:21 Done.
370 410
371 email_.clear(); 411 email_.clear();
372 password_.clear(); 412 password_.clear();
373 } 413 }
374 414
375 void OneClickSigninHelper::SaveSessionIndexAndEmail( 415 void OneClickSigninHelper::SaveSessionIndexAndEmail(
376 const std::string& session_index, 416 const std::string& session_index,
377 const std::string& email) { 417 const std::string& email) {
378 session_index_ = session_index; 418 session_index_ = session_index;
379 email_ = email; 419 email_ = email;
380 } 420 }
381 421
382 void OneClickSigninHelper::SavePassword(const std::string& password) { 422 void OneClickSigninHelper::SavePassword(const std::string& password) {
383 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of 423 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of
384 // challenge, its possible for the user to never complete the signin. 424 // challenge, its possible for the user to never complete the signin.
385 // Should have a way to detect this and clear the password member. 425 // Should have a way to detect this and clear the password member.
386 password_ = password; 426 password_ = password;
387 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698