Chromium Code Reviews| Index: ash/root_window_controller.cc |
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
| index 70ca0ef2383f31c0807b7242e69395f9ffe7e95c..3f9cda6af9a6de7501c3890cb1ae1f783bd66bc9 100644 |
| --- a/ash/root_window_controller.cc |
| +++ b/ash/root_window_controller.cc |
| @@ -310,15 +310,16 @@ void RootWindowController::CreateForSecondaryDisplay(AshWindowTreeHost* host) { |
| // static |
| RootWindowController* RootWindowController::ForWindow( |
| const aura::Window* window) { |
| - DCHECK(window); |
| CHECK(Shell::HasInstance()); |
| - return GetRootWindowController(window->GetRootWindow()); |
| + if (!window || !window->GetRootWindow()) |
|
sky
2017/05/31 21:12:43
It's unfortunate we need these checks. Are you sur
msw
2017/05/31 21:23:37
It's ported from GetRWC, but I'll try just keeping
|
| + return nullptr; |
| + return GetRootWindowSettings(window->GetRootWindow())->controller; |
| } |
| // static |
| RootWindowController* RootWindowController::ForTargetRootWindow() { |
| CHECK(Shell::HasInstance()); |
| - return GetRootWindowController(Shell::GetRootWindowForNewWindows()); |
| + return ForWindow(Shell::GetRootWindowForNewWindows()); |
| } |
| void RootWindowController::ConfigureWidgetInitParamsForContainer( |
| @@ -1083,8 +1084,4 @@ void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
| DisableTouchHudProjection(); |
| } |
| -RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
| - return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
| -} |
| - |
| } // namespace ash |