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

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: fix-gn-check 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
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 && 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
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
OLDNEW
« no previous file with comments | « mash/wm/BUILD.gn ('k') | mash/wm/window_manager.cc » ('j') | mash/wm/window_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698