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

Side by Side Diff: chrome/browser/ui/passwords/passwords_client_ui_delegate.h

Issue 2253233005: Change ScopedVector to vector<unique_ptr> in the password's UI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android+ Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_vector.h"
13 #include "components/autofill/core/common/password_form.h" 12 #include "components/autofill/core/common/password_form.h"
14 13
15 namespace content { 14 namespace content {
16 class WebContents; 15 class WebContents;
17 } 16 }
18 17
19 namespace password_manager { 18 namespace password_manager {
20 class PasswordFormManager; 19 class PasswordFormManager;
21 } 20 }
22 21
(...skipping 15 matching lines...) Expand all
38 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; 37 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0;
39 38
40 // Called when the site asks user to choose from credentials. This triggers 39 // Called when the site asks user to choose from credentials. This triggers
41 // the UI to prompt the user. |local_credentials| and |federated_credentials| 40 // the UI to prompt the user. |local_credentials| and |federated_credentials|
42 // shouldn't both be empty. |origin| is a URL of the site that requested a 41 // shouldn't both be empty. |origin| is a URL of the site that requested a
43 // credential. 42 // credential.
44 // Returns true when the UI is shown. |callback| is called when the user made 43 // Returns true when the UI is shown. |callback| is called when the user made
45 // a decision. If the UI isn't shown the method returns false and doesn't call 44 // a decision. If the UI isn't shown the method returns false and doesn't call
46 // |callback|. 45 // |callback|.
47 virtual bool OnChooseCredentials( 46 virtual bool OnChooseCredentials(
48 ScopedVector<autofill::PasswordForm> local_credentials, 47 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials,
49 ScopedVector<autofill::PasswordForm> federated_credentials, 48 std::vector<std::unique_ptr<autofill::PasswordForm>>
49 federated_credentials,
50 const GURL& origin, 50 const GURL& origin,
51 const base::Callback<void(const autofill::PasswordForm*)>& callback) = 0; 51 const base::Callback<void(const autofill::PasswordForm*)>& callback) = 0;
52 52
53 // Called when user is auto signed in to the site. |local_forms[0]| contains 53 // Called when user is auto signed in to the site. |local_forms[0]| contains
54 // the credential returned to the site. |origin| is a URL of the site. 54 // the credential returned to the site. |origin| is a URL of the site.
55 virtual void OnAutoSignin( 55 virtual void OnAutoSignin(
56 ScopedVector<autofill::PasswordForm> local_forms, 56 std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms,
57 const GURL& origin) = 0; 57 const GURL& origin) = 0;
58 58
59 // Called when it's the right time to enable autosign-in explicitly. 59 // Called when it's the right time to enable autosign-in explicitly.
60 virtual void OnPromptEnableAutoSignin() = 0; 60 virtual void OnPromptEnableAutoSignin() = 0;
61 61
62 // Called when the password will be saved automatically, but we still wish to 62 // Called when the password will be saved automatically, but we still wish to
63 // visually inform the user that the save has occured. 63 // visually inform the user that the save has occured.
64 virtual void OnAutomaticPasswordSave( 64 virtual void OnAutomaticPasswordSave(
65 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0; 65 std::unique_ptr<password_manager::PasswordFormManager> form_manager) = 0;
66 66
(...skipping 10 matching lines...) Expand all
77 77
78 protected: 78 protected:
79 virtual ~PasswordsClientUIDelegate() = default; 79 virtual ~PasswordsClientUIDelegate() = default;
80 }; 80 };
81 81
82 // Returns ManagePasswordsUIController instance for |contents| 82 // Returns ManagePasswordsUIController instance for |contents|
83 PasswordsClientUIDelegate* PasswordsClientUIDelegateFromWebContents( 83 PasswordsClientUIDelegate* PasswordsClientUIDelegateFromWebContents(
84 content::WebContents* web_contents); 84 content::WebContents* web_contents);
85 85
86 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_ 86 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_CLIENT_UI_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698