| 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 10 #include "chrome/browser/password_manager/password_store_factory.h" | 10 #include "chrome/browser/password_manager/password_store_factory.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 using autofill::PasswordFormMap; | 29 using autofill::PasswordFormMap; |
| 30 using password_manager::PasswordFormManager; | 30 using password_manager::PasswordFormManager; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 password_manager::PasswordStore* GetPasswordStore( | 34 password_manager::PasswordStore* GetPasswordStore( |
| 35 content::WebContents* web_contents) { | 35 content::WebContents* web_contents) { |
| 36 return PasswordStoreFactory::GetForProfile( | 36 return PasswordStoreFactory::GetForProfile( |
| 37 Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 37 Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
| 38 Profile::EXPLICIT_ACCESS).get(); | 38 ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 autofill::ConstPasswordFormMap ConstifyMap( | 41 autofill::ConstPasswordFormMap ConstifyMap( |
| 42 const autofill::PasswordFormMap& map) { | 42 const autofill::PasswordFormMap& map) { |
| 43 autofill::ConstPasswordFormMap ret; | 43 autofill::ConstPasswordFormMap ret; |
| 44 ret.insert(map.begin(), map.end()); | 44 ret.insert(map.begin(), map.end()); |
| 45 return ret; | 45 return ret; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Performs a deep copy of the PasswordForm pointers in |map|. The resulting map | 48 // Performs a deep copy of the PasswordForm pointers in |map|. The resulting map |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 352 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
| 353 return password_manager::ui::IsPendingState(state_); | 353 return password_manager::ui::IsPendingState(state_); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void ManagePasswordsUIController::WebContentsDestroyed() { | 356 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 357 password_manager::PasswordStore* password_store = | 357 password_manager::PasswordStore* password_store = |
| 358 GetPasswordStore(web_contents()); | 358 GetPasswordStore(web_contents()); |
| 359 if (password_store) | 359 if (password_store) |
| 360 password_store->RemoveObserver(this); | 360 password_store->RemoveObserver(this); |
| 361 } | 361 } |
| OLD | NEW |