| 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 <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "services/service_manager/public/cpp/connector.h" | 14 #include "services/service_manager/public/cpp/connector.h" |
| 15 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 15 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 16 #include "ui/aura/aura_export.h" | 16 #include "ui/aura/aura_export.h" |
| 17 #include "ui/aura/window_tree_host_platform.h" | 17 #include "ui/aura/window_tree_host_platform.h" |
| 18 | 18 |
| 19 namespace display { | 19 namespace display { |
| 20 class Display; | 20 class Display; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace aura { | 23 namespace aura { |
| 24 | 24 |
| 25 class InputMethodMus; | 25 class InputMethodMus; |
| 26 class WindowTreeClient; | 26 class WindowTreeClient; |
| 27 class WindowTreeHostMusDelegate; | 27 class WindowTreeHostMusDelegate; |
| 28 | 28 |
| 29 struct DisplayInitParams; |
| 29 struct WindowTreeHostMusInitParams; | 30 struct WindowTreeHostMusInitParams; |
| 30 | 31 |
| 31 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { | 32 class AURA_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { |
| 32 public: | 33 public: |
| 33 explicit WindowTreeHostMus(WindowTreeHostMusInitParams init_params); | 34 explicit WindowTreeHostMus(WindowTreeHostMusInitParams init_params); |
| 34 | 35 |
| 35 ~WindowTreeHostMus() override; | 36 ~WindowTreeHostMus() override; |
| 36 | 37 |
| 37 // Returns the WindowTreeHostMus for |window|. This returns null if |window| | 38 // Returns the WindowTreeHostMus for |window|. This returns null if |window| |
| 38 // is null, or not in a WindowTreeHostMus. | 39 // is null, or not in a WindowTreeHostMus. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Tells the window manager to take control of moving the window. Returns | 73 // Tells the window manager to take control of moving the window. Returns |
| 73 // true if the move wasn't canceled. | 74 // true if the move wasn't canceled. |
| 74 void PerformWindowMove(ui::mojom::MoveLoopSource mus_source, | 75 void PerformWindowMove(ui::mojom::MoveLoopSource mus_source, |
| 75 const gfx::Point& cursor_location, | 76 const gfx::Point& cursor_location, |
| 76 const base::Callback<void(bool)>& callback); | 77 const base::Callback<void(bool)>& callback); |
| 77 | 78 |
| 78 // Tells the window manager to abort any current move initiated by | 79 // Tells the window manager to abort any current move initiated by |
| 79 // PerformWindowMove(). | 80 // PerformWindowMove(). |
| 80 void CancelWindowMove(); | 81 void CancelWindowMove(); |
| 81 | 82 |
| 83 // Used during initial setup. Returns the DisplayInitParams |
| 84 // supplied to the constructor. |
| 85 std::unique_ptr<DisplayInitParams> ReleaseDisplayInitParams(); |
| 86 |
| 82 // Intended only for WindowTreeClient to call. | 87 // Intended only for WindowTreeClient to call. |
| 83 void set_display_id(int64_t id) { display_id_ = id; } | 88 void set_display_id(int64_t id) { display_id_ = id; } |
| 84 int64_t display_id() const { return display_id_; } | 89 int64_t display_id() const { return display_id_; } |
| 85 display::Display GetDisplay() const; | 90 display::Display GetDisplay() const; |
| 86 | 91 |
| 87 // aura::WindowTreeHostPlatform: | 92 // aura::WindowTreeHostPlatform: |
| 88 void HideImpl() override; | 93 void HideImpl() override; |
| 89 void SetBoundsInPixels(const gfx::Rect& bounds) override; | 94 void SetBoundsInPixels(const gfx::Rect& bounds) override; |
| 90 void DispatchEvent(ui::Event* event) override; | 95 void DispatchEvent(ui::Event* event) override; |
| 91 void OnClosed() override; | 96 void OnClosed() override; |
| 92 void OnActivationChanged(bool active) override; | 97 void OnActivationChanged(bool active) override; |
| 93 void OnCloseRequest() override; | 98 void OnCloseRequest() override; |
| 94 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; | 99 gfx::ICCProfile GetICCProfileForCurrentDisplay() override; |
| 95 void MoveCursorToScreenLocationInPixels( | 100 void MoveCursorToScreenLocationInPixels( |
| 96 const gfx::Point& location_in_pixels) override; | 101 const gfx::Point& location_in_pixels) override; |
| 97 | 102 |
| 98 private: | 103 private: |
| 99 int64_t display_id_; | 104 int64_t display_id_; |
| 100 | 105 |
| 101 WindowTreeHostMusDelegate* delegate_; | 106 WindowTreeHostMusDelegate* delegate_; |
| 102 | 107 |
| 103 bool in_set_bounds_from_server_ = false; | 108 bool in_set_bounds_from_server_ = false; |
| 104 | 109 |
| 105 std::unique_ptr<InputMethodMus> input_method_; | 110 std::unique_ptr<InputMethodMus> input_method_; |
| 106 | 111 |
| 112 std::unique_ptr<DisplayInitParams> display_init_params_; |
| 113 |
| 107 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); | 114 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMus); |
| 108 }; | 115 }; |
| 109 | 116 |
| 110 } // namespace aura | 117 } // namespace aura |
| 111 | 118 |
| 112 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ | 119 #endif // UI_AURA_MUS_WINDOW_TREE_HOST_MUS_H_ |
| OLD | NEW |