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

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

Issue 1763713004: Adjusts content bubble animation with respect to icon size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjusts content bubble animation with respect to icon size (nits) Created 4 years, 9 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 f1a58d69658e70239a52d6c293add91fd8085987..9cefe0feae97a9b6b38aafbb199fc0b842ef78e0 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
@@ -54,6 +54,7 @@ class IconLabelBubbleView : public views::InkDropHostView {
protected:
views::ImageView* image() { 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;
@@ -70,6 +71,9 @@ class IconLabelBubbleView : public views::InkDropHostView {
// full-width view and can be used to animate the width of the view.
virtual double WidthMultiplier() const;
+ // Returns true when animation is in progress and is shrinking.
+ virtual bool IsShrinking() const;
+
// Returns the amount of horizontal space needed to draw the image and its
// padding before the label.
virtual int GetImageAndPaddingWidth() const;
@@ -87,18 +91,18 @@ class IconLabelBubbleView : public views::InkDropHostView {
SkColor GetParentBackgroundColor() const;
- gfx::Size GetSizeForLabelWidth(int width) const;
+ gfx::Size GetSizeForLabelWidth(int label_width) const;
+
+ // Amount of padding from the edge of the icon / label to the outer edge of
+ // the bubble view. If |leading| is true, this is the padding at the
+ // beginning of the bubble (left in LTR), otherwise it's the trailing padding.
+ int GetBubbleOuterPadding(bool leading) 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 at the edges of the bubble. If |leading| is true, this
- // is the padding at the beginning of the bubble (left in LTR), otherwise it's
- // the end padding.
- int GetBubbleOuterPadding(bool leading) const;
-
// As above, but for Material Design. TODO(estade): remove/replace the above.
int GetBubbleOuterPaddingMd(bool leading) const;

Powered by Google App Engine
This is Rietveld 408576698