| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 ManagePasswordsUIController::GetFederatedForms() const { | 240 ManagePasswordsUIController::GetFederatedForms() const { |
| 241 return passwords_data_.federation_providers_forms(); | 241 return passwords_data_.federation_providers_forms(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 const password_manager::InteractionsStats* | 244 const password_manager::InteractionsStats* |
| 245 ManagePasswordsUIController::GetCurrentInteractionStats() const { | 245 ManagePasswordsUIController::GetCurrentInteractionStats() const { |
| 246 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_STATE, GetState()); | 246 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_STATE, GetState()); |
| 247 password_manager::PasswordFormManager* form_manager = | 247 password_manager::PasswordFormManager* form_manager = |
| 248 passwords_data_.form_manager(); | 248 passwords_data_.form_manager(); |
| 249 return password_manager::FindStatsByUsername( | 249 return password_manager::FindStatsByUsername( |
| 250 form_manager->interactions_stats(), | 250 form_manager->form_fetcher()->GetInteractionsStats(), |
| 251 form_manager->pending_credentials().username_value); | 251 form_manager->pending_credentials().username_value); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void ManagePasswordsUIController::OnBubbleShown() { | 254 void ManagePasswordsUIController::OnBubbleShown() { |
| 255 bubble_status_ = SHOWN; | 255 bubble_status_ = SHOWN; |
| 256 } | 256 } |
| 257 | 257 |
| 258 void ManagePasswordsUIController::OnBubbleHidden() { | 258 void ManagePasswordsUIController::OnBubbleHidden() { |
| 259 bool update_icon = (bubble_status_ == SHOWN_PENDING_ICON_UPDATE); | 259 bool update_icon = (bubble_status_ == SHOWN_PENDING_ICON_UPDATE); |
| 260 bubble_status_ = NOT_SHOWN; | 260 bubble_status_ = NOT_SHOWN; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); | 453 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 | 456 |
| 457 void ManagePasswordsUIController::WebContentsDestroyed() { | 457 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 458 password_manager::PasswordStore* password_store = | 458 password_manager::PasswordStore* password_store = |
| 459 GetPasswordStore(web_contents()); | 459 GetPasswordStore(web_contents()); |
| 460 if (password_store) | 460 if (password_store) |
| 461 password_store->RemoveObserver(this); | 461 password_store->RemoveObserver(this); |
| 462 } | 462 } |
| OLD | NEW |