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 #ifndef UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
6 #define UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ | 6 #define UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | |
11 #include <memory> | 10 #include <memory> |
12 #include <string> | |
13 #include <vector> | 11 #include <vector> |
14 | 12 |
15 #include "base/macros.h" | 13 #include "base/macros.h" |
16 #include "services/service_manager/public/cpp/connector.h" | 14 #include "services/service_manager/public/cpp/connector.h" |
17 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 15 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
18 #include "ui/aura/aura_export.h" | 16 #include "ui/aura/aura_export.h" |
19 #include "ui/aura/window_tree_host_platform.h" | 17 #include "ui/aura/window_tree_host_platform.h" |
20 | 18 |
21 namespace display { | 19 namespace display { |
22 class Display; | 20 class Display; |
23 } | 21 } |
24 | 22 |
25 namespace aura { | 23 namespace aura { |
26 | 24 |
27 class InputMethodMus; | 25 class InputMethodMus; |
28 class WindowPortMus; | |
29 class WindowTreeClient; | 26 class WindowTreeClient; |
30 class WindowTreeHostMusDelegate; | 27 class WindowTreeHostMusDelegate; |
31 | 28 |
| 29 struct WindowTreeHostMusInitParams; |
| 30 |
32 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { | 31 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { |
33 public: | 32 public: |
34 // |properties| are applied to the window created by this class (using | 33 explicit WindowTreeHostMus(WindowTreeHostMusInitParams init_params); |
35 // PropertyConverter). | |
36 // TODO: this should take an unordered_map, see http://crbug.com/670515. | |
37 WindowTreeHostMus( | |
38 std::unique_ptr<WindowPortMus> window_port, | |
39 WindowTreeClient* window_tree_client, | |
40 int64_t display_id, | |
41 const cc::FrameSinkId& frame_sink_id = cc::FrameSinkId(), | |
42 const std::map<std::string, std::vector<uint8_t>>* properties = nullptr); | |
43 | |
44 // This constructor is intended for creating top level windows in | |
45 // non-window-manager code. |properties| are properties passed verbatim to | |
46 // the server, that is, no conversion is done before sending |properties| to | |
47 // the server. Additionally |properties| are passed to PropertyConverter and | |
48 // any known properties are set on the Window created by this class. | |
49 // TODO: this should take an unordered_map, see http://crbug.com/670515. | |
50 explicit WindowTreeHostMus( | |
51 WindowTreeClient* window_tree_client, | |
52 const cc::FrameSinkId& frame_sink_id = cc::FrameSinkId(), | |
53 const std::map<std::string, std::vector<uint8_t>>* properties = nullptr); | |
54 | 34 |
55 ~WindowTreeHostMus() override; | 35 ~WindowTreeHostMus() override; |
56 | 36 |
57 // Returns the WindowTreeHostMus for |window|. This returns null if |window| | 37 // Returns the WindowTreeHostMus for |window|. This returns null if |window| |
58 // is null, or not in a WindowTreeHostMus. | 38 // is null, or not in a WindowTreeHostMus. |
59 static WindowTreeHostMus* ForWindow(aura::Window* window); | 39 static WindowTreeHostMus* ForWindow(aura::Window* window); |
60 | 40 |
61 // Sets the bounds in pixels. | 41 // Sets the bounds in pixels. |
62 void SetBoundsFromServer(const gfx::Rect& bounds_in_pixels); | 42 void SetBoundsFromServer(const gfx::Rect& bounds_in_pixels); |
63 | 43 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 bool in_set_bounds_from_server_ = false; | 103 bool in_set_bounds_from_server_ = false; |
124 | 104 |
125 std::unique_ptr<InputMethodMus> input_method_; | 105 std::unique_ptr<InputMethodMus> input_method_; |
126 | 106 |
127 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); | 107 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); |
128 }; | 108 }; |
129 | 109 |
130 } // namespace aura | 110 } // namespace aura |
131 | 111 |
132 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ | 112 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
OLD | NEW |