| 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 15 matching lines...) Expand all Loading... |
| 26 widget_ = surface_factory->GetAcceleratedWidget(); | 26 widget_ = surface_factory->GetAcceleratedWidget(); |
| 27 | 27 |
| 28 surface_factory->AttemptToResizeAcceleratedWidget(widget_, bounds_); | 28 surface_factory->AttemptToResizeAcceleratedWidget(widget_, bounds_); |
| 29 | 29 |
| 30 base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this); | 30 base::MessagePumpOzone::Current()->AddDispatcherForRootWindow(this); |
| 31 CreateCompositor(GetAcceleratedWidget()); | 31 CreateCompositor(GetAcceleratedWidget()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 RootWindowHostOzone::~RootWindowHostOzone() { | 34 RootWindowHostOzone::~RootWindowHostOzone() { |
| 35 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); | 35 base::MessagePumpOzone::Current()->RemoveDispatcherForRootWindow(0); |
| 36 DestroyCompositor(); |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool RootWindowHostOzone::Dispatch(const base::NativeEvent& ne) { | 39 bool RootWindowHostOzone::Dispatch(const base::NativeEvent& ne) { |
| 39 ui::Event* event = static_cast<ui::Event*>(ne); | 40 ui::Event* event = static_cast<ui::Event*>(ne); |
| 40 if (event->IsTouchEvent()) { | 41 if (event->IsTouchEvent()) { |
| 41 ui::TouchEvent* touchev = static_cast<ui::TouchEvent*>(ne); | 42 ui::TouchEvent* touchev = static_cast<ui::TouchEvent*>(ne); |
| 42 delegate_->OnHostTouchEvent(touchev); | 43 delegate_->OnHostTouchEvent(touchev); |
| 43 } else if (event->IsKeyEvent()) { | 44 } else if (event->IsKeyEvent()) { |
| 44 ui::KeyEvent* keyev = static_cast<ui::KeyEvent*>(ne); | 45 ui::KeyEvent* keyev = static_cast<ui::KeyEvent*>(ne); |
| 45 delegate_->OnHostKeyEvent(keyev); | 46 delegate_->OnHostKeyEvent(keyev); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return new RootWindowHostOzone(bounds); | 126 return new RootWindowHostOzone(bounds); |
| 126 } | 127 } |
| 127 | 128 |
| 128 // static | 129 // static |
| 129 gfx::Size RootWindowHost::GetNativeScreenSize() { | 130 gfx::Size RootWindowHost::GetNativeScreenSize() { |
| 130 NOTIMPLEMENTED(); | 131 NOTIMPLEMENTED(); |
| 131 return gfx::Size(); | 132 return gfx::Size(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 } // namespace aura | 135 } // namespace aura |
| OLD | NEW |