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

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

Issue 2348853004: Remove non-md code in location bar (Views). (Closed)
Patch Set: resolve change collision Created 4 years, 3 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
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 35faf5d6241901ea3e4b7fe9ff73e15eb48e7ec9..a11513cf2c85a4bd0b28d22ac668782553e328d8 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
@@ -23,7 +23,6 @@ class ImageSkia;
namespace views {
class ImageView;
class Label;
-class Painter;
}
// View used to draw a bubble, containing an icon and a label. We use this as a
@@ -33,22 +32,11 @@ class IconLabelBubbleView : public views::InkDropHostView {
public:
static constexpr int kTrailingPaddingPreMd = 2;
- IconLabelBubbleView(int contained_image,
- const gfx::FontList& font_list,
- SkColor parent_background_color,
- bool elide_in_middle);
+ IconLabelBubbleView(const gfx::FontList& font_list, bool elide_in_middle);
~IconLabelBubbleView() override;
- // Sets a background that paints |background_images| in a scalable grid.
- // Subclasses must call this during construction.
- void SetBackgroundImageGrid(const int background_images[]);
- void UnsetBackgroundImageGrid();
-
void SetLabel(const base::string16& label);
void SetImage(const gfx::ImageSkia& image);
- void set_is_extension_icon(bool is_extension_icon) {
- is_extension_icon_ = is_extension_icon;
- }
const views::ImageView* GetImageView() const { return image_; }
views::ImageView* GetImageView() { return image_; }
@@ -57,18 +45,15 @@ class IconLabelBubbleView : public views::InkDropHostView {
static constexpr int kOpenTimeMS = 150;
views::ImageView* image() { return image_; }
+ const views::ImageView* image() const { return image_; }
views::Label* label() { return label_; }
const views::Label* label() const { 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;
+ // Returns true when the label should be visible.
+ virtual bool ShouldShowLabel() const;
// Returns a multiplier used to calculate the actual width of the view based
// on its desired width. This ranges from 0 for a zero-width view to 1 for a
@@ -100,22 +85,11 @@ class IconLabelBubbleView : public views::InkDropHostView {
gfx::Size GetSizeForLabelWidth(int label_width) const;
- // Returns the minimum width the view can be to show the complete image when
- // the background is showing.
- int MinimumWidthForImageWithBackgroundShown() const;
-
private:
- // Sets a background color on |label_| based on |chip_background_color| and
- // the parent's bg color.
- void SetLabelBackgroundColor(SkColor chip_background_color);
-
// Amount of padding from the leading edge of the view to the leading edge of
- // the image (if |leading| is true), or from the trailing edge of the label
- // (or image, if the label is invisible) to the trailing edge of the view.
- int GetOuterPadding(bool leading) const;
-
- // Horizontal position of the image trailing edge (i.e. just after the image).
- int GetImageTrailingEdge() const;
+ // the image, and from the trailing edge of the label (or image, if the label
+ // is invisible) to the trailing edge of the view.
+ int GetOuterPadding() const;
// Spacing between the image and the label.
int GetInternalSpacing() const;
@@ -127,22 +101,10 @@ class IconLabelBubbleView : public views::InkDropHostView {
const char* GetClassName() const override;
void OnPaint(gfx::Canvas* canvas) override;
- // For painting the background. TODO(estade): remove post MD launch.
- std::unique_ptr<views::Painter> background_painter_;
-
// The contents of the bubble.
views::ImageView* image_;
views::Label* label_;
- bool is_extension_icon_;
-
- // This is only used in pre-MD. In MD, the background color is derived from
- // the native theme (so it responds to native theme updates). TODO(estade):
- // remove when MD is default.
- SkColor parent_background_color_;
-
- bool should_show_background_;
-
DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView);
};

Powered by Google App Engine
This is Rietveld 408576698