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

Unified Diff: chrome/browser/ui/views/location_bar/selected_keyword_view.cc

Issue 1421683002: Update search chip icon for MD, vectorize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting review 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/location_bar/selected_keyword_view.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/selected_keyword_view.cc
diff --git a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
index c5e302a90fc47942e97d657aad54c32bbcf19261..ccf8207b1f1013e61862255f897066e50e327c82 100644
--- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
+++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
@@ -12,16 +12,21 @@
#include "chrome/browser/ui/views/location_bar/keyword_hint_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/search_engines/template_url_service.h"
+#include "grit/components_scaled_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/material_design/material_design_controller.h"
+#include "ui/base/theme_provider.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
+#include "ui/native_theme/native_theme.h"
#include "ui/views/painter.h"
SelectedKeywordView::SelectedKeywordView(const gfx::FontList& font_list,
SkColor text_color,
SkColor parent_background_color,
Profile* profile)
- : IconLabelBubbleView(IDR_KEYWORD_SEARCH_MAGNIFIER,
+ : IconLabelBubbleView(0,
font_list,
text_color,
parent_background_color,
@@ -47,6 +52,17 @@ SelectedKeywordView::SelectedKeywordView(const gfx::FontList& font_list,
SelectedKeywordView::~SelectedKeywordView() {
}
+void SelectedKeywordView::ResetImage() {
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ SkColor link_color =
+ GetNativeTheme()->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled);
+ SetImage(gfx::CreateVectorIcon(gfx::VectorIconId::KEYWORD_SEARCH, 16,
+ link_color));
+ } else {
+ SetImage(*GetThemeProvider()->GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
+ }
+}
+
gfx::Size SelectedKeywordView::GetPreferredSize() const {
// Height will be ignored by the LocationBarView.
return GetSizeForLabelWidth(full_label_.GetPreferredSize().width());
« no previous file with comments | « chrome/browser/ui/views/location_bar/selected_keyword_view.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698