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

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

Issue 2581513002: Replace hard-coded colors from ui::NativeTheme for consistency and accessibility. (Closed)
Patch Set: Resolved conflicts during patching Created 3 years, 11 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow( 184 const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow(
185 size_t index) const { 185 size_t index) const {
186 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 186 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
187 if (suggestions[index].frontend_id == 187 if (suggestions[index].frontend_id ==
188 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) 188 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)
189 return normal_font_list_; 189 return normal_font_list_;
190 190
191 return smaller_font_list_; 191 return smaller_font_list_;
192 } 192 }
193 193
194 SkColor AutofillPopupLayoutModel::GetValueFontColorForRow(size_t index) const { 194 ui::NativeTheme::ColorId AutofillPopupLayoutModel::GetValueFontColorIDForRow(
195 size_t index) const {
195 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 196 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
196 switch (suggestions[index].frontend_id) { 197 switch (suggestions[index].frontend_id) {
197 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE: 198 case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
198 return gfx::kGoogleRed700; 199 return ui::NativeTheme::kColorId_AlertSeverityHigh;
199 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE: 200 case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
200 return kLabelTextColor; 201 return ui::NativeTheme::kColorId_ResultsTableNormalDimmedText;
201 default: 202 default:
202 return kValueTextColor; 203 return ui::NativeTheme::kColorId_ResultsTableNormalText;
203 } 204 }
204 } 205 }
205 206
206 gfx::ImageSkia AutofillPopupLayoutModel::GetIconImage(size_t index) const { 207 gfx::ImageSkia AutofillPopupLayoutModel::GetIconImage(size_t index) const {
207 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions(); 208 std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
208 const base::string16& icon_str = suggestions[index].icon; 209 const base::string16& icon_str = suggestions[index].icon;
209 210
210 // For http warning message, get icon images from VectorIconId, which is the 211 // For http warning message, get icon images from VectorIconId, which is the
211 // same as security indicator icons in location bar. 212 // same as security indicator icons in location bar.
212 if (suggestions[index].frontend_id == 213 if (suggestions[index].frontend_id ==
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 unsigned int AutofillPopupLayoutModel::GetDropdownItemHeight() const { 291 unsigned int AutofillPopupLayoutModel::GetDropdownItemHeight() const {
291 return GetPopupDropdownItemHeight(); 292 return GetPopupDropdownItemHeight();
292 } 293 }
293 294
294 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const { 295 bool AutofillPopupLayoutModel::IsIconAtStart(int frontend_id) const {
295 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE || 296 return frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE ||
296 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart()); 297 (is_credit_card_popup_ && IsIconInCreditCardPopupAtStart());
297 } 298 }
298 299
299 } // namespace autofill 300 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_layout_model.h ('k') | chrome/browser/ui/autofill/popup_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698