OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/prefs/pref_member.h" | 14 #include "base/prefs/pref_member.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "chrome/browser/password_manager/password_form_manager.h" | 16 #include "chrome/browser/password_manager/password_form_manager.h" |
17 #include "chrome/browser/ui/login/login_model.h" | 17 #include "chrome/browser/ui/login/login_model.h" |
18 #include "components/autofill/core/common/password_form.h" | 18 #include "components/autofill/core/common/password_form.h" |
19 #include "components/autofill/core/common/password_form_fill_data.h" | 19 #include "components/autofill/core/common/password_form_fill_data.h" |
20 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
21 #include "content/public/browser/web_contents_user_data.h" | 21 #include "content/public/browser/web_contents_user_data.h" |
22 | 22 |
23 class PasswordManagerDelegate; | 23 class PasswordManagerDelegate; |
24 class PasswordManagerTest; | 24 class PasswordManagerTest; |
25 class PasswordFormManager; | 25 class PasswordFormManager; |
| 26 class PrefRegistrySimple; |
26 | 27 |
27 namespace user_prefs { | 28 namespace user_prefs { |
28 class PrefRegistrySyncable; | 29 class PrefRegistrySyncable; |
29 } | 30 } |
30 | 31 |
31 // Per-tab password manager. Handles creation and management of UI elements, | 32 // Per-tab password manager. Handles creation and management of UI elements, |
32 // receiving password form data from the renderer and managing the password | 33 // receiving password form data from the renderer and managing the password |
33 // database through the PasswordStore. The PasswordManager is a LoginModel | 34 // database through the PasswordStore. The PasswordManager is a LoginModel |
34 // for purposes of supporting HTTP authentication dialogs. | 35 // for purposes of supporting HTTP authentication dialogs. |
35 class PasswordManager : public LoginModel, | 36 class PasswordManager : public LoginModel, |
36 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
37 public content::WebContentsUserData<PasswordManager> { | 38 public content::WebContentsUserData<PasswordManager> { |
38 public: | 39 public: |
39 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 40 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
40 | 41 #if defined(OS_WIN) |
| 42 static void RegisterLocalPrefs(PrefRegistrySimple* registry); |
| 43 #endif |
41 static void CreateForWebContentsAndDelegate( | 44 static void CreateForWebContentsAndDelegate( |
42 content::WebContents* contents, | 45 content::WebContents* contents, |
43 PasswordManagerDelegate* delegate); | 46 PasswordManagerDelegate* delegate); |
44 virtual ~PasswordManager(); | 47 virtual ~PasswordManager(); |
45 | 48 |
46 typedef base::Callback<void(const autofill::PasswordForm&)> | 49 typedef base::Callback<void(const autofill::PasswordForm&)> |
47 PasswordSubmittedCallback; | 50 PasswordSubmittedCallback; |
48 | 51 |
49 // There is no corresponding remove function as currently all of the | 52 // There is no corresponding remove function as currently all of the |
50 // owners of these callbacks have sufficient lifetimes so that the callbacks | 53 // owners of these callbacks have sufficient lifetimes so that the callbacks |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // notification in const member functions. | 174 // notification in const member functions. |
172 mutable ObserverList<LoginModelObserver> observers_; | 175 mutable ObserverList<LoginModelObserver> observers_; |
173 | 176 |
174 // Callbacks to be notified when a password form has been submitted. | 177 // Callbacks to be notified when a password form has been submitted. |
175 std::vector<PasswordSubmittedCallback> submission_callbacks_; | 178 std::vector<PasswordSubmittedCallback> submission_callbacks_; |
176 | 179 |
177 DISALLOW_COPY_AND_ASSIGN(PasswordManager); | 180 DISALLOW_COPY_AND_ASSIGN(PasswordManager); |
178 }; | 181 }; |
179 | 182 |
180 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ | 183 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
OLD | NEW |