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

Unified Diff: ui/views/bubble/bubble_border.cc

Issue 2524223002: MacViews: Anchor bubbles according to the MD spec. (Closed)
Patch Set: Zap unnecessary patchset dep 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
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_border.cc
diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc
index 7c3d8b1657521a1ffcebee9620c2190f8bec9d25..b151db0f348ce4d48a8c6535c7eaee1c3621442f 100644
--- a/ui/views/bubble/bubble_border.cc
+++ b/ui/views/bubble/bubble_border.cc
@@ -222,7 +222,8 @@ gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& anchor_rect,
// misalignment in scale factors greater than 1.
// TODO(estade): when it becomes possible to provide px bounds instead of
// dip bounds, fix this.
- const gfx::Insets border_insets = gfx::Insets(kBorderThicknessDip);
+ const gfx::Insets border_insets =
+ shadow_ == NO_ASSETS ? gfx::Insets() : gfx::Insets(kBorderThicknessDip);
const gfx::Insets shadow_insets = GetInsets() - border_insets;
contents_bounds.Inset(-border_insets);
if (arrow_ == TOP_RIGHT) {
@@ -238,6 +239,9 @@ gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& anchor_rect,
} else if (arrow_ == RIGHT_CENTER) {
contents_bounds += LeftCenter(anchor_rect) - RightCenter(contents_bounds);
}
+ // With NO_ASSETS, there should be further insets, but the same logic is
+ // used to position the bubble origin according to |anchor_rect|.
+ DCHECK(shadow_ != NO_ASSETS || shadow_insets.IsEmpty());
contents_bounds.Inset(-shadow_insets);
// |arrow_offset_| is used to adjust bubbles that would normally be
// partially offscreen.
@@ -369,7 +373,6 @@ gfx::Insets BubbleBorder::GetInsets() const {
gfx::Insets blur(kLargeShadowBlur);
gfx::Insets offset(-kLargeShadowVerticalOffset, 0,
kLargeShadowVerticalOffset, 0);
- gfx::Insets border(kBorderThicknessDip);
return blur + offset;
}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698