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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.h

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/icon_label_bubble_view.h
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
index 11b6672645b04c9209cd15fc3412a6dbbbac7a03..4dde286df005720d81afdcab0aa51f2080a13e64 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
@@ -30,6 +30,7 @@ class Painter;
// content settings.
class IconLabelBubbleView : public views::View {
public:
+ // TODO(estade): remove |text_color| which is not used for MD.
IconLabelBubbleView(int contained_image,
const gfx::FontList& font_list,
SkColor text_color,
@@ -42,13 +43,6 @@ class IconLabelBubbleView : public views::View {
// construction.
void SetBackgroundImageGrid(const int background_images[]);
- // Divides the image designated by |background_image_id| into nine regions.
- // The four corners are specified by |insets|, the remainder are stretched to
- // fill the background. Subclasses are required to call this or
- // SetBackgroundImageGrid during construction.
- void SetBackgroundImageWithInsets(int background_image_id,
- gfx::Insets& insets);
-
void SetLabel(const base::string16& label);
void SetImage(const gfx::ImageSkia& image);
void set_is_extension_icon(bool is_extension_icon) {
@@ -59,6 +53,13 @@ class IconLabelBubbleView : public views::View {
views::ImageView* image() { return image_; }
views::Label* label() { return label_; }
+ // Gets the color for displaying text.
+ virtual SkColor GetTextColor() const = 0;
+
+ // Gets the color for the border (a more transparent version of
+ // which is used for the background).
+ virtual SkColor GetBorderColor() const = 0;
+
// Returns true when the background should be rendered.
virtual bool ShouldShowBackground() const;
@@ -70,6 +71,7 @@ class IconLabelBubbleView : public views::View {
// views::View:
gfx::Size GetPreferredSize() const override;
void Layout() override;
+ void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override;
const gfx::FontList& font_list() const { return label_->font_list(); }
@@ -91,7 +93,7 @@ class IconLabelBubbleView : public views::View {
const char* GetClassName() const override;
void OnPaint(gfx::Canvas* canvas) override;
- // For painting the background.
+ // For painting the background. TODO(estade): remove post MD launch.
scoped_ptr<views::Painter> background_painter_;
// The contents of the bubble.
« no previous file with comments | « chrome/browser/ui/views/location_bar/ev_bubble_view.cc ('k') | chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698