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_credential_manager
_dispatcher.h" | 10 #include "components/password_manager/content/browser/content_credential_manager
_dispatcher.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // ChromePasswordManagerClient implements the PasswordManagerClient interface. | 34 // ChromePasswordManagerClient implements the PasswordManagerClient interface. |
35 class ChromePasswordManagerClient | 35 class ChromePasswordManagerClient |
36 : public password_manager::PasswordManagerClient, | 36 : public password_manager::PasswordManagerClient, |
37 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
38 public content::WebContentsUserData<ChromePasswordManagerClient> { | 38 public content::WebContentsUserData<ChromePasswordManagerClient> { |
39 public: | 39 public: |
40 virtual ~ChromePasswordManagerClient(); | 40 virtual ~ChromePasswordManagerClient(); |
41 | 41 |
42 // PasswordManagerClient implementation. | 42 // PasswordManagerClient implementation. |
43 virtual bool IsAutomaticPasswordSavingEnabled() const OVERRIDE; | 43 virtual bool IsAutomaticPasswordSavingEnabled() const override; |
44 virtual bool IsPasswordManagerEnabledForCurrentPage() const OVERRIDE; | 44 virtual bool IsPasswordManagerEnabledForCurrentPage() const override; |
45 virtual bool ShouldFilterAutofillResult( | 45 virtual bool ShouldFilterAutofillResult( |
46 const autofill::PasswordForm& form) OVERRIDE; | 46 const autofill::PasswordForm& form) override; |
47 virtual bool IsSyncAccountCredential( | 47 virtual bool IsSyncAccountCredential( |
48 const std::string& username, const std::string& origin) const OVERRIDE; | 48 const std::string& username, const std::string& origin) const override; |
49 virtual void AutofillResultsComputed() OVERRIDE; | 49 virtual void AutofillResultsComputed() override; |
50 virtual bool PromptUserToSavePassword( | 50 virtual bool PromptUserToSavePassword( |
51 scoped_ptr<password_manager::PasswordFormManager> form_to_save) OVERRIDE; | 51 scoped_ptr<password_manager::PasswordFormManager> form_to_save) override; |
52 virtual void AutomaticPasswordSave( | 52 virtual void AutomaticPasswordSave( |
53 scoped_ptr<password_manager::PasswordFormManager> saved_form_manager) | 53 scoped_ptr<password_manager::PasswordFormManager> saved_form_manager) |
54 OVERRIDE; | 54 override; |
55 virtual void PasswordWasAutofilled( | 55 virtual void PasswordWasAutofilled( |
56 const autofill::PasswordFormMap& best_matches) const OVERRIDE; | 56 const autofill::PasswordFormMap& best_matches) const override; |
57 virtual void PasswordAutofillWasBlocked( | 57 virtual void PasswordAutofillWasBlocked( |
58 const autofill::PasswordFormMap& best_matches) const OVERRIDE; | 58 const autofill::PasswordFormMap& best_matches) const override; |
59 virtual void AuthenticateAutofillAndFillForm( | 59 virtual void AuthenticateAutofillAndFillForm( |
60 scoped_ptr<autofill::PasswordFormFillData> fill_data) OVERRIDE; | 60 scoped_ptr<autofill::PasswordFormFillData> fill_data) override; |
61 virtual PrefService* GetPrefs() OVERRIDE; | 61 virtual PrefService* GetPrefs() override; |
62 virtual password_manager::PasswordStore* GetPasswordStore() OVERRIDE; | 62 virtual password_manager::PasswordStore* GetPasswordStore() override; |
63 virtual password_manager::PasswordManagerDriver* GetDriver() OVERRIDE; | 63 virtual password_manager::PasswordManagerDriver* GetDriver() override; |
64 virtual base::FieldTrial::Probability GetProbabilityForExperiment( | 64 virtual base::FieldTrial::Probability GetProbabilityForExperiment( |
65 const std::string& experiment_name) OVERRIDE; | 65 const std::string& experiment_name) override; |
66 virtual bool IsPasswordSyncEnabled() OVERRIDE; | 66 virtual bool IsPasswordSyncEnabled() override; |
67 virtual void OnLogRouterAvailabilityChanged(bool router_can_be_used) OVERRIDE; | 67 virtual void OnLogRouterAvailabilityChanged(bool router_can_be_used) override; |
68 virtual void LogSavePasswordProgress(const std::string& text) OVERRIDE; | 68 virtual void LogSavePasswordProgress(const std::string& text) override; |
69 virtual bool IsLoggingActive() const OVERRIDE; | 69 virtual bool IsLoggingActive() const override; |
70 | 70 |
71 // Hides any visible generation UI. | 71 // Hides any visible generation UI. |
72 void HidePasswordGenerationPopup(); | 72 void HidePasswordGenerationPopup(); |
73 | 73 |
74 static void CreateForWebContentsWithAutofillClient( | 74 static void CreateForWebContentsWithAutofillClient( |
75 content::WebContents* contents, | 75 content::WebContents* contents, |
76 autofill::AutofillClient* autofill_client); | 76 autofill::AutofillClient* autofill_client); |
77 | 77 |
78 // Convenience method to allow //chrome code easy access to a PasswordManager | 78 // Convenience method to allow //chrome code easy access to a PasswordManager |
79 // from a WebContents instance. | 79 // from a WebContents instance. |
(...skipping 23 matching lines...) Expand all Loading... |
103 private: | 103 private: |
104 enum AutofillForSyncCredentialsState { | 104 enum AutofillForSyncCredentialsState { |
105 ALLOW_SYNC_CREDENTIALS, | 105 ALLOW_SYNC_CREDENTIALS, |
106 DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH, | 106 DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH, |
107 DISALLOW_SYNC_CREDENTIALS, | 107 DISALLOW_SYNC_CREDENTIALS, |
108 }; | 108 }; |
109 | 109 |
110 friend class content::WebContentsUserData<ChromePasswordManagerClient>; | 110 friend class content::WebContentsUserData<ChromePasswordManagerClient>; |
111 | 111 |
112 // content::WebContentsObserver overrides. | 112 // content::WebContentsObserver overrides. |
113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 113 virtual bool OnMessageReceived(const IPC::Message& message) override; |
114 | 114 |
115 // Callback method to be triggered when authentication is successful for a | 115 // Callback method to be triggered when authentication is successful for a |
116 // given password authentication request. If authentication is disabled or | 116 // given password authentication request. If authentication is disabled or |
117 // not supported, this will be triggered directly. | 117 // not supported, this will be triggered directly. |
118 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); | 118 void CommitFillPasswordForm(autofill::PasswordFormFillData* fill_data); |
119 | 119 |
120 // Given |bounds| in the renderers coordinate system, return the same bounds | 120 // Given |bounds| in the renderers coordinate system, return the same bounds |
121 // in the screens coordinate system. | 121 // in the screens coordinate system. |
122 gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds); | 122 gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds); |
123 | 123 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // reporting. | 171 // reporting. |
172 bool sync_credential_was_filtered_; | 172 bool sync_credential_was_filtered_; |
173 | 173 |
174 // Allows authentication callbacks to be destroyed when this client is gone. | 174 // Allows authentication callbacks to be destroyed when this client is gone. |
175 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; | 175 base::WeakPtrFactory<ChromePasswordManagerClient> weak_factory_; |
176 | 176 |
177 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 177 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
178 }; | 178 }; |
179 | 179 |
180 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 180 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |