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

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

Issue 1151373006: Update Confirmation UI for saved password change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up Created 5 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 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // by the user. 56 // by the user.
57 void OnNeverForThisSiteClicked(); 57 void OnNeverForThisSiteClicked();
58 58
59 // Called by the view code when the "Undo" button is clicked in 59 // Called by the view code when the "Undo" button is clicked in
60 // "Never for this site." confirmation bubble by the user. 60 // "Never for this site." confirmation bubble by the user.
61 void OnUndoNeverForThisSite(); 61 void OnUndoNeverForThisSite();
62 62
63 // Called by the view code when the site is unblacklisted. 63 // Called by the view code when the site is unblacklisted.
64 void OnUnblacklistClicked(); 64 void OnUnblacklistClicked();
65 65
66 // Called by the view code when the save button in clicked by the user. 66 // Called by the view code when the save button is clicked by the user.
67 void OnSaveClicked(); 67 void OnSaveClicked();
68 68
69 // Called by the view code when the update link is clicked by the user.
70 void OnUpdateClicked(const autofill::PasswordForm& password_form);
71
69 // Called by the view code when the "Done" button is clicked by the user. 72 // Called by the view code when the "Done" button is clicked by the user.
70 void OnDoneClicked(); 73 void OnDoneClicked();
71 74
72 // Called by the view code when the "OK" button is clicked by the user. 75 // Called by the view code when the "OK" button is clicked by the user.
73 void OnOKClicked(); 76 void OnOKClicked();
74 77
75 // Called by the view code when the manage link is clicked by the user. 78 // Called by the view code when the manage link is clicked by the user.
76 void OnManageLinkClicked(); 79 void OnManageLinkClicked();
77 80
78 // Called by the view code when the brand name link is clicked by the user. 81 // Called by the view code when the brand name link is clicked by the user.
(...skipping 14 matching lines...) Expand all
93 96
94 // Called by the view code to notify about chosen credential. 97 // Called by the view code to notify about chosen credential.
95 void OnChooseCredentials(const autofill::PasswordForm& password_form, 98 void OnChooseCredentials(const autofill::PasswordForm& password_form,
96 password_manager::CredentialType credential_type_); 99 password_manager::CredentialType credential_type_);
97 100
98 GURL origin() const { return origin_; } 101 GURL origin() const { return origin_; }
99 102
100 password_manager::ui::State state() const { return state_; } 103 password_manager::ui::State state() const { return state_; }
101 104
102 const base::string16& title() const { return title_; } 105 const base::string16& title() const { return title_; }
106 const base::string16& save_button_text() const { return save_button_text_; }
103 const autofill::PasswordForm& pending_password() const { 107 const autofill::PasswordForm& pending_password() const {
104 return pending_password_; 108 return pending_password_;
105 } 109 }
106 // Returns the available credentials which match the current site. 110 // Returns the available credentials which match the current site.
107 const ScopedVector<const autofill::PasswordForm>& local_credentials() const { 111 const ScopedVector<const autofill::PasswordForm>& local_credentials() const {
108 return local_credentials_; 112 return local_credentials_;
109 } 113 }
110 // Return the federated logins which may be used for logging in to the current 114 // Return the federated logins which may be used for logging in to the current
111 // site. 115 // site.
112 const ScopedVector<const autofill::PasswordForm>& federated_credentials() 116 const ScopedVector<const autofill::PasswordForm>& federated_credentials()
113 const { 117 const {
114 return federated_credentials_; 118 return federated_credentials_;
115 } 119 }
116 const base::string16& manage_link() const { return manage_link_; } 120 const base::string16& manage_link() const { return manage_link_; }
117 bool never_save_passwords() const { return never_save_passwords_; } 121 bool never_save_passwords() const { return never_save_passwords_; }
118 const base::string16& save_confirmation_text() const { 122 const base::string16& save_confirmation_text() const {
119 return save_confirmation_text_; 123 return save_confirmation_text_;
120 } 124 }
121 const gfx::Range& save_confirmation_link_range() const { 125 const gfx::Range& save_confirmation_link_range() const {
122 return save_confirmation_link_range_; 126 return save_confirmation_link_range_;
123 } 127 }
124 128
125 const gfx::Range& title_brand_link_range() const { 129 const gfx::Range& title_brand_link_range() const {
126 return title_brand_link_range_; 130 return title_brand_link_range_;
127 } 131 }
128 132
133 bool account_for_update_selection() const {
vabr (Chromium) 2015/06/03 16:33:26 nit: Please don't inline the definition of the met
vabr (Chromium) 2015/06/03 16:33:26 Also, the name sounds a little cryptic (I'm not su
vasilii 2015/06/03 18:32:02 I suppose it should be something like "ShouldShowM
dvadym 2015/06/19 15:27:29 Thanks, it was temporary name from early prototypi
134 return pending_password_.is_password_change_form_without_username &&
135 local_credentials_.size() > 1;
136 }
137
138 bool is_password_change_form_without_username() const {
139 return pending_password_.is_password_change_form_without_username;
140 }
141
129 Profile* GetProfile() const; 142 Profile* GetProfile() const;
130 143
131 // Returns true iff the new UI should be presented to user for managing and 144 // Returns true iff the new UI should be presented to user for managing and
132 // saving the passwords. 145 // saving the passwords.
133 bool IsNewUIActive() const; 146 bool IsNewUIActive() const;
134 147
135 #if defined(UNIT_TEST) 148 #if defined(UNIT_TEST)
136 // Gets and sets the reason the bubble was displayed. 149 // Gets and sets the reason the bubble was displayed.
137 password_manager::metrics_util::UIDisplayDisposition display_disposition() 150 password_manager::metrics_util::UIDisplayDisposition display_disposition()
138 const { 151 const {
(...skipping 14 matching lines...) Expand all
153 static int PasswordFieldWidth(); 166 static int PasswordFieldWidth();
154 167
155 private: 168 private:
156 // Updates |title_| and |title_brand_link_range_| for the 169 // Updates |title_| and |title_brand_link_range_| for the
157 // PENDING_PASSWORD_STATE. 170 // PENDING_PASSWORD_STATE.
158 void UpdatePendingStateTitle(); 171 void UpdatePendingStateTitle();
159 // URL of the page from where this bubble was triggered. 172 // URL of the page from where this bubble was triggered.
160 GURL origin_; 173 GURL origin_;
161 password_manager::ui::State state_; 174 password_manager::ui::State state_;
162 base::string16 title_; 175 base::string16 title_;
176 base::string16 save_button_text_;
163 // Range of characters in the title that contains the Smart Lock Brand and 177 // Range of characters in the title that contains the Smart Lock Brand and
164 // should point to an article. For the default title the range is empty. 178 // should point to an article. For the default title the range is empty.
165 gfx::Range title_brand_link_range_; 179 gfx::Range title_brand_link_range_;
166 autofill::PasswordForm pending_password_; 180 autofill::PasswordForm pending_password_;
167 ScopedVector<const autofill::PasswordForm> local_credentials_; 181 ScopedVector<const autofill::PasswordForm> local_credentials_;
168 ScopedVector<const autofill::PasswordForm> federated_credentials_; 182 ScopedVector<const autofill::PasswordForm> federated_credentials_;
169 base::string16 manage_link_; 183 base::string16 manage_link_;
170 base::string16 save_confirmation_text_; 184 base::string16 save_confirmation_text_;
171 gfx::Range save_confirmation_link_range_; 185 gfx::Range save_confirmation_link_range_;
172 // If true upon destruction, the user has confirmed that she never wants to 186 // If true upon destruction, the user has confirmed that she never wants to
173 // save passwords for a particular site. 187 // save passwords for a particular site.
174 bool never_save_passwords_; 188 bool never_save_passwords_;
175 password_manager::metrics_util::UIDisplayDisposition display_disposition_; 189 password_manager::metrics_util::UIDisplayDisposition display_disposition_;
176 password_manager::metrics_util::UIDismissalReason dismissal_reason_; 190 password_manager::metrics_util::UIDismissalReason dismissal_reason_;
177 191
178 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); 192 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel);
179 }; 193 };
180 194
181 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ 195 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698