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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_layout_model.cc

Issue 2576143002: Tweak payment autofill disabled message in form-not-secure (Closed)
Patch Set: fix comment wrapping Created 4 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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); 168 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id);
169 switch (id) { 169 switch (id) {
170 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: 170 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
171 return warning_font_list_; 171 return warning_font_list_;
172 case POPUP_ITEM_ID_CLEAR_FORM: 172 case POPUP_ITEM_ID_CLEAR_FORM:
173 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: 173 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
174 case POPUP_ITEM_ID_AUTOFILL_OPTIONS: 174 case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
175 case POPUP_ITEM_ID_SCAN_CREDIT_CARD: 175 case POPUP_ITEM_ID_SCAN_CREDIT_CARD:
176 case POPUP_ITEM_ID_SEPARATOR: 176 case POPUP_ITEM_ID_SEPARATOR:
177 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: 177 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
178 case POPUP_ITEM_ID_PAYMENT_DISABLED_MESSAGE:
Mathieu 2016/12/15 17:52:06 I think we should align so that both kinds of warn
estark 2016/12/15 19:22:32 Done.
178 return normal_font_list_; 179 return normal_font_list_;
179 case POPUP_ITEM_ID_TITLE: 180 case POPUP_ITEM_ID_TITLE:
180 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: 181 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
181 case POPUP_ITEM_ID_DATALIST_ENTRY: 182 case POPUP_ITEM_ID_DATALIST_ENTRY:
182 case POPUP_ITEM_ID_PASSWORD_ENTRY: 183 case POPUP_ITEM_ID_PASSWORD_ENTRY:
183 return bold_font_list_; 184 return bold_font_list_;
184 } 185 }
185 NOTREACHED(); 186 NOTREACHED();
186 return normal_font_list_; 187 return normal_font_list_;
187 } 188 }
188 189
189 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow( 190 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow(
190 size_t index) const { 191 size_t index) const {
191 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 192 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
192 if (suggestions[index].frontend_id == 193 if (suggestions[index].frontend_id ==
193 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) 194 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)
194 return normal_font_list_; 195 return normal_font_list_;
195 196
196 return smaller_font_list_; 197 return smaller_font_list_;
197 } 198 }
198 199
199 SkColor AutofillPopupLayoutModel::GetValueFontColorForRow(size_t index) const { 200 SkColor AutofillPopupLayoutModel::GetValueFontColorForRow(size_t index) const {
200 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 201 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
201 switch (suggestions[index].frontend_id) { 202 switch (suggestions[index].frontend_id) {
202 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: 203 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
203 return gfx::kGoogleRed700; 204 return gfx::kGoogleRed700;
204 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: 205 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
206 case POPUP_ITEM_ID_PAYMENT_DISABLED_MESSAGE:
205 return kLabelTextColor; 207 return kLabelTextColor;
206 default: 208 default:
207 return kValueTextColor; 209 return kValueTextColor;
208 } 210 }
209 } 211 }
210 212
211 gfx::ImageSkia AutofillPopupLayoutModel::GetIconImage(size_t index) const { 213 gfx::ImageSkia AutofillPopupLayoutModel::GetIconImage(size_t index) const {
212 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 214 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
213 const base::string16& icon_str = suggestions[index].icon; 215 const base::string16& icon_str = suggestions[index].icon;
214 216
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 #endif 278 #endif
277 279
278 return result; 280 return result;
279 } 281 }
280 282
281 const gfx::Rect AutofillPopupLayoutModel::RoundedElementBounds() const { 283 const gfx::Rect AutofillPopupLayoutModel::RoundedElementBounds() const {
282 return gfx::ToEnclosingRect(delegate_->element_bounds()); 284 return gfx::ToEnclosingRect(delegate_->element_bounds());
283 } 285 }
284 286
285 } // namespace autofill 287 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698