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

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

Issue 2380763002: Adjust positioning of website settings popup for Harmony. (Closed)
Patch Set: typo Created 4 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc ('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 0cc3b3a0cda898cd441b7e09f78871cee1cf6975..35614bc149cb400c762a4129eb4997b60aeef08a 100644
--- a/ui/views/bubble/bubble_border.cc
+++ b/ui/views/bubble/bubble_border.cc
@@ -188,17 +188,21 @@ void BubbleBorder::set_paint_arrow(ArrowPaintType value) {
gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& anchor_rect,
const gfx::Size& contents_size) const {
- if (UseMd()) {
+ if (UseMd() && (arrow_ == TOP_RIGHT || arrow_ == TOP_LEFT)) {
// In MD, there are no arrows, so positioning logic is significantly
// simpler.
// TODO(estade): handle more anchor positions.
+ gfx::Rect contents_bounds(contents_size);
if (arrow_ == TOP_RIGHT) {
- gfx::Rect contents_bounds(contents_size);
contents_bounds +=
anchor_rect.bottom_right() - contents_bounds.top_right();
- contents_bounds.Inset(-GetInsets());
- return contents_bounds;
}
+ if (arrow_ == TOP_LEFT) {
sky 2016/09/29 03:19:54 Does this do the right thing for rtl?
Evan Stade 2016/09/29 17:27:53 yes
+ contents_bounds +=
+ anchor_rect.bottom_left() - contents_bounds.origin();
+ }
+ contents_bounds.Inset(-GetInsets());
+ return contents_bounds;
}
int x = anchor_rect.x();
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698