Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 shell::Connector* RootWindowController::GetConnector() { | 66 shell::Connector* RootWindowController::GetConnector() { |
| 67 return app_->connector(); | 67 return app_->connector(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 mus::Window* RootWindowController::GetWindowForContainer( | 70 mus::Window* RootWindowController::GetWindowForContainer( |
| 71 mojom::Container container) { | 71 mojom::Container container) { |
| 72 return root_->GetChildByLocalId(ContainerToLocalId(container)); | 72 return root_->GetChildByLocalId(ContainerToLocalId(container)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool RootWindowController::WindowIsContainer(const mus::Window* window) const { | 75 bool RootWindowController::WindowIsContainer(const mus::Window* window) const { |
| 76 return window && window->parent() == root_; | 76 return window && window != root_ && |
| 77 window->local_id() < ContainerToLocalId(mojom::Container::COUNT); | |
|
sky
2016/04/22 15:23:41
The default local_id is -1, should you check for l
sadrul
2016/04/22 16:06:05
Changed to > 0 (to exclude root)
| |
| 77 } | 78 } |
| 78 | 79 |
| 79 mus::WindowManagerClient* RootWindowController::window_manager_client() { | 80 mus::WindowManagerClient* RootWindowController::window_manager_client() { |
| 80 return window_manager_->window_manager_client(); | 81 return window_manager_->window_manager_client(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void RootWindowController::OnAccelerator(uint32_t id, const ui::Event& event) { | 84 void RootWindowController::OnAccelerator(uint32_t id, const ui::Event& event) { |
| 84 switch (id) { | 85 switch (id) { |
| 85 case kWindowSwitchAccelerator: | 86 case kWindowSwitchAccelerator: |
| 86 window_manager_client()->ActivateNextWindow(); | 87 window_manager_client()->ActivateNextWindow(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); | 202 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); |
| 202 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, | 203 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, |
| 203 mojom::Container::ROOT); | 204 mojom::Container::ROOT); |
| 204 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); | 205 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); |
| 205 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); | 206 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); |
| 206 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); | 207 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace wm | 210 } // namespace wm |
| 210 } // namespace mash | 211 } // namespace mash |
| OLD | NEW |