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