[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / ui / aura / window_tree_host_ozone.cc
blob010f633167d07cdd953c99a19a4c12bbd38fb7d0
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/cursor_factory_ozone.h"
9 #include "ui/ozone/public/event_factory_ozone.h"
10 #include "ui/ozone/public/ozone_platform.h"
11 #include "ui/platform_window/platform_window.h"
13 namespace aura {
15 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds)
16 : widget_(gfx::kNullAcceleratedWidget) {
17 platform_window_ =
18 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
21 WindowTreeHostOzone::~WindowTreeHostOzone() {
22 DestroyCompositor();
23 DestroyDispatcher();
26 void WindowTreeHostOzone::OnBoundsChanged(const gfx::Rect& new_bounds) {
27 // TOOD(spang): Should we determine which parts changed?
28 OnHostResized(new_bounds.size());
29 OnHostMoved(new_bounds.origin());
32 void WindowTreeHostOzone::OnDamageRect(const gfx::Rect& damaged_region) {
35 void WindowTreeHostOzone::DispatchEvent(ui::Event* event) {
36 SendEventToProcessor(event);
39 void WindowTreeHostOzone::OnCloseRequest() {
40 OnHostCloseRequested();
43 void WindowTreeHostOzone::OnClosed() {
46 void WindowTreeHostOzone::OnWindowStateChanged(
47 ui::PlatformWindowState new_state) {
50 void WindowTreeHostOzone::OnLostCapture() {
53 void WindowTreeHostOzone::OnAcceleratedWidgetAvailable(
54 gfx::AcceleratedWidget widget) {
55 widget_ = widget;
56 CreateCompositor(widget_);
59 ui::EventSource* WindowTreeHostOzone::GetEventSource() {
60 return this;
63 gfx::AcceleratedWidget WindowTreeHostOzone::GetAcceleratedWidget() {
64 return widget_;
67 void WindowTreeHostOzone::Show() {
68 platform_window_->Show();
71 void WindowTreeHostOzone::Hide() {
72 platform_window_->Hide();
75 gfx::Rect WindowTreeHostOzone::GetBounds() const {
76 return platform_window_->GetBounds();
79 void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) {
80 platform_window_->SetBounds(bounds);
83 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const {
84 return platform_window_->GetBounds().origin();
87 void WindowTreeHostOzone::SetCapture() {
88 platform_window_->SetCapture();
91 void WindowTreeHostOzone::ReleaseCapture() {
92 platform_window_->ReleaseCapture();
95 void WindowTreeHostOzone::PostNativeEvent(
96 const base::NativeEvent& native_event) {
97 NOTIMPLEMENTED();
100 void WindowTreeHostOzone::SetCursorNative(gfx::NativeCursor cursor) {
101 ui::CursorFactoryOzone::GetInstance()->SetCursor(GetAcceleratedWidget(),
102 cursor.platform());
105 void WindowTreeHostOzone::MoveCursorToNative(const gfx::Point& location) {
106 ui::EventFactoryOzone::GetInstance()->WarpCursorTo(GetAcceleratedWidget(),
107 location);
110 void WindowTreeHostOzone::OnCursorVisibilityChangedNative(bool show) {
111 NOTIMPLEMENTED();
114 ui::EventProcessor* WindowTreeHostOzone::GetEventProcessor() {
115 return dispatcher();
118 // static
119 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
120 return new WindowTreeHostOzone(bounds);
123 // static
124 gfx::Size WindowTreeHost::GetNativeScreenSize() {
125 NOTIMPLEMENTED();
126 return gfx::Size();
129 } // namespace aura