| 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/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 } | 976 } |
| 977 | 977 |
| 978 const TooltipManager* Widget::GetTooltipManager() const { | 978 const TooltipManager* Widget::GetTooltipManager() const { |
| 979 return native_widget_->GetTooltipManager(); | 979 return native_widget_->GetTooltipManager(); |
| 980 } | 980 } |
| 981 | 981 |
| 982 gfx::Rect Widget::GetWorkAreaBoundsInScreen() const { | 982 gfx::Rect Widget::GetWorkAreaBoundsInScreen() const { |
| 983 return native_widget_->GetWorkAreaBoundsInScreen(); | 983 return native_widget_->GetWorkAreaBoundsInScreen(); |
| 984 } | 984 } |
| 985 | 985 |
| 986 void Widget::SynthesizeMouseMoveEvent() { | 986 void Widget::SynthesizeMouseMoveEvent(bool force) { |
| 987 // In screen coordinate. | 987 // In screen coordinate. |
| 988 gfx::Point mouse_location = EventMonitor::GetLastMouseLocation(); | 988 gfx::Point mouse_location = EventMonitor::GetLastMouseLocation(); |
| 989 if (!GetWindowBoundsInScreen().Contains(mouse_location)) | 989 if (!force && !GetWindowBoundsInScreen().Contains(mouse_location)) |
| 990 return; | 990 return; |
| 991 | 991 |
| 992 // Convert: screen coordinate -> widget coordinate. | 992 // Convert: screen coordinate -> widget coordinate. |
| 993 View::ConvertPointFromScreen(root_view_.get(), &mouse_location); | 993 View::ConvertPointFromScreen(root_view_.get(), &mouse_location); |
| 994 last_mouse_event_was_move_ = false; | 994 last_mouse_event_was_move_ = false; |
| 995 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, mouse_location, | 995 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, mouse_location, |
| 996 mouse_location, ui::EventTimeForNow(), | 996 mouse_location, ui::EventTimeForNow(), |
| 997 ui::EF_IS_SYNTHESIZED, 0); | 997 ui::EF_IS_SYNTHESIZED, 0); |
| 998 root_view_->OnMouseMoved(mouse_event); | 998 root_view_->OnMouseMoved(mouse_event); |
| 999 } | 999 } |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 | 1567 |
| 1568 //////////////////////////////////////////////////////////////////////////////// | 1568 //////////////////////////////////////////////////////////////////////////////// |
| 1569 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1569 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1570 | 1570 |
| 1571 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1571 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1572 return this; | 1572 return this; |
| 1573 } | 1573 } |
| 1574 | 1574 |
| 1575 } // namespace internal | 1575 } // namespace internal |
| 1576 } // namespace views | 1576 } // namespace views |
| OLD | NEW |