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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && | 417 return state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && |
418 GetCurrentForms().size() > 1 && !PasswordOverridden(); | 418 GetCurrentForms().size() > 1 && !PasswordOverridden(); |
419 } | 419 } |
420 | 420 |
421 void ManagePasswordsUIController::WebContentsDestroyed() { | 421 void ManagePasswordsUIController::WebContentsDestroyed() { |
422 password_manager::PasswordStore* password_store = | 422 password_manager::PasswordStore* password_store = |
423 GetPasswordStore(web_contents()); | 423 GetPasswordStore(web_contents()); |
424 if (password_store) | 424 if (password_store) |
425 password_store->RemoveObserver(this); | 425 password_store->RemoveObserver(this); |
426 } | 426 } |
OLD | NEW |