| 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" |
| 14 | 15 |
| 15 class MacKeychain; | 16 class MacKeychain; |
| 16 | 17 |
| 17 // Implements PasswordStore on top of the OS X Keychain, with an internal | 18 // Implements PasswordStore on top of the OS X Keychain, with an internal |
| 18 // database for extra metadata. For an overview of the interactions with the | 19 // database for extra metadata. For an overview of the interactions with the |
| 19 // Keychain, as well as the rationale for some of the behaviors, see the | 20 // Keychain, as well as the rationale for some of the behaviors, see the |
| 20 // Keychain integration design doc: | 21 // Keychain integration design doc: |
| 21 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration | 22 // http://dev.chromium.org/developers/design-documents/os-x-password-manager-key
chain-integration |
| 22 class PasswordStoreMac : public PasswordStore { | 23 class PasswordStoreMac : public PasswordStore { |
| 23 public: | 24 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); | 62 std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); |
| 62 | 63 |
| 63 // Removes the given forms from the database. | 64 // Removes the given forms from the database. |
| 64 void RemoveDatabaseForms( | 65 void RemoveDatabaseForms( |
| 65 const std::vector<webkit_glue::PasswordForm*>& forms); | 66 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 66 | 67 |
| 67 // Removes the given forms from the Keychain. | 68 // Removes the given forms from the Keychain. |
| 68 void RemoveKeychainForms( | 69 void RemoveKeychainForms( |
| 69 const std::vector<webkit_glue::PasswordForm*>& forms); | 70 const std::vector<webkit_glue::PasswordForm*>& forms); |
| 70 | 71 |
| 72 // Allows the creation of |notification_service_| to be scheduled on the right |
| 73 // thread. |
| 74 void CreateNotificationService(); |
| 75 |
| 71 scoped_ptr<MacKeychain> keychain_; | 76 scoped_ptr<MacKeychain> keychain_; |
| 72 scoped_ptr<LoginDatabase> login_metadata_db_; | 77 scoped_ptr<LoginDatabase> login_metadata_db_; |
| 73 | 78 |
| 74 // Thread that the synchronous methods are run on. | 79 // Thread that the synchronous methods are run on. |
| 75 scoped_ptr<base::Thread> thread_; | 80 scoped_ptr<base::Thread> thread_; |
| 76 | 81 |
| 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 |
| 77 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); | 86 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
| 78 }; | 87 }; |
| 79 | 88 |
| 80 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 89 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
| OLD | NEW |