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

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

Issue 23622020: Fixing the dynamic positioning (move with anchor) for the app launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 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: ui/views/bubble/bubble_delegate.h
diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h
index dff9bd4506f9968727d5a55501ecd05f27d3b112..2748020ffaae244f0f072016097a121d30c15778 100644
--- a/ui/views/bubble/bubble_delegate.h
+++ b/ui/views/bubble/bubble_delegate.h
@@ -144,8 +144,12 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
virtual void Init();
// Set the anchor view or rect; set these before CreateBubble or Show.
+ // If an |anchor_view| is given the |anchor_rect| will be ignored, but an
+ // |anchor_offset| can be supplied to offset the final coordinates. This is
+ // especially needed when |move_with_anchor_| gets set.
void set_anchor_view(View* anchor_view) { anchor_view_ = anchor_view; }
void set_anchor_rect(const gfx::Rect& rect) { anchor_rect_ = rect; }
+ void set_anchor_offset(const gfx::Point& offset) {anchor_offset_ = offset; }
xiyuan 2013/09/06 04:34:53 nit: the new fashion is to use Vector2d for offset
Mr4D (OOO till 08-26) 2013/09/06 17:57:31 Done.
// Resize and potentially move the bubble to fit the content's preferred size.
void SizeToContents();
@@ -181,6 +185,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// The anchor rect used in the absence of an anchor view.
gfx::Rect anchor_rect_;
+ // An anchor offset which will get added to the |anchor_view_|'s location.
+ gfx::Point anchor_offset_;
+
// If true, the bubble will re-anchor (and may resize) with |anchor_widget_|.
bool move_with_anchor_;

Powered by Google App Engine
This is Rietveld 408576698