Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / ui / aura / window_tree_host_ozone.cc
blobb400962ce510e866b9039471a1e5c3f5a0a3d03b
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
3 // found in the LICENSE file.
5 #include "ui/aura/window_tree_host_ozone.h"
7 #include "ui/aura/window_event_dispatcher.h"
8 #include "ui/ozone/public/ozone_platform.h"
9 #include "ui/platform_window/platform_window.h"
11 namespace aura {
13 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds)
14 : widget_(gfx::kNullAcceleratedWidget) {
15 platform_window_ =
16 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
19 WindowTreeHostOzone::~WindowTreeHostOzone() {
20 DestroyCompositor();
21 DestroyDispatcher();
24 void WindowTreeHostOzone::OnBoundsChanged(const gfx::Rect& new_bounds) {
25 // TOOD(spang): Should we determine which parts changed?
26 OnHostResized(new_bounds.size());
27 OnHostMoved(new_bounds.origin());
30 void WindowTreeHostOzone::OnDamageRect(const gfx::Rect& damaged_region) {
33 void WindowTreeHostOzone::DispatchEvent(ui::Event* event) {
34 SendEventToProcessor(event);
37 void WindowTreeHostOzone::OnCloseRequest() {
38 OnHostCloseRequested();
41 void WindowTreeHostOzone::OnClosed() {
44 void WindowTreeHostOzone::OnWindowStateChanged(
45 ui::PlatformWindowState new_state) {
48 void WindowTreeHostOzone::OnLostCapture() {
51 void WindowTreeHostOzone::OnAcceleratedWidgetAvailable(
52 gfx::AcceleratedWidget widget) {
53 widget_ = widget;
54 CreateCompositor(widget_);
57 void WindowTreeHostOzone::OnActivationChanged(bool active) {
60 ui::EventSource* WindowTreeHostOzone::GetEventSource() {
61 return this;
64 gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() {
65 return widget_;
68 void WindowTreeHostOzone::Show() {
69 platform_window_->Show();
72 void WindowTreeHostOzone::Hide() {
73 platform_window_->Hide();
76 gfx::Rect WindowTreeHostOzone::GetBounds() const {
77 return platform_window_->GetBounds();
80 void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
81 platform_window_->SetBounds(bounds);
84 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const {
85 return platform_window_->GetBounds().origin();
88 void WindowTreeHostOzone::SetCapture() {
89 platform_window_->SetCapture();
92 void WindowTreeHostOzone::ReleaseCapture() {
93 platform_window_->ReleaseCapture();
96 void WindowTreeHostOzone::SetCursorNative(gfx::NativeCursor cursor) {
97 platform_window_->SetCursor(cursor.platform());
100 void WindowTreeHostOzone::MoveCursorToNative(const gfx::Point& location) {
101 platform_window_->MoveCursorTo(location);
104 void WindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) {
105 NOTIMPLEMENTED();
108 ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() {
109 return dispatcher();
112 // static
113 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
114 return new WindowTreeHostOzone(bounds);
117 // static
118 gfx::Size WindowTreeHost::GetNativeScreenSize() {
119 NOTIMPLEMENTED();
120 return gfx::Size();
123 } // namespace aura