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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 1836993004: Fix bubble client area clipping regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds( 133 gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds(
134 const gfx::Rect& client_bounds) const { 134 const gfx::Rect& client_bounds) const {
135 gfx::Size size(GetSizeForClientSize(client_bounds.size())); 135 gfx::Size size(GetSizeForClientSize(client_bounds.size()));
136 return bubble_border_->GetBounds(gfx::Rect(), size); 136 return bubble_border_->GetBounds(gfx::Rect(), size);
137 } 137 }
138 138
139 bool BubbleFrameView::GetClientMask(const gfx::Size& size, 139 bool BubbleFrameView::GetClientMask(const gfx::Size& size,
140 gfx::Path* path) const { 140 gfx::Path* path) const {
141 const int radius = bubble_border_->GetBorderCornerRadius(); 141 const int radius = bubble_border_->GetBorderCornerRadius();
142 gfx::Insets content_insets = GetInsets();
143 // If the client bounds don't touch the edges, no need to mask.
Evan Stade 2016/03/29 01:27:58 This additional early return is not necessary for
144 if (content_insets.top() > radius && content_insets.left() > radius &&
145 content_insets.bottom() > radius && content_insets.right()) {
msw 2016/03/29 22:54:55 Did you mean to check |content_insets.right() > ra
Evan Stade 2016/03/29 23:04:41 good idea, done.
146 return false;
147 }
142 gfx::RectF rect((gfx::Rect(size))); 148 gfx::RectF rect((gfx::Rect(size)));
msw 2016/03/29 22:54:55 nit: remove extra parens?
Evan Stade 2016/03/29 23:04:41 that produces an error message: ../../ui/views/bu
msw 2016/03/29 23:08:27 Weird, but this seems familiar, and likely came up
143 rect.Inset(gfx::InsetsF(0.5f));
144 path->addRoundRect(gfx::RectFToSkRect(rect), radius, radius); 149 path->addRoundRect(gfx::RectFToSkRect(rect), radius, radius);
145 return true; 150 return true;
146 } 151 }
147 152
148 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { 153 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
149 if (!bounds().Contains(point)) 154 if (!bounds().Contains(point))
150 return HTNOWHERE; 155 return HTNOWHERE;
151 if (close_->visible() && close_->GetMirroredBounds().Contains(point)) 156 if (close_->visible() && close_->GetMirroredBounds().Contains(point))
152 return HTCLOSE; 157 return HTCLOSE;
153 158
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 size.Enlarge(client_insets.width(), client_insets.height()); 518 size.Enlarge(client_insets.width(), client_insets.height());
514 size.SetToMax(gfx::Size(title_bar_width, 0)); 519 size.SetToMax(gfx::Size(title_bar_width, 0));
515 520
516 if (footnote_container_) 521 if (footnote_container_)
517 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); 522 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
518 523
519 return size; 524 return size;
520 } 525 }
521 526
522 } // namespace views 527 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698