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

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

Issue 1423263004: [MD] Use programmatic rendering for omnibox chips (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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') | no next file » | 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 ccf8207b1f1013e61862255f897066e50e327c82..15eea5018bcfd8bacd98e96aee45d6b78f28fc43 100644
--- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
+++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
@@ -32,13 +32,7 @@ SelectedKeywordView::SelectedKeywordView(const gfx::FontList& font_list,
parent_background_color,
false),
profile_(profile) {
- if (ui::MaterialDesignController::IsModeMaterial()) {
- // The inset for IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE for which to perfom
- // nine-slicing.
- static const int kImageInset = 4;
- gfx::Insets insets(kImageInset, kImageInset, kImageInset, kImageInset);
- SetBackgroundImageWithInsets(IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE, insets);
- } else {
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
static const int kBackgroundImages[] =
IMAGE_GRID(IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE);
SetBackgroundImageGrid(kBackgroundImages);
@@ -54,15 +48,22 @@ 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));
+ GetTextColor()));
} else {
SetImage(*GetThemeProvider()->GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
}
}
+SkColor SelectedKeywordView::GetTextColor() const {
+ return GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_LinkEnabled);
+}
+
+SkColor SelectedKeywordView::GetBorderColor() const {
+ return GetTextColor();
+}
+
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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698