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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 2077803002: Modify the ommnibox dropdown colors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@theme_cleanup
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include <atlbase.h> // NOLINT 9 #include <atlbase.h> // NOLINT
10 #include <atlwin.h> // NOLINT 10 #include <atlwin.h> // NOLINT
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 // to ensure that |keyword_icon_| is resized each time its image is reset. 617 // to ensure that |keyword_icon_| is resized each time its image is reset.
618 int icon = IDR_OMNIBOX_TTS; 618 int icon = IDR_OMNIBOX_TTS;
619 if (GetState() == SELECTED) 619 if (GetState() == SELECTED)
620 icon = IDR_OMNIBOX_TTS_SELECTED; 620 icon = IDR_OMNIBOX_TTS_SELECTED;
621 621
622 return *location_bar_view_->GetThemeProvider()->GetImageSkiaNamed(icon); 622 return *location_bar_view_->GetThemeProvider()->GetImageSkiaNamed(icon);
623 } 623 }
624 624
625 gfx::ImageSkia OmniboxResultView::GetVectorIcon( 625 gfx::ImageSkia OmniboxResultView::GetVectorIcon(
626 gfx::VectorIconId icon_id) const { 626 gfx::VectorIconId icon_id) const {
627 return gfx::CreateVectorIcon(icon_id, 16, color_utils::DeriveDefaultIconColor( 627 // For selected rows, paint the icon the same color as the text.
628 GetColor(GetState(), TEXT))); 628 SkColor color = GetColor(GetState(), TEXT);
629 if (GetState() != SELECTED)
630 color = color_utils::DeriveDefaultIconColor(color);
631 return gfx::CreateVectorIcon(icon_id, 16, color);
629 } 632 }
630 633
631 bool OmniboxResultView::ShowOnlyKeywordMatch() const { 634 bool OmniboxResultView::ShowOnlyKeywordMatch() const {
632 return match_.associated_keyword && 635 return match_.associated_keyword &&
633 (keyword_icon_->x() <= icon_bounds_.right()); 636 (keyword_icon_->x() <= icon_bounds_.right());
634 } 637 }
635 638
636 void OmniboxResultView::InitContentsRenderTextIfNecessary() const { 639 void OmniboxResultView::InitContentsRenderTextIfNecessary() const {
637 if (!contents_rendertext_) { 640 if (!contents_rendertext_) {
638 contents_rendertext_.reset( 641 contents_rendertext_.reset(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 destination->AppendText(text); 839 destination->AppendText(text);
837 const TextStyle& text_style = GetTextStyle(text_type); 840 const TextStyle& text_style = GetTextStyle(text_type);
838 // TODO(dschuyler): follow up on the problem of different font sizes within 841 // TODO(dschuyler): follow up on the problem of different font sizes within
839 // one RenderText. Maybe with destination->SetFontList(...). 842 // one RenderText. Maybe with destination->SetFontList(...).
840 destination->ApplyWeight( 843 destination->ApplyWeight(
841 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range); 844 is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range);
842 destination->ApplyColor( 845 destination->ApplyColor(
843 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range); 846 GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range);
844 destination->ApplyBaselineStyle(text_style.baseline, range); 847 destination->ApplyBaselineStyle(text_style.baseline, range);
845 } 848 }
OLDNEW
« no previous file with comments | « no previous file | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698