| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 : content::WebContentsObserver(web_contents), | 61 : content::WebContentsObserver(web_contents), |
| 62 should_pop_up_bubble_(false) { | 62 should_pop_up_bubble_(false) { |
| 63 passwords_data_.set_client( | 63 passwords_data_.set_client( |
| 64 ChromePasswordManagerClient::FromWebContents(web_contents)); | 64 ChromePasswordManagerClient::FromWebContents(web_contents)); |
| 65 password_manager::PasswordStore* password_store = | 65 password_manager::PasswordStore* password_store = |
| 66 GetPasswordStore(web_contents); | 66 GetPasswordStore(web_contents); |
| 67 if (password_store) | 67 if (password_store) |
| 68 password_store->AddObserver(this); | 68 password_store->AddObserver(this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 ManagePasswordsUIController::~ManagePasswordsUIController() {} | 71 ManagePasswordsUIController::~ManagePasswordsUIController() { |
| 72 if (dialog_controller_) |
| 73 OnDialogHidden(); |
| 74 } |
| 72 | 75 |
| 73 void ManagePasswordsUIController::OnPasswordSubmitted( | 76 void ManagePasswordsUIController::OnPasswordSubmitted( |
| 74 scoped_ptr<PasswordFormManager> form_manager) { | 77 scoped_ptr<PasswordFormManager> form_manager) { |
| 75 bool show_bubble = !form_manager->IsBlacklisted(); | 78 bool show_bubble = !form_manager->IsBlacklisted(); |
| 76 DestroyAccountChooser(); | 79 DestroyAccountChooser(); |
| 77 passwords_data_.OnPendingPassword(std::move(form_manager)); | 80 passwords_data_.OnPendingPassword(std::move(form_manager)); |
| 78 if (show_bubble) { | 81 if (show_bubble) { |
| 79 password_manager::InteractionsStats* stats = GetCurrentInteractionStats(); | 82 password_manager::InteractionsStats* stats = GetCurrentInteractionStats(); |
| 80 const int show_threshold = | 83 const int show_threshold = |
| 81 password_bubble_experiment::GetSmartBubbleDismissalThreshold(); | 84 password_bubble_experiment::GetSmartBubbleDismissalThreshold(); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); | 422 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); |
| 420 } | 423 } |
| 421 } | 424 } |
| 422 | 425 |
| 423 void ManagePasswordsUIController::WebContentsDestroyed() { | 426 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 424 password_manager::PasswordStore* password_store = | 427 password_manager::PasswordStore* password_store = |
| 425 GetPasswordStore(web_contents()); | 428 GetPasswordStore(web_contents()); |
| 426 if (password_store) | 429 if (password_store) |
| 427 password_store->RemoveObserver(this); | 430 password_store->RemoveObserver(this); |
| 428 } | 431 } |
| OLD | NEW |