| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "base/thread.h" | 11 #include "base/thread.h" |
| 12 #include "chrome/browser/password_manager/login_database.h" | 12 #include "chrome/browser/password_manager/login_database.h" |
| 13 #include "chrome/browser/password_manager/password_store.h" | 13 #include "chrome/browser/password_manager/password_store.h" |
| 14 #include "chrome/common/notification_service.h" | |
| 15 | 14 |
| 16 class MacKeychain; | 15 class MacKeychain; |
| 17 | 16 |
| 18 // Implements PasswordStore on top of the OS X Keychain, with an internal | 17 // Implements PasswordStore on top of the OS X Keychain, with an internal |
| 19 // database for extra metadata. For an overview of the interactions with the | 18 // database for extra metadata. For an overview of the interactions with the |
| 20 // Keychain, as well as the rationale for some of the behaviors, see the | 19 // Keychain, as well as the rationale for some of the behaviors, see the |
| 21 // Keychain integration design doc: | 20 // Keychain integration design doc: |
| 22 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration | 21 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration |
| 23 class PasswordStoreMac : public PasswordStore { | 22 class PasswordStoreMac : public PasswordStore { |
| 24 public: | 23 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); | 61 std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); |
| 63 | 62 |
| 64 // Removes the given forms from the database. | 63 // Removes the given forms from the database. |
| 65 void RemoveDatabaseForms( | 64 void RemoveDatabaseForms( |
| 66 const std::vector<webkit_glue::PasswordForm*>& forms); | 65 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 67 | 66 |
| 68 // Removes the given forms from the Keychain. | 67 // Removes the given forms from the Keychain. |
| 69 void RemoveKeychainForms( | 68 void RemoveKeychainForms( |
| 70 const std::vector<webkit_glue::PasswordForm*>& forms); | 69 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 71 | 70 |
| 72 // Allows the creation of |notification_service_| to be scheduled on the right | |
| 73 // thread. | |
| 74 void CreateNotificationService(); | |
| 75 | |
| 76 scoped_ptr<MacKeychain> keychain_; | 71 scoped_ptr<MacKeychain> keychain_; |
| 77 scoped_ptr<LoginDatabase> login_metadata_db_; | 72 scoped_ptr<LoginDatabase> login_metadata_db_; |
| 78 | 73 |
| 79 // Thread that the synchronous methods are run on. | 74 // Thread that the synchronous methods are run on. |
| 80 scoped_ptr<base::Thread> thread_; | 75 scoped_ptr<base::Thread> thread_; |
| 81 | 76 |
| 82 // Since we aren't running on a well-known thread but still want to send out | |
| 83 // notifications, we need to run our own service. | |
| 84 scoped_ptr<NotificationService> notification_service_; | |
| 85 | |
| 86 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); | 77 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
| 87 }; | 78 }; |
| 88 | 79 |
| 89 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 80 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
| OLD | NEW |