OLD | NEW |
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 Loading... |
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 // Called by the view code when the "Never for this site." button in clicked |
| 44 // by the user and user gets confirmation bubble. |
| 45 void OnConfirmationForNeverForThisSite(); |
| 46 |
43 // Called by the view code when the "Nope" button in clicked by the user. | 47 // Called by the view code when the "Nope" button in clicked by the user. |
44 void OnNopeClicked(); | 48 void OnNopeClicked(); |
45 | 49 |
46 // Called by the view code when the "Never for this site." button in clicked | 50 // Called by the view code when the "Never for this site." button in clicked |
47 // by the user. | 51 // by the user. |
48 void OnNeverForThisSiteClicked(); | 52 void OnNeverForThisSiteClicked(); |
49 | 53 |
| 54 // Called by the view code when the "Undo" button is clicked in |
| 55 // "Never for this site." confirmation bubble by the user. |
| 56 void OnUndoNeverForThisSite(); |
| 57 |
50 // Called by the view code when the site is unblacklisted. | 58 // Called by the view code when the site is unblacklisted. |
51 void OnUnblacklistClicked(); | 59 void OnUnblacklistClicked(); |
52 | 60 |
53 // Called by the view code when the save button in clicked by the user. | 61 // Called by the view code when the save button in clicked by the user. |
54 void OnSaveClicked(); | 62 void OnSaveClicked(); |
55 | 63 |
56 // Called by the view code when the "Done" button is clicked by the user. | 64 // Called by the view code when the "Done" button is clicked by the user. |
57 void OnDoneClicked(); | 65 void OnDoneClicked(); |
58 | 66 |
59 // Called by the view code when the "OK" button is clicked by the user. | 67 // Called by the view code when the "OK" button is clicked by the user. |
(...skipping 16 matching lines...) Expand all Loading... |
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 { |
83 return pending_credentials_; | 91 return pending_credentials_; |
84 } | 92 } |
85 const base::string16& manage_link() const { return manage_link_; } | 93 const base::string16& manage_link() const { return manage_link_; } |
| 94 bool never_save_passwords() const { return never_save_passwords_; } |
86 const base::string16& save_confirmation_text() const { | 95 const base::string16& save_confirmation_text() const { |
87 return save_confirmation_text_; | 96 return save_confirmation_text_; |
88 } | 97 } |
89 const gfx::Range& save_confirmation_link_range() const { | 98 const gfx::Range& save_confirmation_link_range() const { |
90 return save_confirmation_link_range_; | 99 return save_confirmation_link_range_; |
91 } | 100 } |
92 | 101 |
93 #if defined(UNIT_TEST) | 102 #if defined(UNIT_TEST) |
94 // Gets and sets the reason the bubble was displayed. | 103 // Gets and sets the reason the bubble was displayed. |
95 password_manager::metrics_util::UIDisplayDisposition display_disposition() | 104 password_manager::metrics_util::UIDisplayDisposition display_disposition() |
(...skipping 16 matching lines...) Expand all Loading... |
112 | 121 |
113 private: | 122 private: |
114 password_manager::ui::State state_; | 123 password_manager::ui::State state_; |
115 base::string16 title_; | 124 base::string16 title_; |
116 autofill::PasswordForm pending_password_; | 125 autofill::PasswordForm pending_password_; |
117 autofill::ConstPasswordFormMap best_matches_; | 126 autofill::ConstPasswordFormMap best_matches_; |
118 ScopedVector<autofill::PasswordForm> pending_credentials_; | 127 ScopedVector<autofill::PasswordForm> pending_credentials_; |
119 base::string16 manage_link_; | 128 base::string16 manage_link_; |
120 base::string16 save_confirmation_text_; | 129 base::string16 save_confirmation_text_; |
121 gfx::Range save_confirmation_link_range_; | 130 gfx::Range save_confirmation_link_range_; |
122 | 131 // If true upon destruction, the user has confirmed that she never wants to |
| 132 // save passwords for a particular site. |
| 133 bool never_save_passwords_; |
123 password_manager::metrics_util::UIDisplayDisposition display_disposition_; | 134 password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
124 password_manager::metrics_util::UIDismissalReason dismissal_reason_; | 135 password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
125 | 136 |
126 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 137 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
127 }; | 138 }; |
128 | 139 |
129 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 140 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
OLD | NEW |