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

Side by Side Diff: ash/root_window_controller.cc

Issue 1975433002: mus: Fix ash::GetRootWindowController for child windows/widgets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « ash/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 1049
1050 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { 1050 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
1051 if (enabled) 1051 if (enabled)
1052 EnableTouchHudProjection(); 1052 EnableTouchHudProjection();
1053 else 1053 else
1054 DisableTouchHudProjection(); 1054 DisableTouchHudProjection();
1055 } 1055 }
1056 1056
1057 RootWindowController* GetRootWindowController( 1057 RootWindowController* GetRootWindowController(
1058 const aura::Window* root_window) { 1058 const aura::Window* root_window) {
1059 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; 1059 if (!root_window)
1060 return nullptr;
1061
1062 if (Shell::GetInstance()->in_mus()) {
1063 // Look up the root for the display nearest |root_window|.
1064 display::Display display = display::Screen::GetScreen()->GetDisplayMatching(
1065 root_window->GetBoundsInScreen());
1066 aura::Window* root_window_for_display =
1067 Shell::GetInstance()
1068 ->window_tree_host_manager()
1069 ->GetRootWindowForDisplayId(display.id());
1070 DCHECK(root_window_for_display);
1071 return GetRootWindowSettings(root_window_for_display)->controller;
1072 }
1073 return GetRootWindowSettings(root_window)->controller;
oshima 2016/05/12 00:40:56 This behaves differently if the most of the root w
James Cook 2016/05/12 16:43:12 I'm sorry, I don't completely understand. I under
1060 } 1074 }
1061 1075
1062 } // namespace ash 1076 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698