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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 1418543002: Vectorize omnibox dropdown icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add gyp dependency Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_result_view.h ('k') | components/omnibox.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_result_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
index 9a640a68870fe6839295d5fb33e32bd69f3674c5..7a920f4119fff51ade4bb9df24c27618fb255862 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -30,11 +30,14 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/render_text.h"
#include "ui/gfx/text_utils.h"
+#include "ui/gfx/vector_icons_public.h"
using ui::NativeTheme;
@@ -567,10 +570,16 @@ gfx::ImageSkia OmniboxResultView::GetIcon() const {
if (!image.IsEmpty())
return image.AsImageSkia();
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ gfx::VectorIconId icon_id = model_->IsStarredMatch(match_) ?
+ gfx::VectorIconId::OMNIBOX_STAR :
+ AutocompleteMatch::TypeToVectorIcon(match_.type);
+ return gfx::CreateVectorIcon(icon_id, 16, gfx::kChromeIconGrey);
+ }
+
int icon = model_->IsStarredMatch(match_) ?
IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type);
- if (GetState() == SELECTED &&
- !ui::MaterialDesignController::IsModeMaterial()) {
+ if (GetState() == SELECTED) {
switch (icon) {
case IDR_OMNIBOX_CALCULATOR:
icon = IDR_OMNIBOX_CALCULATOR_SELECTED;
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_result_view.h ('k') | components/omnibox.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698