| OLD | NEW |
| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // All other message types are defined here. | 166 // All other message types are defined here. |
| 167 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); | 167 PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); |
| 168 switch (id) { | 168 switch (id) { |
| 169 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: | 169 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: |
| 170 case POPUP_ITEM_ID_CLEAR_FORM: | 170 case POPUP_ITEM_ID_CLEAR_FORM: |
| 171 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: | 171 case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: |
| 172 case POPUP_ITEM_ID_AUTOFILL_OPTIONS: | 172 case POPUP_ITEM_ID_AUTOFILL_OPTIONS: |
| 173 case POPUP_ITEM_ID_SCAN_CREDIT_CARD: | 173 case POPUP_ITEM_ID_SCAN_CREDIT_CARD: |
| 174 case POPUP_ITEM_ID_SEPARATOR: | 174 case POPUP_ITEM_ID_SEPARATOR: |
| 175 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: | 175 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: |
| 176 case POPUP_ITEM_ID_TITLE: |
| 177 case POPUP_ITEM_ID_PASSWORD_ENTRY: |
| 176 return normal_font_list_; | 178 return normal_font_list_; |
| 177 case POPUP_ITEM_ID_TITLE: | |
| 178 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: | 179 case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: |
| 179 case POPUP_ITEM_ID_DATALIST_ENTRY: | 180 case POPUP_ITEM_ID_DATALIST_ENTRY: |
| 180 case POPUP_ITEM_ID_PASSWORD_ENTRY: | 181 case POPUP_ITEM_ID_USERNAME_ENTRY: |
| 181 return bold_font_list_; | 182 return bold_font_list_; |
| 182 } | 183 } |
| 183 NOTREACHED(); | 184 NOTREACHED(); |
| 184 return normal_font_list_; | 185 return normal_font_list_; |
| 185 } | 186 } |
| 186 | 187 |
| 187 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow( | 188 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow( |
| 188 size_t index) const { | 189 size_t index) const { |
| 189 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); | 190 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); |
| 190 if (suggestions[index].frontend_id == | 191 if (suggestions[index].frontend_id == |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { | 299 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { |
| 299 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || | 300 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || |
| 300 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); | 301 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); |
| 301 } | 302 } |
| 302 | 303 |
| 303 unsigned int AutofillPopupLayoutModel::GetMargin() const { | 304 unsigned int AutofillPopupLayoutModel::GetMargin() const { |
| 304 return GetPopupMargin(); | 305 return GetPopupMargin(); |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace autofill | 308 } // namespace autofill |
| OLD | NEW |