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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model.cc

Issue 1022843003: New smart passsword bubble algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/passwords/manage_passwords_bubble_model.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/password_manager/password_store_factory.h" 9 #include "chrome/browser/password_manager/password_store_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (action == REMOVE_PASSWORD) 266 if (action == REMOVE_PASSWORD)
267 password_store->RemoveLogin(password_form); 267 password_store->RemoveLogin(password_form);
268 else 268 else
269 password_store->AddLogin(password_form); 269 password_store->AddLogin(password_form);
270 } 270 }
271 271
272 void ManagePasswordsBubbleModel::OnChooseCredentials( 272 void ManagePasswordsBubbleModel::OnChooseCredentials(
273 const autofill::PasswordForm& password_form, 273 const autofill::PasswordForm& password_form,
274 password_manager::CredentialType credential_type) { 274 password_manager::CredentialType credential_type) {
275 dismissal_reason_ = metrics_util::CLICKED_CREDENTIAL; 275 dismissal_reason_ = metrics_util::CLICKED_CREDENTIAL;
276 RecordExperimentStatistics(web_contents(), dismissal_reason_);
vabr (Chromium) 2015/03/24 09:09:04 Was this removed, because metrics_util::CLICKED_CR
vasilii 2015/03/24 10:30:53 The credential chooser bubble has nothing to do wi
277 ManagePasswordsUIController* manage_passwords_ui_controller = 276 ManagePasswordsUIController* manage_passwords_ui_controller =
278 ManagePasswordsUIController::FromWebContents(web_contents()); 277 ManagePasswordsUIController::FromWebContents(web_contents());
279 manage_passwords_ui_controller->ChooseCredential(password_form, 278 manage_passwords_ui_controller->ChooseCredential(password_form,
280 credential_type); 279 credential_type);
281 state_ = password_manager::ui::INACTIVE_STATE; 280 state_ = password_manager::ui::INACTIVE_STATE;
282 } 281 }
283 282
284 Profile* ManagePasswordsBubbleModel::GetProfile() const { 283 Profile* ManagePasswordsBubbleModel::GetProfile() const {
285 return GetProfileFromWebContents(web_contents()); 284 return GetProfileFromWebContents(web_contents());
286 } 285 }
(...skipping 17 matching lines...) Expand all
304 ManagePasswordsBubbleModel::PendingStateTitleBasedOnSavePasswordPref() const { 303 ManagePasswordsBubbleModel::PendingStateTitleBasedOnSavePasswordPref() const {
305 int message_id = 0; 304 int message_id = 0;
306 if (never_save_passwords_) 305 if (never_save_passwords_)
307 message_id = IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE; 306 message_id = IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE;
308 else if (IsNewUIActive()) 307 else if (IsNewUIActive())
309 message_id = IDS_PASSWORD_MANAGER_SAVE_PASSWORD_SMART_LOCK_PROMPT; 308 message_id = IDS_PASSWORD_MANAGER_SAVE_PASSWORD_SMART_LOCK_PROMPT;
310 else 309 else
311 message_id = IDS_SAVE_PASSWORD; 310 message_id = IDS_SAVE_PASSWORD;
312 return l10n_util::GetStringUTF16(message_id); 311 return l10n_util::GetStringUTF16(message_id);
313 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698