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

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

Issue 1809933003: Port BubbleDelegate tests to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 gfx::Size size(GetSizeForClientSize(client_bounds.size())); 133 gfx::Size size(GetSizeForClientSize(client_bounds.size()));
134 return bubble_border_->GetBounds(gfx::Rect(), size); 134 return bubble_border_->GetBounds(gfx::Rect(), size);
135 } 135 }
136 136
137 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { 137 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
138 if (!bounds().Contains(point)) 138 if (!bounds().Contains(point))
139 return HTNOWHERE; 139 return HTNOWHERE;
140 if (close_->visible() && close_->GetMirroredBounds().Contains(point)) 140 if (close_->visible() && close_->GetMirroredBounds().Contains(point))
141 return HTCLOSE; 141 return HTCLOSE;
142 142
143 // Allow dialogs to show the system menu and be dragged. 143 // Allow dialogs to show the system menu and be dragged.
msw 2016/03/17 17:28:26 nit: "allow non-bubble dialogs"?
Evan Stade 2016/03/17 22:41:34 I think the code is the best documentation in this
144 if (GetWidget()->widget_delegate()->AsDialogDelegate()) { 144 if (GetWidget()->widget_delegate()->AsDialogDelegate() &&
145 !GetWidget()->widget_delegate()->AsBubbleDialogDelegate()) {
145 gfx::Rect sys_rect(0, 0, title_->x(), title_->y()); 146 gfx::Rect sys_rect(0, 0, title_->x(), title_->y());
146 sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0)); 147 sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0));
147 if (sys_rect.Contains(point)) 148 if (sys_rect.Contains(point))
148 return HTSYSMENU; 149 return HTSYSMENU;
149 if (point.y() < title_->bounds().bottom()) 150 if (point.y() < title_->bounds().bottom())
150 return HTCAPTION; 151 return HTCAPTION;
151 } 152 }
152 153
153 return GetWidget()->client_view()->NonClientHitTest(point); 154 return GetWidget()->client_view()->NonClientHitTest(point);
154 } 155 }
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 size.Enlarge(client_insets.width(), client_insets.height()); 489 size.Enlarge(client_insets.width(), client_insets.height());
489 size.SetToMax(gfx::Size(title_bar_width, 0)); 490 size.SetToMax(gfx::Size(title_bar_width, 0));
490 491
491 if (footnote_container_) 492 if (footnote_container_)
492 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); 493 size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
493 494
494 return size; 495 return size;
495 } 496 }
496 497
497 } // namespace views 498 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698