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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
11 #include "components/password_manager/core/browser/password_store.h" | 11 #include "components/password_manager/core/browser/password_store.h" |
12 | 12 |
13 class PrefService; | 13 class PrefService; |
14 | 14 |
15 namespace password_manager { | 15 namespace password_manager { |
16 | 16 |
17 struct CredentialInfo; | 17 struct CredentialInfo; |
18 class PasswordFormManager; | 18 class PasswordFormManager; |
| 19 class PasswordManager; |
19 class PasswordManagerDriver; | 20 class PasswordManagerDriver; |
20 class PasswordStore; | 21 class PasswordStore; |
21 | 22 |
22 enum CustomPassphraseState { | 23 enum CustomPassphraseState { |
23 WITHOUT_CUSTOM_PASSPHRASE, | 24 WITHOUT_CUSTOM_PASSPHRASE, |
24 ONLY_CUSTOM_PASSPHRASE | 25 ONLY_CUSTOM_PASSPHRASE |
25 }; | 26 }; |
26 | 27 |
27 // An abstraction of operations that depend on the embedders (e.g. Chrome) | 28 // An abstraction of operations that depend on the embedders (e.g. Chrome) |
28 // environment. | 29 // environment. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // order to unblacklist a site, for example. Default implementation is a noop. | 103 // order to unblacklist a site, for example. Default implementation is a noop. |
103 virtual void PasswordAutofillWasBlocked( | 104 virtual void PasswordAutofillWasBlocked( |
104 const autofill::PasswordFormMap& best_matches) const {} | 105 const autofill::PasswordFormMap& best_matches) const {} |
105 | 106 |
106 // Gets prefs associated with this embedder. | 107 // Gets prefs associated with this embedder. |
107 virtual PrefService* GetPrefs() = 0; | 108 virtual PrefService* GetPrefs() = 0; |
108 | 109 |
109 // Returns the PasswordStore associated with this instance. | 110 // Returns the PasswordStore associated with this instance. |
110 virtual PasswordStore* GetPasswordStore() = 0; | 111 virtual PasswordStore* GetPasswordStore() = 0; |
111 | 112 |
112 // Returns the PasswordManagerDriver instance associated with this instance. | |
113 virtual PasswordManagerDriver* GetDriver() = 0; | |
114 | |
115 // Returns the probability that the experiment identified by |experiment_name| | 113 // Returns the probability that the experiment identified by |experiment_name| |
116 // should be enabled. The default implementation returns 0. | 114 // should be enabled. The default implementation returns 0. |
117 virtual base::FieldTrial::Probability GetProbabilityForExperiment( | 115 virtual base::FieldTrial::Probability GetProbabilityForExperiment( |
118 const std::string& experiment_name); | 116 const std::string& experiment_name); |
119 | 117 |
120 // Returns true if password sync is enabled in the embedder. Return value for | 118 // Returns true if password sync is enabled in the embedder. Return value for |
121 // custom passphrase users depends on |state|. The default implementation | 119 // custom passphrase users depends on |state|. The default implementation |
122 // always returns false. | 120 // always returns false. |
123 virtual bool IsPasswordSyncEnabled(CustomPassphraseState state); | 121 virtual bool IsPasswordSyncEnabled(CustomPassphraseState state); |
124 | 122 |
(...skipping 11 matching lines...) Expand all Loading... |
136 virtual bool IsLoggingActive() const; | 134 virtual bool IsLoggingActive() const; |
137 | 135 |
138 // Returns true if last navigation page had HTTP error i.e 5XX or 4XX | 136 // Returns true if last navigation page had HTTP error i.e 5XX or 4XX |
139 virtual bool WasLastNavigationHTTPError() const; | 137 virtual bool WasLastNavigationHTTPError() const; |
140 | 138 |
141 // Returns the authorization prompt policy to be used with the given form. | 139 // Returns the authorization prompt policy to be used with the given form. |
142 // Only relevant on OSX. | 140 // Only relevant on OSX. |
143 virtual PasswordStore::AuthorizationPromptPolicy GetAuthorizationPromptPolicy( | 141 virtual PasswordStore::AuthorizationPromptPolicy GetAuthorizationPromptPolicy( |
144 const autofill::PasswordForm& form); | 142 const autofill::PasswordForm& form); |
145 | 143 |
| 144 // Returns whether any SSL certificate errors were encountered as a result of |
| 145 // the last page load. |
| 146 virtual bool DidLastPageLoadEncounterSSLErrors(); |
| 147 |
| 148 // If this browsing session should not be persisted. |
| 149 virtual bool IsOffTheRecord(); |
| 150 |
| 151 // Returns the PasswordManager associated with this client. |
| 152 virtual PasswordManager* GetPasswordManager(); |
| 153 |
146 private: | 154 private: |
147 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); | 155 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); |
148 }; | 156 }; |
149 | 157 |
150 } // namespace password_manager | 158 } // namespace password_manager |
151 | 159 |
152 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ | 160 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ |
OLD | NEW |