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

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

Issue 765073004: Adding skeleton code for showing Bubble, asking user to submit URL when Password Manager fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
7 7
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
10 #include "components/autofill/core/common/password_form.h" 10 #include "components/autofill/core/common/password_form.h"
(...skipping 22 matching lines...) Expand all
33 // associated with |web_contents| upon creation. 33 // associated with |web_contents| upon creation.
34 explicit ManagePasswordsBubbleModel(content::WebContents* web_contents); 34 explicit ManagePasswordsBubbleModel(content::WebContents* web_contents);
35 ~ManagePasswordsBubbleModel() override; 35 ~ManagePasswordsBubbleModel() override;
36 36
37 // Called by the view code when the bubble is shown. 37 // Called by the view code when the bubble is shown.
38 void OnBubbleShown(ManagePasswordsBubble::DisplayReason reason); 38 void OnBubbleShown(ManagePasswordsBubble::DisplayReason reason);
39 39
40 // Called by the view code when the bubble is hidden. 40 // Called by the view code when the bubble is hidden.
41 void OnBubbleHidden(); 41 void OnBubbleHidden();
42 42
43 // Call by the view code when user agreed for URL collection.
vabr (Chromium) 2014/12/04 13:25:33 grammar nit: agreed for -> agreed to
melandory 2014/12/05 12:56:52 Done.
44 void OnCollectURLClicked();
45
46 // Called by the view code when user didn't allow to collect URL.
47 void OnDoNotCollectURLClicked();
48
43 // Called by the view code when the "Nope" button in clicked by the user. 49 // Called by the view code when the "Nope" button in clicked by the user.
44 void OnNopeClicked(); 50 void OnNopeClicked();
45 51
46 // Called by the view code when the "Never for this site." button in clicked 52 // Called by the view code when the "Never for this site." button in clicked
47 // by the user. 53 // by the user.
48 void OnNeverForThisSiteClicked(); 54 void OnNeverForThisSiteClicked();
49 55
50 // Called by the view code when the site is unblacklisted. 56 // Called by the view code when the site is unblacklisted.
51 void OnUnblacklistClicked(); 57 void OnUnblacklistClicked();
52 58
(...skipping 10 matching lines...) Expand all
63 void OnManageLinkClicked(); 69 void OnManageLinkClicked();
64 70
65 // Called by the view code to delete or add a password form to the 71 // Called by the view code to delete or add a password form to the
66 // PasswordStore. 72 // PasswordStore.
67 void OnPasswordAction(const autofill::PasswordForm& password_form, 73 void OnPasswordAction(const autofill::PasswordForm& password_form,
68 PasswordAction action); 74 PasswordAction action);
69 75
70 // Called by the view code to notify about chosen credential. 76 // Called by the view code to notify about chosen credential.
71 void OnChooseCredentials(const autofill::PasswordForm& password_form); 77 void OnChooseCredentials(const autofill::PasswordForm& password_form);
72 78
79 GURL origin() const { return origin_; }
80
73 password_manager::ui::State state() const { return state_; } 81 password_manager::ui::State state() const { return state_; }
74 82
75 const base::string16& title() const { return title_; } 83 const base::string16& title() const { return title_; }
76 const autofill::PasswordForm& pending_password() const { 84 const autofill::PasswordForm& pending_password() const {
77 return pending_password_; 85 return pending_password_;
78 } 86 }
79 const autofill::ConstPasswordFormMap& best_matches() const { 87 const autofill::ConstPasswordFormMap& best_matches() const {
80 return best_matches_; 88 return best_matches_;
81 } 89 }
82 const ScopedVector<autofill::PasswordForm>& pending_credentials() const { 90 const ScopedVector<autofill::PasswordForm>& pending_credentials() const {
(...skipping 21 matching lines...) Expand all
104 112
105 // State setter. 113 // State setter.
106 void set_state(password_manager::ui::State state) { state_ = state; } 114 void set_state(password_manager::ui::State state) { state_ = state; }
107 #endif 115 #endif
108 116
109 // Upper limits on the size of the username and password fields. 117 // Upper limits on the size of the username and password fields.
110 static int UsernameFieldWidth(); 118 static int UsernameFieldWidth();
111 static int PasswordFieldWidth(); 119 static int PasswordFieldWidth();
112 120
113 private: 121 private:
122 // URL of a page from where bubble was triggered.
vabr (Chromium) 2014/12/04 13:25:33 grammar nits: a page -> the page bubble -> this bu
melandory 2014/12/05 12:56:52 Done.
123 GURL origin_;
114 password_manager::ui::State state_; 124 password_manager::ui::State state_;
115 base::string16 title_; 125 base::string16 title_;
116 autofill::PasswordForm pending_password_; 126 autofill::PasswordForm pending_password_;
117 autofill::ConstPasswordFormMap best_matches_; 127 autofill::ConstPasswordFormMap best_matches_;
118 ScopedVector<autofill::PasswordForm> pending_credentials_; 128 ScopedVector<autofill::PasswordForm> pending_credentials_;
119 base::string16 manage_link_; 129 base::string16 manage_link_;
120 base::string16 save_confirmation_text_; 130 base::string16 save_confirmation_text_;
121 gfx::Range save_confirmation_link_range_; 131 gfx::Range save_confirmation_link_range_;
122 132
123 password_manager::metrics_util::UIDisplayDisposition display_disposition_; 133 password_manager::metrics_util::UIDisplayDisposition display_disposition_;
124 password_manager::metrics_util::UIDismissalReason dismissal_reason_; 134 password_manager::metrics_util::UIDismissalReason dismissal_reason_;
125 135
126 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); 136 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel);
127 }; 137 };
128 138
129 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ 139 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698