OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 protected: | 37 protected: |
38 virtual ~PasswordStoreMac(); | 38 virtual ~PasswordStoreMac(); |
39 | 39 |
40 // Schedules tasks on |thread_|. | 40 // Schedules tasks on |thread_|. |
41 virtual void ScheduleTask(Task* task) OVERRIDE; | 41 virtual void ScheduleTask(Task* task) OVERRIDE; |
42 virtual void ScheduleTask(const base::Closure& task) OVERRIDE; | 42 virtual void ScheduleTask(const base::Closure& task) OVERRIDE; |
43 | 43 |
44 private: | 44 private: |
45 virtual void ReportMetricsImpl() OVERRIDE; | 45 virtual void ReportMetricsImpl() OVERRIDE; |
46 virtual void AddLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; | 46 virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; |
47 virtual void UpdateLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; | 47 virtual void UpdateLoginImpl( |
48 virtual void RemoveLoginImpl(const webkit_glue::PasswordForm& form) OVERRIDE; | 48 const webkit::forms::PasswordForm& form) OVERRIDE; |
| 49 virtual void RemoveLoginImpl( |
| 50 const webkit::forms::PasswordForm& form) OVERRIDE; |
49 virtual void RemoveLoginsCreatedBetweenImpl( | 51 virtual void RemoveLoginsCreatedBetweenImpl( |
50 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; | 52 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; |
51 virtual void GetLoginsImpl(GetLoginsRequest* request, | 53 virtual void GetLoginsImpl(GetLoginsRequest* request, |
52 const webkit_glue::PasswordForm& form) OVERRIDE; | 54 const webkit::forms::PasswordForm& form) OVERRIDE; |
53 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 55 virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
54 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; | 56 virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; |
55 virtual bool FillAutofillableLogins( | 57 virtual bool FillAutofillableLogins( |
56 std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; | 58 std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; |
57 virtual bool FillBlacklistLogins( | 59 virtual bool FillBlacklistLogins( |
58 std::vector<webkit_glue::PasswordForm*>* forms) OVERRIDE; | 60 std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; |
59 | 61 |
60 // Adds the given form to the Keychain if it's something we want to store | 62 // Adds the given form to the Keychain if it's something we want to store |
61 // there (i.e., not a blacklist entry). Returns true if the operation | 63 // there (i.e., not a blacklist entry). Returns true if the operation |
62 // succeeded (either we added successfully, or we didn't need to). | 64 // succeeded (either we added successfully, or we didn't need to). |
63 bool AddToKeychainIfNecessary(const webkit_glue::PasswordForm& form); | 65 bool AddToKeychainIfNecessary(const webkit::forms::PasswordForm& form); |
64 | 66 |
65 // Returns true if our database contains a form that exactly matches the given | 67 // Returns true if our database contains a form that exactly matches the given |
66 // keychain form. | 68 // keychain form. |
67 bool DatabaseHasFormMatchingKeychainForm( | 69 bool DatabaseHasFormMatchingKeychainForm( |
68 const webkit_glue::PasswordForm& form); | 70 const webkit::forms::PasswordForm& form); |
69 | 71 |
70 // Returns all the Keychain entries that we own but no longer have | 72 // Returns all the Keychain entries that we own but no longer have |
71 // corresponding metadata for in our database. | 73 // corresponding metadata for in our database. |
72 // Caller is responsible for deleting the forms. | 74 // Caller is responsible for deleting the forms. |
73 std::vector<webkit_glue::PasswordForm*> GetUnusedKeychainForms(); | 75 std::vector<webkit::forms::PasswordForm*> GetUnusedKeychainForms(); |
74 | 76 |
75 // Removes the given forms from the database. | 77 // Removes the given forms from the database. |
76 void RemoveDatabaseForms( | 78 void RemoveDatabaseForms( |
77 const std::vector<webkit_glue::PasswordForm*>& forms); | 79 const std::vector<webkit::forms::PasswordForm*>& forms); |
78 | 80 |
79 // Removes the given forms from the Keychain. | 81 // Removes the given forms from the Keychain. |
80 void RemoveKeychainForms( | 82 void RemoveKeychainForms( |
81 const std::vector<webkit_glue::PasswordForm*>& forms); | 83 const std::vector<webkit::forms::PasswordForm*>& forms); |
82 | 84 |
83 // Allows the creation of |notification_service_| to be scheduled on the right | 85 // Allows the creation of |notification_service_| to be scheduled on the right |
84 // thread. | 86 // thread. |
85 void CreateNotificationService(); | 87 void CreateNotificationService(); |
86 | 88 |
87 scoped_ptr<MacKeychain> keychain_; | 89 scoped_ptr<MacKeychain> keychain_; |
88 scoped_ptr<LoginDatabase> login_metadata_db_; | 90 scoped_ptr<LoginDatabase> login_metadata_db_; |
89 | 91 |
90 // Thread that the synchronous methods are run on. | 92 // Thread that the synchronous methods are run on. |
91 scoped_ptr<base::Thread> thread_; | 93 scoped_ptr<base::Thread> thread_; |
92 | 94 |
93 // Since we aren't running on a well-known thread but still want to send out | 95 // Since we aren't running on a well-known thread but still want to send out |
94 // notifications, we need to run our own service. | 96 // notifications, we need to run our own service. |
95 scoped_ptr<content::NotificationService> notification_service_; | 97 scoped_ptr<content::NotificationService> notification_service_; |
96 | 98 |
97 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); | 99 DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); |
98 }; | 100 }; |
99 | 101 |
100 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ | 102 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_MAC_H_ |
OLD | NEW |