Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: mash/wm/root_window_controller.cc

Issue 1907153002: mash/wm: Fix detecting container windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/wm/disconnected_app_handler.cc ('k') | mash/wm/window_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 &&
77 window->local_id() > ContainerToLocalId(mojom::Container::ROOT) &&
78 window->local_id() < ContainerToLocalId(mojom::Container::COUNT);
77 } 79 }
78 80
79 mus::WindowManagerClient* RootWindowController::window_manager_client() { 81 mus::WindowManagerClient* RootWindowController::window_manager_client() {
80 return window_manager_->window_manager_client(); 82 return window_manager_->window_manager_client();
81 } 83 }
82 84
83 void RootWindowController::OnAccelerator(uint32_t id, const ui::Event& event) { 85 void RootWindowController::OnAccelerator(uint32_t id, const ui::Event& event) {
84 switch (id) { 86 switch (id) {
85 case kWindowSwitchAccelerator: 87 case kWindowSwitchAccelerator:
86 window_manager_client()->ActivateNextWindow(); 88 window_manager_client()->ActivateNextWindow();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT); 203 CreateContainer(mojom::Container::BUBBLES, mojom::Container::ROOT);
202 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS, 204 CreateContainer(mojom::Container::SYSTEM_MODAL_WINDOWS,
203 mojom::Container::ROOT); 205 mojom::Container::ROOT);
204 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT); 206 CreateContainer(mojom::Container::KEYBOARD, mojom::Container::ROOT);
205 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT); 207 CreateContainer(mojom::Container::MENUS, mojom::Container::ROOT);
206 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT); 208 CreateContainer(mojom::Container::TOOLTIPS, mojom::Container::ROOT);
207 } 209 }
208 210
209 } // namespace wm 211 } // namespace wm
210 } // namespace mash 212 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/disconnected_app_handler.cc ('k') | mash/wm/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698