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

Unified Diff: chrome/browser/ui/views/location_bar/content_setting_image_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
Index: chrome/browser/ui/views/location_bar/content_setting_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index 28410ee8072cf800df647fa337c5e8bba1b7486d..f5863c9e1b6936371ad0f78d985ed74fdfd5d5c3 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -15,6 +15,7 @@
#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/color_utils.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
@@ -51,13 +52,7 @@ ContentSettingImageView::ContentSettingImageView(
pause_animation_(false),
pause_animation_state_(0.0),
bubble_widget_(NULL) {
- if (ui::MaterialDesignController::IsModeMaterial()) {
- // The insets for IDR_OMNIBOX_CONTENT_SETTING_BUBBLE for which to perfom
- // nine-slicing.
- static const int kImageInset = 4;
- gfx::Insets insets(kImageInset, kImageInset, kImageInset, kImageInset);
- SetBackgroundImageWithInsets(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE, insets);
- } else {
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
static const int kBackgroundImages[] =
IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE);
SetBackgroundImageGrid(kBackgroundImages);
@@ -113,6 +108,15 @@ void ContentSettingImageView::Update(content::WebContents* web_contents) {
content_setting_image_model_->get_content_settings_type());
}
+SkColor ContentSettingImageView::GetTextColor() const {
+ return GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor);
+}
+
+SkColor ContentSettingImageView::GetBorderColor() const {
+ return gfx::kGoogleYellow700;
+}
+
bool ContentSettingImageView::ShouldShowBackground() const {
return slide_animator_.is_animating() || pause_animation_;
}

Powered by Google App Engine
This is Rietveld 408576698