| OLD | NEW |
| 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 Loading... |
| 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_); | |
| 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 Loading... |
| 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 } |
| OLD | NEW |