OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MASH_SIMPLE_WM_SIMPLE_WM_H_ | 5 #ifndef MASH_SIMPLE_WM_SIMPLE_WM_H_ |
6 #define MASH_SIMPLE_WM_SIMPLE_WM_H_ | 6 #define MASH_SIMPLE_WM_SIMPLE_WM_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
14 #include "services/service_manager/public/cpp/connector.h" | 14 #include "services/service_manager/public/cpp/connector.h" |
15 #include "services/service_manager/public/cpp/service.h" | 15 #include "services/service_manager/public/cpp/service.h" |
16 #include "services/service_manager/public/cpp/service_context.h" | 16 #include "services/service_manager/public/cpp/service_context.h" |
17 #include "services/ui/public/cpp/gpu/gpu.h" | 17 #include "services/ui/public/cpp/gpu/gpu.h" |
18 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
19 #include "ui/aura/mus/mus_context_factory.h" | 19 #include "ui/aura/mus/mus_context_factory.h" |
20 #include "ui/aura/mus/property_converter.h" | 20 #include "ui/aura/mus/property_converter.h" |
21 #include "ui/aura/mus/property_utils.h" | 21 #include "ui/aura/mus/property_utils.h" |
22 #include "ui/aura/mus/window_manager_delegate.h" | 22 #include "ui/aura/mus/window_manager_delegate.h" |
23 #include "ui/aura/mus/window_tree_client.h" | 23 #include "ui/aura/mus/window_tree_client.h" |
24 #include "ui/aura/mus/window_tree_client_delegate.h" | 24 #include "ui/aura/mus/window_tree_client_delegate.h" |
25 #include "ui/aura/mus/window_tree_host_mus.h" | 25 #include "ui/aura/mus/window_tree_host_mus.h" |
26 #include "ui/aura/test/test_focus_client.h" | |
27 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
28 #include "ui/display/display.h" | 27 #include "ui/display/display.h" |
| 28 #include "ui/wm/core/base_focus_rules.h" |
29 #include "ui/wm/core/capture_controller.h" | 29 #include "ui/wm/core/capture_controller.h" |
30 #include "ui/wm/core/wm_state.h" | 30 #include "ui/wm/core/wm_state.h" |
31 | 31 |
32 namespace display { | 32 namespace display { |
33 class ScreenBase; | 33 class ScreenBase; |
34 } | 34 } |
35 | 35 |
36 namespace views { | 36 namespace views { |
37 class AuraInit; | 37 class AuraInit; |
38 } | 38 } |
39 | 39 |
| 40 namespace wm { |
| 41 class FocusController; |
| 42 } |
| 43 |
40 namespace simple_wm { | 44 namespace simple_wm { |
41 | 45 |
42 class SimpleWM : public service_manager::Service, | 46 class SimpleWM : public service_manager::Service, |
43 public aura::WindowTreeClientDelegate, | 47 public aura::WindowTreeClientDelegate, |
44 public aura::WindowManagerDelegate { | 48 public aura::WindowManagerDelegate, |
| 49 public wm::BaseFocusRules { |
45 public: | 50 public: |
46 SimpleWM(); | 51 SimpleWM(); |
47 ~SimpleWM() override; | 52 ~SimpleWM() override; |
48 | 53 |
49 private: | 54 private: |
50 class DisplayLayoutManager; | 55 class DisplayLayoutManager; |
51 class FrameView; | 56 class FrameView; |
52 class WindowListModel; | 57 class WindowListModel; |
53 class WindowListModelObserver; | 58 class WindowListModelObserver; |
54 class WindowListView; | 59 class WindowListView; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void OnWmPerformMoveLoop(aura::Window* window, | 94 void OnWmPerformMoveLoop(aura::Window* window, |
90 ui::mojom::MoveLoopSource source, | 95 ui::mojom::MoveLoopSource source, |
91 const gfx::Point& cursor_location, | 96 const gfx::Point& cursor_location, |
92 const base::Callback<void(bool)>& on_done) override; | 97 const base::Callback<void(bool)>& on_done) override; |
93 void OnWmCancelMoveLoop(aura::Window* window) override; | 98 void OnWmCancelMoveLoop(aura::Window* window) override; |
94 void OnWmSetClientArea( | 99 void OnWmSetClientArea( |
95 aura::Window* window, | 100 aura::Window* window, |
96 const gfx::Insets& insets, | 101 const gfx::Insets& insets, |
97 const std::vector<gfx::Rect>& additional_client_areas) override; | 102 const std::vector<gfx::Rect>& additional_client_areas) override; |
98 | 103 |
| 104 // wm::BaseFocusRules: |
| 105 bool SupportsChildActivation(aura::Window* window) const override; |
| 106 bool IsWindowConsideredVisibleForActivation( |
| 107 aura::Window* window) const override; |
| 108 |
99 FrameView* GetFrameViewForClientWindow(aura::Window* client_window); | 109 FrameView* GetFrameViewForClientWindow(aura::Window* client_window); |
100 | 110 |
101 void OnWindowListViewItemActivated(aura::Window* index); | 111 void OnWindowListViewItemActivated(aura::Window* index); |
102 | 112 |
103 std::unique_ptr<views::AuraInit> aura_init_; | 113 std::unique_ptr<views::AuraInit> aura_init_; |
104 ::wm::WMState wm_state_; | 114 wm::WMState wm_state_; |
105 std::unique_ptr<display::ScreenBase> screen_; | 115 std::unique_ptr<display::ScreenBase> screen_; |
106 aura::PropertyConverter property_converter_; | 116 aura::PropertyConverter property_converter_; |
107 aura::test::TestFocusClient focus_client_; | 117 std::unique_ptr<wm::FocusController> focus_controller_; |
108 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; | 118 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; |
109 aura::Window* display_root_ = nullptr; | 119 aura::Window* display_root_ = nullptr; |
110 aura::Window* window_root_ = nullptr; | 120 aura::Window* window_root_ = nullptr; |
111 aura::WindowManagerClient* window_manager_client_ = nullptr; | 121 aura::WindowManagerClient* window_manager_client_ = nullptr; |
112 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; | 122 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; |
113 std::unique_ptr<ui::Gpu> gpu_; | 123 std::unique_ptr<ui::Gpu> gpu_; |
114 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; | 124 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; |
115 std::map<aura::Window*, FrameView*> client_window_to_frame_view_; | 125 std::map<aura::Window*, FrameView*> client_window_to_frame_view_; |
116 std::unique_ptr<WindowListModel> window_list_model_; | 126 std::unique_ptr<WindowListModel> window_list_model_; |
117 std::unique_ptr<WorkspaceLayoutManager> workspace_layout_manager_; | 127 std::unique_ptr<WorkspaceLayoutManager> workspace_layout_manager_; |
118 | 128 |
119 bool started_ = false; | 129 bool started_ = false; |
120 | 130 |
121 DISALLOW_COPY_AND_ASSIGN(SimpleWM); | 131 DISALLOW_COPY_AND_ASSIGN(SimpleWM); |
122 }; | 132 }; |
123 | 133 |
124 } // namespace simple_wm | 134 } // namespace simple_wm |
125 | 135 |
126 #endif // MASH_SIMPLE_WM_SIMPLE_WM_H_ | 136 #endif // MASH_SIMPLE_WM_SIMPLE_WM_H_ |
OLD | NEW |