OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/window_tree_host_mus.h" | 5 #include "ui/views/mus/window_tree_host_mus.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
10 #include "ui/views/mus/input_method_mus.h" | 10 #include "ui/views/mus/input_method_mus.h" |
11 #include "ui/views/mus/native_widget_mus.h" | 11 #include "ui/views/mus/native_widget_mus.h" |
12 #include "ui/views/mus/platform_window_mus.h" | 12 #include "ui/views/mus/platform_window_mus.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
17 // WindowTreeHostMus, public: | 17 // WindowTreeHostMus, public: |
18 | 18 |
19 WindowTreeHostMus::WindowTreeHostMus(mojo::Shell* shell, | 19 WindowTreeHostMus::WindowTreeHostMus(mojo::Shell* shell, |
20 NativeWidgetMus* native_widget, | 20 NativeWidgetMus* native_widget, |
21 mus::Window* window, | 21 mus::Window* window) |
22 mus::mojom::SurfaceType surface_type) | |
23 : native_widget_(native_widget), | 22 : native_widget_(native_widget), |
24 show_state_(ui::PLATFORM_WINDOW_STATE_UNKNOWN) { | 23 show_state_(ui::PLATFORM_WINDOW_STATE_UNKNOWN) { |
25 SetPlatformWindow( | 24 SetPlatformWindow( |
26 make_scoped_ptr(new PlatformWindowMus(this, shell, window))); | 25 make_scoped_ptr(new PlatformWindowMus(this, shell, window))); |
27 // The location of events is already transformed, and there is no way to | 26 // The location of events is already transformed, and there is no way to |
28 // correctly determine the reverse transform. So, don't attempt to transform | 27 // correctly determine the reverse transform. So, don't attempt to transform |
29 // event locations, else the root location is wrong. | 28 // event locations, else the root location is wrong. |
30 // TODO(sky): we need to transform for device scale though. | 29 // TODO(sky): we need to transform for device scale though. |
31 dispatcher()->set_transform_events(false); | 30 dispatcher()->set_transform_events(false); |
32 compositor()->SetHostHasTransparentBackground(true); | 31 compositor()->SetHostHasTransparentBackground(true); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (native_widget_) | 70 if (native_widget_) |
72 native_widget_->OnActivationChanged(active); | 71 native_widget_->OnActivationChanged(active); |
73 WindowTreeHostPlatform::OnActivationChanged(active); | 72 WindowTreeHostPlatform::OnActivationChanged(active); |
74 } | 73 } |
75 | 74 |
76 void WindowTreeHostMus::OnCloseRequest() { | 75 void WindowTreeHostMus::OnCloseRequest() { |
77 OnHostCloseRequested(); | 76 OnHostCloseRequested(); |
78 } | 77 } |
79 | 78 |
80 } // namespace views | 79 } // namespace views |
OLD | NEW |