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/platform_window_mus.h" | 5 #include "ui/views/mus/platform_window_mus.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "components/bitmap_uploader/bitmap_uploader.h" | 8 #include "components/bitmap_uploader/bitmap_uploader.h" |
9 #include "components/mus/public/cpp/property_type_converters.h" | 9 #include "components/mus/public/cpp/property_type_converters.h" |
10 #include "components/mus/public/cpp/window_property.h" | 10 #include "components/mus/public/cpp/window_property.h" |
11 #include "components/mus/public/interfaces/window_manager.mojom.h" | 11 #include "components/mus/public/interfaces/window_manager.mojom.h" |
12 #include "mojo/converters/input_events/input_events_type_converters.h" | 12 #include "mojo/converters/input_events/input_events_type_converters.h" |
13 #include "ui/base/view_prop.h" | 13 #include "ui/base/view_prop.h" |
14 #include "ui/platform_window/platform_window_delegate.h" | 14 #include "ui/platform_window/platform_window_delegate.h" |
15 #include "ui/views/mus/window_manager_connection.h" | 15 #include "ui/views/mus/window_manager_connection.h" |
16 | 16 |
17 namespace views { | 17 namespace views { |
18 | 18 |
19 namespace { | 19 namespace { |
20 static uint32_t accelerated_widget_count = 1; | 20 static uint32_t accelerated_widget_count = 1; |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate, | 24 PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate, |
25 mojo::Connector* connector, | 25 shell::Connector* connector, |
26 mus::Window* mus_window) | 26 mus::Window* mus_window) |
27 : delegate_(delegate), | 27 : delegate_(delegate), |
28 mus_window_(mus_window), | 28 mus_window_(mus_window), |
29 show_state_(mus::mojom::ShowState::RESTORED), | 29 show_state_(mus::mojom::ShowState::RESTORED), |
30 last_cursor_(mus::mojom::Cursor::CURSOR_NULL), | 30 last_cursor_(mus::mojom::Cursor::CURSOR_NULL), |
31 mus_window_destroyed_(false) { | 31 mus_window_destroyed_(false) { |
32 DCHECK(delegate_); | 32 DCHECK(delegate_); |
33 DCHECK(mus_window_); | 33 DCHECK(mus_window_); |
34 mus_window_->AddObserver(this); | 34 mus_window_->AddObserver(this); |
35 mus_window_->set_input_event_handler(this); | 35 mus_window_->set_input_event_handler(this); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // actually starts, perhaps through an observer on MessageLoop. Otherwise | 231 // actually starts, perhaps through an observer on MessageLoop. Otherwise |
232 // ack the event with the actual handled state below DispatchEvent(). | 232 // ack the event with the actual handled state below DispatchEvent(). |
233 (*ack_callback)->Run(true); | 233 (*ack_callback)->Run(true); |
234 ack_callback->reset(); | 234 ack_callback->reset(); |
235 // TODO(moshayedi): Avoid cloning after updating PlatformWindowDelegate to | 235 // TODO(moshayedi): Avoid cloning after updating PlatformWindowDelegate to |
236 // accept constant pointers. | 236 // accept constant pointers. |
237 delegate_->DispatchEvent(ui::Event::Clone(event).get()); | 237 delegate_->DispatchEvent(ui::Event::Clone(event).get()); |
238 } | 238 } |
239 | 239 |
240 } // namespace views | 240 } // namespace views |
OLD | NEW |