| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 void ManagePasswordsBubbleModel::OnBubbleHidden() { | 193 void ManagePasswordsBubbleModel::OnBubbleHidden() { |
| 194 ManagePasswordsUIController* manage_passwords_ui_controller = | 194 ManagePasswordsUIController* manage_passwords_ui_controller = |
| 195 web_contents() ? | 195 web_contents() ? |
| 196 ManagePasswordsUIController::FromWebContents(web_contents()) | 196 ManagePasswordsUIController::FromWebContents(web_contents()) |
| 197 : nullptr; | 197 : nullptr; |
| 198 if (state_ == password_manager::ui::CREDENTIAL_REQUEST_STATE && | 198 if (state_ == password_manager::ui::CREDENTIAL_REQUEST_STATE && |
| 199 manage_passwords_ui_controller) { | 199 manage_passwords_ui_controller) { |
| 200 // It's time to run the pending callback if it wasn't called in | 200 // It's time to run the pending callback if it wasn't called in |
| 201 // OnChooseCredentials(). | 201 // OnChooseCredentials(). |
| 202 // TODO(vasilii): remove this. It's not a bubble's problem because the |
| 203 // controller is notified anyway about closed bubble. |
| 202 manage_passwords_ui_controller->ChooseCredential( | 204 manage_passwords_ui_controller->ChooseCredential( |
| 203 autofill::PasswordForm(), | 205 autofill::PasswordForm(), |
| 204 password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY); | 206 password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY); |
| 205 state_ = password_manager::ui::INACTIVE_STATE; | 207 state_ = password_manager::ui::INACTIVE_STATE; |
| 206 } | 208 } |
| 207 if (manage_passwords_ui_controller) | 209 if (manage_passwords_ui_controller) |
| 208 manage_passwords_ui_controller->OnBubbleHidden(); | 210 manage_passwords_ui_controller->OnBubbleHidden(); |
| 209 if (dismissal_reason_ == metrics_util::NOT_DISPLAYED) | 211 if (dismissal_reason_ == metrics_util::NOT_DISPLAYED) |
| 210 return; | 212 return; |
| 211 | 213 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 316 |
| 315 // static | 317 // static |
| 316 int ManagePasswordsBubbleModel::UsernameFieldWidth() { | 318 int ManagePasswordsBubbleModel::UsernameFieldWidth() { |
| 317 return GetFieldWidth(USERNAME_FIELD); | 319 return GetFieldWidth(USERNAME_FIELD); |
| 318 } | 320 } |
| 319 | 321 |
| 320 // static | 322 // static |
| 321 int ManagePasswordsBubbleModel::PasswordFieldWidth() { | 323 int ManagePasswordsBubbleModel::PasswordFieldWidth() { |
| 322 return GetFieldWidth(PASSWORD_FIELD); | 324 return GetFieldWidth(PASSWORD_FIELD); |
| 323 } | 325 } |
| OLD | NEW |