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

Unified Diff: ash/root_window_controller.cc

Issue 2911393002: Nix GetRootWindowController, use RootWindowController::ForWindow. (Closed)
Patch Set: Sync and rebase. Created 3 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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