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

Unified Diff: views/bubble/bubble_border.h

Issue 8493011: Merge 108537 - Align avatar bubble with edge of anchor control (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_view.cc ('k') | views/bubble/bubble_border.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/bubble/bubble_border.h
===================================================================
--- views/bubble/bubble_border.h (revision 108874)
+++ views/bubble/bubble_border.h (working copy)
@@ -35,9 +35,18 @@
FLOAT = 9 // No arrow. Centered over the supplied rect.
};
+ // The position of the bubble in relation to the anchor.
+ enum BubbleAlignment {
+ // The tip of the arrow points to the middle of the anchor.
+ ALIGN_ARROW_TO_MID_ANCHOR,
+ // The edge nearest to the arrow is lined up with the edge of the anchor.
+ ALIGN_EDGE_TO_ANCHOR_EDGE
+ };
+
explicit BubbleBorder(ArrowLocation arrow_location)
: override_arrow_offset_(0),
arrow_location_(arrow_location),
+ alignment_(ALIGN_ARROW_TO_MID_ANCHOR),
background_color_(SK_ColorWHITE) {
InitClass();
}
@@ -57,6 +66,10 @@
}
ArrowLocation arrow_location() const { return arrow_location_; }
+ // Sets the alignment.
+ void set_alignment(BubbleAlignment alignment) { alignment_ = alignment; }
+ BubbleAlignment alignment() const { return alignment_; }
+
static ArrowLocation horizontal_mirror(ArrowLocation loc) {
return loc >= NONE ? loc : static_cast<ArrowLocation>(loc ^ 1);
}
@@ -151,6 +164,7 @@
int override_arrow_offset_;
ArrowLocation arrow_location_;
+ BubbleAlignment alignment_;
SkColor background_color_;
DISALLOW_COPY_AND_ASSIGN(BubbleBorder);
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_view.cc ('k') | views/bubble/bubble_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698