| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 timer_.reset(new base::ElapsedTimer); | 115 timer_.reset(new base::ElapsedTimer); |
| 116 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); | 116 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); |
| 117 UpdateBubbleAndIconVisibility(); | 117 UpdateBubbleAndIconVisibility(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool ManagePasswordsUIController::OnChooseCredentials( | 120 bool ManagePasswordsUIController::OnChooseCredentials( |
| 121 ScopedVector<autofill::PasswordForm> local_credentials, | 121 ScopedVector<autofill::PasswordForm> local_credentials, |
| 122 ScopedVector<autofill::PasswordForm> federated_credentials, | 122 ScopedVector<autofill::PasswordForm> federated_credentials, |
| 123 const GURL& origin, | 123 const GURL& origin, |
| 124 base::Callback<void(const password_manager::CredentialInfo&)> callback) { | 124 base::Callback<void(const password_manager::CredentialInfo&)> callback) { |
| 125 DCHECK_IMPLIES(local_credentials.empty(), !federated_credentials.empty()); | 125 DCHECK(!local_credentials.empty() || !federated_credentials.empty()); |
| 126 passwords_data_.OnRequestCredentials(local_credentials.Pass(), | 126 passwords_data_.OnRequestCredentials(local_credentials.Pass(), |
| 127 federated_credentials.Pass(), | 127 federated_credentials.Pass(), |
| 128 origin); | 128 origin); |
| 129 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); | 129 base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); |
| 130 #if defined(OS_ANDROID) | 130 #if defined(OS_ANDROID) |
| 131 UpdateAndroidAccountChooserInfoBarVisibility(); | 131 UpdateAndroidAccountChooserInfoBarVisibility(); |
| 132 #else | 132 #else |
| 133 UpdateBubbleAndIconVisibility(); | 133 UpdateBubbleAndIconVisibility(); |
| 134 #endif | 134 #endif |
| 135 if (!should_pop_up_bubble_) { | 135 if (!should_pop_up_bubble_) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && | 411 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && |
| 412 GetCurrentForms().size() > 1 && !PasswordOverridden(); | 412 GetCurrentForms().size() > 1 && !PasswordOverridden(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 void ManagePasswordsUIController::WebContentsDestroyed() { | 415 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 416 password_manager::PasswordStore* password_store = | 416 password_manager::PasswordStore* password_store = |
| 417 GetPasswordStore(web_contents()); | 417 GetPasswordStore(web_contents()); |
| 418 if (password_store) | 418 if (password_store) |
| 419 password_store->RemoveObserver(this); | 419 password_store->RemoveObserver(this); |
| 420 } | 420 } |
| OLD | NEW |