Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: components/password_manager/core/browser/password_manager_client.h

Issue 2900693002: [Password Manager] Convert |pending_login_managers_| to an array of scoped_refptr (Closed)
Patch Set: Rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // the unique element from |form_to_save.best_matches_|. 84 // the unique element from |form_to_save.best_matches_|.
85 // 2.A change password form was submitted and the user has more than one 85 // 2.A change password form was submitted and the user has more than one
86 // stored credential. Then we shouldn't expect anything from 86 // stored credential. Then we shouldn't expect anything from
87 // form_to_save.pending_credentials() except correct origin, since we don't 87 // form_to_save.pending_credentials() except correct origin, since we don't
88 // know which credentials should be updated. 88 // know which credentials should be updated.
89 // 3.A sign-in password form was submitted with a password different from 89 // 3.A sign-in password form was submitted with a password different from
90 // the stored one. In this case form_to_save.password_overridden() == true 90 // the stored one. In this case form_to_save.password_overridden() == true
91 // and form_to_save.pending_credentials() should correspond to the credential 91 // and form_to_save.pending_credentials() should correspond to the credential
92 // that was overidden. 92 // that was overidden.
93 virtual bool PromptUserToSaveOrUpdatePassword( 93 virtual bool PromptUserToSaveOrUpdatePassword(
94 std::unique_ptr<PasswordFormManager> form_to_save, 94 scoped_refptr<PasswordFormManager> form_to_save,
95 bool update_password) = 0; 95 bool update_password) = 0;
96 96
97 // Informs the embedder of a password forms that the user should choose from. 97 // Informs the embedder of a password forms that the user should choose from.
98 // Returns true if the prompt is indeed displayed. If the prompt is not 98 // Returns true if the prompt is indeed displayed. If the prompt is not
99 // displayed, returns false and does not call |callback|. 99 // displayed, returns false and does not call |callback|.
100 // |callback| should be invoked with the chosen form. 100 // |callback| should be invoked with the chosen form.
101 virtual bool PromptUserToChooseCredentials( 101 virtual bool PromptUserToChooseCredentials(
102 std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms, 102 std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms,
103 const GURL& origin, 103 const GURL& origin,
104 const CredentialsCallback& callback) = 0; 104 const CredentialsCallback& callback) = 0;
(...skipping 24 matching lines...) Expand all
129 // |form| contains the form used. 129 // |form| contains the form used.
130 virtual void NotifySuccessfulLoginWithExistingPassword( 130 virtual void NotifySuccessfulLoginWithExistingPassword(
131 const autofill::PasswordForm& form) = 0; 131 const autofill::PasswordForm& form) = 0;
132 132
133 // Inform the embedder that the site called 'store()'. 133 // Inform the embedder that the site called 'store()'.
134 virtual void NotifyStorePasswordCalled() = 0; 134 virtual void NotifyStorePasswordCalled() = 0;
135 135
136 // Called when a password is saved in an automated fashion. Embedder may 136 // Called when a password is saved in an automated fashion. Embedder may
137 // inform the user that this save has occured. 137 // inform the user that this save has occured.
138 virtual void AutomaticPasswordSave( 138 virtual void AutomaticPasswordSave(
139 std::unique_ptr<PasswordFormManager> saved_form_manager) = 0; 139 scoped_refptr<PasswordFormManager> saved_form_manager) = 0;
140 140
141 // Called when a password is autofilled. |best_matches| contains the 141 // Called when a password is autofilled. |best_matches| contains the
142 // PasswordForm into which a password was filled: the client may choose to 142 // PasswordForm into which a password was filled: the client may choose to
143 // save this to the PasswordStore, for example. |origin| is the origin of the 143 // save this to the PasswordStore, for example. |origin| is the origin of the
144 // form into which a password was filled. |federated_matches| are the stored 144 // form into which a password was filled. |federated_matches| are the stored
145 // federated matches relevant to the filled form, this argument may be null. 145 // federated matches relevant to the filled form, this argument may be null.
146 // They are never filled, but might be needed in the UI, for example. Default 146 // They are never filled, but might be needed in the UI, for example. Default
147 // implementation is a noop. 147 // implementation is a noop.
148 virtual void PasswordWasAutofilled( 148 virtual void PasswordWasAutofilled(
149 const std::map<base::string16, const autofill::PasswordForm*>& 149 const std::map<base::string16, const autofill::PasswordForm*>&
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 const std::string& password_saved_domain) = 0; 214 const std::string& password_saved_domain) = 0;
215 #endif 215 #endif
216 216
217 private: 217 private:
218 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient); 218 DISALLOW_COPY_AND_ASSIGN(PasswordManagerClient);
219 }; 219 };
220 220
221 } // namespace password_manager 221 } // namespace password_manager
222 222
223 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_ 223 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698