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

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

Issue 2684393003: [Merge] Use regular weight for password autofill popup on password field. (Closed)
Patch Set: Created 3 years, 10 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 (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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // All other message types are defined here. 163 // All other message types are defined here.
164 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); 164 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id);
165 switch (id) { 165 switch (id) {
166 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: 166 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
167 case POPUP_ITEM_ID_CLEAR_FORM: 167 case POPUP_ITEM_ID_CLEAR_FORM:
168 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: 168 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
169 case POPUP_ITEM_ID_AUTOFILL_OPTIONS: 169 case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
170 case POPUP_ITEM_ID_SCAN_CREDIT_CARD: 170 case POPUP_ITEM_ID_SCAN_CREDIT_CARD:
171 case POPUP_ITEM_ID_SEPARATOR: 171 case POPUP_ITEM_ID_SEPARATOR:
172 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: 172 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
173 case POPUP_ITEM_ID_TITLE:
174 case POPUP_ITEM_ID_PASSWORD_ENTRY:
173 return normal_font_list_; 175 return normal_font_list_;
174 case POPUP_ITEM_ID_TITLE:
175 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: 176 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
176 case POPUP_ITEM_ID_DATALIST_ENTRY: 177 case POPUP_ITEM_ID_DATALIST_ENTRY:
177 case POPUP_ITEM_ID_PASSWORD_ENTRY: 178 case POPUP_ITEM_ID_USERNAME_ENTRY:
178 return bold_font_list_; 179 return bold_font_list_;
179 } 180 }
180 NOTREACHED(); 181 NOTREACHED();
181 return normal_font_list_; 182 return normal_font_list_;
182 } 183 }
183 184
184 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow( 185 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow(
185 size_t index) const { 186 size_t index) const {
186 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 187 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
187 if (suggestions[index].frontend_id == 188 if (suggestions[index].frontend_id ==
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { 296 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const {
296 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || 297 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE ||
297 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); 298 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart());
298 } 299 }
299 300
300 unsigned int AutofillPopupLayoutModel::GetMargin() const { 301 unsigned int AutofillPopupLayoutModel::GetMargin() const {
301 return GetPopupMargin(); 302 return GetPopupMargin();
302 } 303 }
303 304
304 } // namespace autofill 305 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698