Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 8 |
| 9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds( | 119 gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds( |
| 120 const gfx::Rect& client_bounds) const { | 120 const gfx::Rect& client_bounds) const { |
| 121 return const_cast<BubbleFrameView*>(this)->GetUpdatedWindowBounds( | 121 return const_cast<BubbleFrameView*>(this)->GetUpdatedWindowBounds( |
| 122 gfx::Rect(), client_bounds.size(), false); | 122 gfx::Rect(), client_bounds.size(), false); |
| 123 } | 123 } |
| 124 | 124 |
| 125 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { | 125 int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { |
| 126 if (!bounds().Contains(point)) | 126 if (!bounds().Contains(point)) |
| 127 return HTNOWHERE; | 127 return HTNOWHERE; |
| 128 if (close_->visible() && close_->GetMirroredBounds().Contains(point)) | |
| 129 return HTCLOSE; | |
|
msw
2015/03/31 16:45:30
Hmm, do screen readers, software that assists the
dmazzoni
2015/03/31 16:55:46
Yes, they do call hit testing functions so at firs
msw
2015/03/31 16:57:22
We could hide the other tooltip when the native on
benwells
2015/03/31 22:06:57
I think that would look like adding an #if !define
msw
2015/03/31 22:11:26
What do browser frames do? Those seem to show nati
benwells
2015/04/08 00:19:13
Ah, yes the frames use the native hint as well. I'
| |
| 130 | 128 |
| 131 // Allow dialogs to show the system menu and be dragged. | 129 // Allow dialogs to show the system menu and be dragged. |
| 132 if (GetWidget()->widget_delegate()->AsDialogDelegate()) { | 130 if (GetWidget()->widget_delegate()->AsDialogDelegate()) { |
| 133 gfx::Rect sys_rect(0, 0, title_->x(), title_->y()); | 131 gfx::Rect sys_rect(0, 0, title_->x(), title_->y()); |
| 134 sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0)); | 132 sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0)); |
| 135 if (sys_rect.Contains(point)) | 133 if (sys_rect.Contains(point)) |
| 136 return HTSYSMENU; | 134 return HTSYSMENU; |
| 137 if (point.y() < title_->bounds().bottom()) | 135 if (point.y() < title_->bounds().bottom()) |
| 138 return HTCAPTION; | 136 return HTCAPTION; |
| 139 } | 137 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 if (titlebar_extra_view_ != NULL) | 422 if (titlebar_extra_view_ != NULL) |
| 425 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); | 423 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); |
| 426 gfx::Size size(client_size); | 424 gfx::Size size(client_size); |
| 427 size.SetToMax(gfx::Size(title_bar_width, 0)); | 425 size.SetToMax(gfx::Size(title_bar_width, 0)); |
| 428 const gfx::Insets insets(GetInsets()); | 426 const gfx::Insets insets(GetInsets()); |
| 429 size.Enlarge(insets.width(), insets.height()); | 427 size.Enlarge(insets.width(), insets.height()); |
| 430 return size; | 428 return size; |
| 431 } | 429 } |
| 432 | 430 |
| 433 } // namespace views | 431 } // namespace views |
| OLD | NEW |