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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 password_manager::CredentialType credential_type_); | 88 password_manager::CredentialType credential_type_); |
89 | 89 |
90 GURL origin() const { return origin_; } | 90 GURL origin() const { return origin_; } |
91 | 91 |
92 password_manager::ui::State state() const { return state_; } | 92 password_manager::ui::State state() const { return state_; } |
93 | 93 |
94 const base::string16& title() const { return title_; } | 94 const base::string16& title() const { return title_; } |
95 const autofill::PasswordForm& pending_password() const { | 95 const autofill::PasswordForm& pending_password() const { |
96 return pending_password_; | 96 return pending_password_; |
97 } | 97 } |
98 const autofill::ConstPasswordFormMap& best_matches() const { | 98 const ScopedVector<const autofill::PasswordForm>& local_credentials() const { |
groby-ooo-7-16
2015/03/16 22:03:17
Please add a comment what "local_credentials" and
vasilii
2015/03/17 10:49:48
Done.
| |
99 return best_matches_; | 99 return local_credentials_; |
100 } | 100 } |
101 const ScopedVector<autofill::PasswordForm>& local_pending_credentials() | 101 const ScopedVector<const autofill::PasswordForm>& federated_credentials() |
102 const { | 102 const { |
103 return local_pending_credentials_; | 103 return federated_credentials_; |
104 } | |
105 const ScopedVector<autofill::PasswordForm>& federated_pending_credentials() | |
106 const { | |
107 return federated_pending_credentials_; | |
108 } | 104 } |
109 const base::string16& manage_link() const { return manage_link_; } | 105 const base::string16& manage_link() const { return manage_link_; } |
110 bool never_save_passwords() const { return never_save_passwords_; } | 106 bool never_save_passwords() const { return never_save_passwords_; } |
111 const base::string16& save_confirmation_text() const { | 107 const base::string16& save_confirmation_text() const { |
112 return save_confirmation_text_; | 108 return save_confirmation_text_; |
113 } | 109 } |
114 const gfx::Range& save_confirmation_link_range() const { | 110 const gfx::Range& save_confirmation_link_range() const { |
115 return save_confirmation_link_range_; | 111 return save_confirmation_link_range_; |
116 } | 112 } |
117 | 113 |
118 Profile* GetProfile() const; | 114 Profile* GetProfile() const; |
119 | 115 |
120 #if defined(UNIT_TEST) | 116 #if defined(UNIT_TEST) |
121 // Gets and sets the reason the bubble was displayed. | 117 // Gets and sets the reason the bubble was displayed. |
122 password_manager::metrics_util::UIDisplayDisposition display_disposition() | 118 password_manager::metrics_util::UIDisplayDisposition display_disposition() |
123 const { | 119 const { |
124 return display_disposition_; | 120 return display_disposition_; |
125 } | 121 } |
126 | 122 |
127 // Gets the reason the bubble was dismissed. | 123 // Gets the reason the bubble was dismissed. |
128 password_manager::metrics_util::UIDismissalReason dismissal_reason() const { | 124 password_manager::metrics_util::UIDismissalReason dismissal_reason() const { |
129 return dismissal_reason_; | 125 return dismissal_reason_; |
130 } | 126 } |
131 | 127 |
132 // State setter. | 128 // State setter. |
133 void set_state(password_manager::ui::State state) { state_ = state; } | 129 void set_state(password_manager::ui::State state) { state_ = state; } |
134 #endif | 130 #endif |
135 | 131 |
136 // Upper limits on the size of the username and password fields. | 132 // Upper limits on the size of the username and password fields. |
137 static int UsernameFieldWidth(); | 133 static int UsernameFieldWidth(); |
138 static int PasswordFieldWidth(); | 134 static int PasswordFieldWidth(); |
139 | 135 |
140 private: | 136 private: |
141 // URL of the page from where this bubble was triggered. | 137 // URL of the page from where this bubble was triggered. |
142 GURL origin_; | 138 GURL origin_; |
143 password_manager::ui::State state_; | 139 password_manager::ui::State state_; |
144 base::string16 title_; | 140 base::string16 title_; |
145 autofill::PasswordForm pending_password_; | 141 autofill::PasswordForm pending_password_; |
146 autofill::ConstPasswordFormMap best_matches_; | 142 ScopedVector<const autofill::PasswordForm> local_credentials_; |
147 ScopedVector<autofill::PasswordForm> local_pending_credentials_; | 143 ScopedVector<const autofill::PasswordForm> federated_credentials_; |
148 ScopedVector<autofill::PasswordForm> federated_pending_credentials_; | |
149 base::string16 manage_link_; | 144 base::string16 manage_link_; |
150 base::string16 save_confirmation_text_; | 145 base::string16 save_confirmation_text_; |
151 gfx::Range save_confirmation_link_range_; | 146 gfx::Range save_confirmation_link_range_; |
152 // If true upon destruction, the user has confirmed that she never wants to | 147 // If true upon destruction, the user has confirmed that she never wants to |
153 // save passwords for a particular site. | 148 // save passwords for a particular site. |
154 bool never_save_passwords_; | 149 bool never_save_passwords_; |
155 password_manager::metrics_util::UIDisplayDisposition display_disposition_; | 150 password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
156 password_manager::metrics_util::UIDismissalReason dismissal_reason_; | 151 password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
157 | 152 |
158 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 153 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
159 }; | 154 }; |
160 | 155 |
161 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 156 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
OLD | NEW |