| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/aura/root_window_host_ozone.h" | 5 #include "ui/aura/root_window_host_ozone.h" |
| 6 | 6 |
| 7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/events/ozone/event_factory_ozone.h" | 8 #include "ui/events/ozone/event_factory_ozone.h" |
| 9 #include "ui/gfx/ozone/surface_factory_ozone.h" | 9 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| 10 #include "ui/ozone/ozone_platform.h" | 10 #include "ui/ozone/ozone_platform.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 CreateCompositor(GetAcceleratedWidget()); | 31 CreateCompositor(GetAcceleratedWidget()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 WindowTreeHostOzone::~WindowTreeHostOzone() { | 34 WindowTreeHostOzone::~WindowTreeHostOzone() { |
| 35 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); | 35 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); |
| 36 DestroyCompositor(); | 36 DestroyCompositor(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 uint32_t WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) { | 39 uint32_t WindowTreeHostOzone::Dispatch(const base::NativeEvent& ne) { |
| 40 ui::Event* event = static_cast<ui::Event*>(ne); | 40 ui::Event* event = static_cast<ui::Event*>(ne); |
| 41 |
| 42 if (event->type() == ui::ET_MOUSE_MOVED) { |
| 43 ui::MouseEvent* mouse_event = static_cast<ui::MouseEvent*>(event); |
| 44 gfx::SurfaceFactoryOzone::GetInstance()->MoveCursorTo( |
| 45 mouse_event->location()); |
| 46 } |
| 47 |
| 41 ui::EventDispatchDetails details ALLOW_UNUSED = SendEventToProcessor(event); | 48 ui::EventDispatchDetails details ALLOW_UNUSED = SendEventToProcessor(event); |
| 42 return POST_DISPATCH_NONE; | 49 return POST_DISPATCH_NONE; |
| 43 } | 50 } |
| 44 | 51 |
| 45 RootWindow* WindowTreeHostOzone::GetRootWindow() { | 52 RootWindow* WindowTreeHostOzone::GetRootWindow() { |
| 46 return delegate_->AsRootWindow(); | 53 return delegate_->AsRootWindow(); |
| 47 } | 54 } |
| 48 | 55 |
| 49 gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() { | 56 gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() { |
| 50 return widget_; | 57 return widget_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 70 | 77 |
| 71 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { | 78 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { |
| 72 return bounds_.origin(); | 79 return bounds_.origin(); |
| 73 } | 80 } |
| 74 | 81 |
| 75 void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); } | 82 void WindowTreeHostOzone::SetCapture() { NOTIMPLEMENTED(); } |
| 76 | 83 |
| 77 void WindowTreeHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); } | 84 void WindowTreeHostOzone::ReleaseCapture() { NOTIMPLEMENTED(); } |
| 78 | 85 |
| 79 void WindowTreeHostOzone::SetCursor(gfx::NativeCursor cursor) { | 86 void WindowTreeHostOzone::SetCursor(gfx::NativeCursor cursor) { |
| 80 NOTIMPLEMENTED(); | 87 gfx::SurfaceFactoryOzone::GetInstance()->SetCursorImage(*cursor.platform()); |
| 81 } | 88 } |
| 82 | 89 |
| 83 bool WindowTreeHostOzone::QueryMouseLocation(gfx::Point* location_return) { | 90 bool WindowTreeHostOzone::QueryMouseLocation(gfx::Point* location_return) { |
| 84 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
| 85 return false; | 92 return false; |
| 86 } | 93 } |
| 87 | 94 |
| 88 bool WindowTreeHostOzone::ConfineCursorToRootWindow() { | 95 bool WindowTreeHostOzone::ConfineCursorToRootWindow() { |
| 89 NOTIMPLEMENTED(); | 96 NOTIMPLEMENTED(); |
| 90 return false; | 97 return false; |
| 91 } | 98 } |
| 92 | 99 |
| 93 void WindowTreeHostOzone::UnConfineCursor() { NOTIMPLEMENTED(); } | 100 void WindowTreeHostOzone::UnConfineCursor() { NOTIMPLEMENTED(); } |
| 94 | 101 |
| 95 void WindowTreeHostOzone::OnCursorVisibilityChanged(bool show) { | 102 void WindowTreeHostOzone::OnCursorVisibilityChanged(bool show) { |
| 96 NOTIMPLEMENTED(); | 103 NOTIMPLEMENTED(); |
| 97 } | 104 } |
| 98 | 105 |
| 99 void WindowTreeHostOzone::MoveCursorTo(const gfx::Point& location) { | 106 void WindowTreeHostOzone::MoveCursorTo(const gfx::Point& location) { |
| 100 NOTIMPLEMENTED(); | 107 gfx::SurfaceFactoryOzone::GetInstance()->MoveCursorTo(location); |
| 101 } | 108 } |
| 102 | 109 |
| 103 void WindowTreeHostOzone::PostNativeEvent( | 110 void WindowTreeHostOzone::PostNativeEvent( |
| 104 const base::NativeEvent& native_event) { | 111 const base::NativeEvent& native_event) { |
| 105 NOTIMPLEMENTED(); | 112 NOTIMPLEMENTED(); |
| 106 } | 113 } |
| 107 | 114 |
| 108 void WindowTreeHostOzone::OnDeviceScaleFactorChanged( | 115 void WindowTreeHostOzone::OnDeviceScaleFactorChanged( |
| 109 float device_scale_factor) { | 116 float device_scale_factor) { |
| 110 NOTIMPLEMENTED(); | 117 NOTIMPLEMENTED(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 121 return new WindowTreeHostOzone(bounds); | 128 return new WindowTreeHostOzone(bounds); |
| 122 } | 129 } |
| 123 | 130 |
| 124 // static | 131 // static |
| 125 gfx::Size WindowTreeHost::GetNativeScreenSize() { | 132 gfx::Size WindowTreeHost::GetNativeScreenSize() { |
| 126 NOTIMPLEMENTED(); | 133 NOTIMPLEMENTED(); |
| 127 return gfx::Size(); | 134 return gfx::Size(); |
| 128 } | 135 } |
| 129 | 136 |
| 130 } // namespace aura | 137 } // namespace aura |
| OLD | NEW |