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 "chrome/browser/password_manager/password_store_factory.h" | 7 #include "chrome/browser/password_manager/password_store_factory.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void ManagePasswordsBubbleModel::OnChooseCredentials( | 319 void ManagePasswordsBubbleModel::OnChooseCredentials( |
320 const autofill::PasswordForm& password_form) { | 320 const autofill::PasswordForm& password_form) { |
321 dismissal_reason_ = metrics_util::CLICKED_CREDENTIAL; | 321 dismissal_reason_ = metrics_util::CLICKED_CREDENTIAL; |
322 RecordExperimentStatistics(web_contents(), dismissal_reason_); | 322 RecordExperimentStatistics(web_contents(), dismissal_reason_); |
323 ManagePasswordsUIController* manage_passwords_ui_controller = | 323 ManagePasswordsUIController* manage_passwords_ui_controller = |
324 ManagePasswordsUIController::FromWebContents(web_contents()); | 324 ManagePasswordsUIController::FromWebContents(web_contents()); |
325 manage_passwords_ui_controller->ChooseCredential(true, password_form); | 325 manage_passwords_ui_controller->ChooseCredential(true, password_form); |
326 state_ = password_manager::ui::INACTIVE_STATE; | 326 state_ = password_manager::ui::INACTIVE_STATE; |
327 } | 327 } |
328 | 328 |
| 329 Profile* ManagePasswordsBubbleModel::GetProfile() const { |
| 330 return GetProfileFromWebContents(web_contents()); |
| 331 } |
| 332 |
329 // static | 333 // static |
330 int ManagePasswordsBubbleModel::UsernameFieldWidth() { | 334 int ManagePasswordsBubbleModel::UsernameFieldWidth() { |
331 return GetFieldWidth(USERNAME_FIELD); | 335 return GetFieldWidth(USERNAME_FIELD); |
332 } | 336 } |
333 | 337 |
334 // static | 338 // static |
335 int ManagePasswordsBubbleModel::PasswordFieldWidth() { | 339 int ManagePasswordsBubbleModel::PasswordFieldWidth() { |
336 return GetFieldWidth(PASSWORD_FIELD); | 340 return GetFieldWidth(PASSWORD_FIELD); |
337 } | 341 } |
OLD | NEW |