summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bubble_border.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/bubble_border.h')
-rw-r--r--chrome/browser/views/bubble_border.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/views/bubble_border.h b/chrome/browser/views/bubble_border.h
index e2d5de3..3670503 100644
--- a/chrome/browser/views/bubble_border.h
+++ b/chrome/browser/views/bubble_border.h
@@ -27,7 +27,9 @@ class BubbleBorder : public views::Border {
BOTTOM_RIGHT
};
- BubbleBorder() : arrow_location_(NONE), background_color_(SK_ColorWHITE) {
+ BubbleBorder() : override_arrow_x_offset_(0),
+ arrow_location_(NONE),
+ background_color_(SK_ColorWHITE) {
InitClass();
}
@@ -45,6 +47,12 @@ class BubbleBorder : public views::Border {
arrow_location_ = arrow_location;
}
+ // Sets a fixed x offset for the arrow. The arrow will still point to the
+ // same location but the bubble will shift horizontally to make that happen.
+ void set_arrow_offset(int offset) {
+ override_arrow_x_offset_ = offset;
+ }
+
// Sets the background color for the arrow body. This is irrelevant if you do
// not also set the arrow location to something other than NONE.
void set_background_color(SkColor background_color) {
@@ -99,6 +107,9 @@ class BubbleBorder : public views::Border {
static int arrow_x_offset_;
+ // If specified, overrides the pre-calculated |arrow_x_offset_| of the arrow.
+ int override_arrow_x_offset_;
+
ArrowLocation arrow_location_;
SkColor background_color_;