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 #include "mash/wm/root_window_controller.h" | 5 #include "mash/wm/root_window_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "components/mus/common/util.h" | 10 #include "components/mus/common/util.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 bool RootWindowController::WindowIsContainer(const mus::Window* window) const { | 77 bool RootWindowController::WindowIsContainer(const mus::Window* window) const { |
78 return window && window->parent() == root_; | 78 return window && window->parent() == root_; |
79 } | 79 } |
80 | 80 |
81 mus::WindowManagerClient* RootWindowController::window_manager_client() { | 81 mus::WindowManagerClient* RootWindowController::window_manager_client() { |
82 return window_manager_->window_manager_client(); | 82 return window_manager_->window_manager_client(); |
83 } | 83 } |
84 | 84 |
85 void RootWindowController::OnAccelerator(uint32_t id, | 85 void RootWindowController::OnAccelerator(uint32_t id, const ui::Event& event) { |
86 mus::mojom::EventPtr event) { | |
87 switch (id) { | 86 switch (id) { |
88 case kWindowSwitchAccelerator: | 87 case kWindowSwitchAccelerator: |
89 window_manager_client()->ActivateNextWindow(); | 88 window_manager_client()->ActivateNextWindow(); |
90 break; | 89 break; |
91 default: | 90 default: |
92 app_->OnAccelerator(id, std::move(event)); | 91 app_->OnAccelerator(id, event); |
93 break; | 92 break; |
94 } | 93 } |
95 } | 94 } |
96 | 95 |
97 RootWindowController::RootWindowController(WindowManagerApplication* app) | 96 RootWindowController::RootWindowController(WindowManagerApplication* app) |
98 : app_(app), root_(nullptr), window_count_(0) { | 97 : app_(app), root_(nullptr), window_count_(0) { |
99 window_manager_.reset(new WindowManager); | 98 window_manager_.reset(new WindowManager); |
100 } | 99 } |
101 | 100 |
102 RootWindowController::~RootWindowController() {} | 101 RootWindowController::~RootWindowController() {} |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 mojom::Container::LOGIN_WINDOWS); | 195 mojom::Container::LOGIN_WINDOWS); |
197 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, | 196 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, |
198 mojom::Container::ROOT); | 197 mojom::Container::ROOT); |
199 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); | 198 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); |
200 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); | 199 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); |
201 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); | 200 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); |
202 } | 201 } |
203 | 202 |
204 } // namespace wm | 203 } // namespace wm |
205 } // namespace mash | 204 } // namespace mash |
OLD | NEW |