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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" | 10 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const std::string& experiment_name) OVERRIDE; | 52 const std::string& experiment_name) OVERRIDE; |
53 virtual bool IsPasswordSyncEnabled() OVERRIDE; | 53 virtual bool IsPasswordSyncEnabled() OVERRIDE; |
54 virtual void SetLogger(password_manager::PasswordManagerLogger* logger) | 54 virtual void SetLogger(password_manager::PasswordManagerLogger* logger) |
55 OVERRIDE; | 55 OVERRIDE; |
56 virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE; | 56 virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE; |
57 virtual bool IsLoggingActive() const OVERRIDE; | 57 virtual bool IsLoggingActive() const OVERRIDE; |
58 | 58 |
59 // Hides any visible generation UI. | 59 // Hides any visible generation UI. |
60 void HidePasswordGenerationPopup(); | 60 void HidePasswordGenerationPopup(); |
61 | 61 |
| 62 static void CreateForWebContentsWithAutofillManagerDelegate( |
| 63 content::WebContents* contents, |
| 64 autofill::AutofillManagerDelegate* delegate); |
| 65 |
62 // Convenience method to allow //chrome code easy access to a PasswordManager | 66 // Convenience method to allow //chrome code easy access to a PasswordManager |
63 // from a WebContents instance. | 67 // from a WebContents instance. |
64 static password_manager::PasswordManager* GetManagerFromWebContents( | 68 static password_manager::PasswordManager* GetManagerFromWebContents( |
65 content::WebContents* contents); | 69 content::WebContents* contents); |
66 | 70 |
67 // Convenience method to allow //chrome code easy access to a | 71 // Convenience method to allow //chrome code easy access to a |
68 // PasswordGenerationManager from a WebContents instance. | 72 // PasswordGenerationManager from a WebContents instance. |
69 static password_manager::PasswordGenerationManager* | 73 static password_manager::PasswordGenerationManager* |
70 GetGenerationManagerFromWebContents(content::WebContents* contents); | 74 GetGenerationManagerFromWebContents(content::WebContents* contents); |
71 | 75 |
72 // Observer for PasswordGenerationPopup events. Used for testing. | 76 // Observer for PasswordGenerationPopup events. Used for testing. |
73 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); | 77 void SetTestObserver(autofill::PasswordGenerationPopupObserver* observer); |
74 | 78 |
75 private: | 79 private: |
76 explicit ChromePasswordManagerClient(content::WebContents* web_contents); | 80 ChromePasswordManagerClient( |
| 81 content::WebContents* web_contents, |
| 82 autofill::AutofillManagerDelegate* autofill_manager_delegate); |
77 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 83 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
78 | 84 |
79 // content::WebContentsObserver overrides. | 85 // content::WebContentsObserver overrides. |
80 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 86 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
81 | 87 |
82 // Callback method to be triggered when authentication is successful for a | 88 // Callback method to be triggered when authentication is successful for a |
83 // given password authentication request. If authentication is disabled or | 89 // given password authentication request. If authentication is disabled or |
84 // not supported, this will be triggered directly. | 90 // not supported, this will be triggered directly. |
85 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); | 91 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); |
86 | 92 |
(...skipping 28 matching lines...) Expand all Loading... |
115 | 121 |
116 // Points to an active logger instance to use for, e.g., reporting progress on | 122 // Points to an active logger instance to use for, e.g., reporting progress on |
117 // saving passwords. If there is no active logger (most of the time), the | 123 // saving passwords. If there is no active logger (most of the time), the |
118 // pointer will be NULL. | 124 // pointer will be NULL. |
119 password_manager::PasswordManagerLogger* logger_; | 125 password_manager::PasswordManagerLogger* logger_; |
120 | 126 |
121 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 127 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
122 }; | 128 }; |
123 | 129 |
124 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 130 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |