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..8b98b7da4a6b26b30c6fc680bf2ed23442f0b111 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,23 @@ |
#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/color_palette.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/controls/image_view.h" |
Peter Kasting
2015/10/23 23:44:09
Are all these needed? It kinda surprises me that
Evan Stade
2015/10/26 19:29:19
a couple were not necessary
|
#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, |
Evan Stade
2015/10/23 21:49:40
this was actually never visible because it got ove
|
+ : IconLabelBubbleView(0, |
font_list, |
text_color, |
parent_background_color, |
@@ -47,6 +54,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); |
Peter Kasting
2015/10/23 23:44:09
Huh. Are we sure we want the magnifier to be the
Evan Stade
2015/10/26 19:29:19
The magnifier is set in a chip and the border of t
Peter Kasting
2015/10/26 19:57:41
GetSystemColor() probably isn't right, then, since
Evan Stade
2015/10/26 20:19:36
NativeTheme does not necessarily draw from system
Peter Kasting
2015/10/26 20:34:01
At least on Windows, where there is a concept of a
Evan Stade
2015/10/26 21:29:42
Perhaps that was the original intent, but right no
Peter Kasting
2015/10/26 22:21:19
I haven't studied Linux in detail, but last time I
|
+ SetImage(gfx::CreateVectorIcon(gfx::VectorIconId::SEARCH_CHIP_ICON, 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()); |