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

Unified Diff: ui/views/bubble/tray_bubble_view.h

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: . Created 4 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: ui/views/bubble/tray_bubble_view.h
diff --git a/ui/views/bubble/tray_bubble_view.h b/ui/views/bubble/tray_bubble_view.h
index 75d5c015a75c2c4e7b61e61a1d657f4cf8bf23dd..b337e5f292bb096b5f2ef3ba64fde75bdc80aaa0 100644
--- a/ui/views/bubble/tray_bubble_view.h
+++ b/ui/views/bubble/tray_bubble_view.h
@@ -35,26 +35,16 @@ class TrayBubbleContentMask;
class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
public views::MouseWatcherListener {
public:
- // AnchorType differentiates between bubbles that are anchored on a tray
- // element (ANCHOR_TYPE_TRAY) and display an arrow, or that are floating on
- // the screen away from the tray (ANCHOR_TYPE_BUBBLE).
- enum AnchorType {
- ANCHOR_TYPE_TRAY,
- ANCHOR_TYPE_BUBBLE,
- };
-
// AnchorAlignment determines to which side of the anchor the bubble will
// align itself.
enum AnchorAlignment {
ANCHOR_ALIGNMENT_BOTTOM,
ANCHOR_ALIGNMENT_LEFT,
ANCHOR_ALIGNMENT_RIGHT,
- ANCHOR_ALIGNMENT_TOP
};
class VIEWS_EXPORT Delegate {
public:
- typedef TrayBubbleView::AnchorType AnchorType;
typedef TrayBubbleView::AnchorAlignment AnchorAlignment;
Delegate() {}
@@ -74,13 +64,6 @@ class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
// accessible name for the bubble.
virtual base::string16 GetAccessibleNameForBubble() = 0;
- // Passes responsibility for BubbleDialogDelegateView::GetAnchorRect to the
- // delegate.
- virtual gfx::Rect GetAnchorRect(
- views::Widget* anchor_widget,
- AnchorType anchor_type,
- AnchorAlignment anchor_alignment) const = 0;
-
// Called before Widget::Init() on |bubble_widget|. Allows |params| to be
// modified.
virtual void OnBeforeBubbleWidgetInit(Widget* anchor_widget,
@@ -96,27 +79,15 @@ class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
};
struct VIEWS_EXPORT InitParams {
- static const int kArrowDefaultOffset;
-
- InitParams(AnchorType anchor_type,
- AnchorAlignment anchor_alignment,
- int min_width,
- int max_width);
+ InitParams(AnchorAlignment anchor_alignment, int min_width, int max_width);
InitParams(const InitParams& other);
- AnchorType anchor_type;
AnchorAlignment anchor_alignment;
int min_width;
int max_width;
int max_height;
bool can_activate;
bool close_on_deactivate;
- SkColor arrow_color;
- bool first_item_has_no_margin;
- views::BubbleBorder::Arrow arrow;
- int arrow_offset;
- views::BubbleBorder::ArrowPaintType arrow_paint_type;
- views::BubbleBorder::Shadow shadow;
- views::BubbleBorder::BubbleAlignment arrow_alignment;
+ SkColor bg_color;
};
// Constructs and returns a TrayBubbleView. |init_params| may be modified.
@@ -139,9 +110,6 @@ class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
// Sets the bubble width.
void SetWidth(int width);
- // Sets whether or not to paint the bubble border arrow.
- void SetArrowPaintType(views::BubbleBorder::ArrowPaintType arrow_paint_type);
-
// Returns the border insets. Called by TrayEventFilter.
gfx::Insets GetBorderInsets() const;
@@ -161,7 +129,7 @@ class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
base::string16 GetAccessibleWindowTitle() const override;
// Overridden from views::BubbleDialogDelegateView.
- gfx::Rect GetAnchorRect() const override;
+ // gfx::Rect GetAnchorRect() const override;
void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
Widget* bubble_widget) const override;
@@ -196,7 +164,7 @@ class VIEWS_EXPORT TrayBubbleView : public views::BubbleDialogDelegateView,
int preferred_width_;
// |bubble_border_| and |owned_bubble_border_| point to the same thing, but
// the latter ensures we don't leak it before passing off ownership.
- internal::TrayBubbleBorder* bubble_border_;
+ BubbleBorder* bubble_border_;
std::unique_ptr<views::BubbleBorder> owned_bubble_border_;
std::unique_ptr<internal::TrayBubbleContentMask> bubble_content_mask_;
bool is_gesture_dragging_;

Powered by Google App Engine
This is Rietveld 408576698