Folds WmRootWindowController into RootWindowController
This is (mostly) the bare minimum to merge the two. Future patches
will cleanup WmWindow usage.
BUG=671246
TEST=none
[email protected]
Review-Url: https://codereview.chromium.org/2620153003
Cr-Commit-Position: refs/heads/master@{#443003}
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index db31ff65..d85c858 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -596,7 +596,6 @@
"common/wm_lookup.cc",
"common/wm_lookup.h",
"common/wm_root_window_controller.cc",
- "common/wm_root_window_controller.h",
"common/wm_shell.cc",
"common/wm_shell.h",
"common/wm_transient_window_observer.h",
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc
index a4a03ea..3ba47562 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -12,7 +12,6 @@
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/display/window_tree_host_manager.h"
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc
index a6faf964..1cd1ccd0 100644
--- a/ash/ash_touch_exploration_manager_chromeos.cc
+++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -6,7 +6,6 @@
#include "ash/common/accessibility_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/root_window_controller.h"
@@ -96,10 +95,8 @@
void AshTouchExplorationManager::OnDisplayMetricsChanged(
const display::Display& display,
uint32_t changed_metrics) {
- if (root_window_controller_->wm_root_window_controller()
- ->GetWindow()
- ->GetDisplayNearestWindow()
- .id() == display.id())
+ if (root_window_controller_->GetWindow()->GetDisplayNearestWindow().id() ==
+ display.id())
UpdateTouchExplorationState();
}
@@ -157,11 +154,9 @@
touch_accessibility_enabler_.get());
}
if (pass_through_surface) {
- const gfx::Rect& work_area =
- root_window_controller_->wm_root_window_controller()
- ->GetWindow()
- ->GetDisplayNearestWindow()
- .work_area();
+ const gfx::Rect& work_area = root_window_controller_->GetWindow()
+ ->GetDisplayNearestWindow()
+ .work_area();
touch_exploration_controller_->SetExcludeBounds(work_area);
SilenceSpokenFeedback();
WmShell::Get()->accessibility_delegate()->ClearFocusHighlight();
diff --git a/ash/aura/wm_lookup_aura.cc b/ash/aura/wm_lookup_aura.cc
index 9277235..ee8ba06 100644
--- a/ash/aura/wm_lookup_aura.cc
+++ b/ash/aura/wm_lookup_aura.cc
@@ -21,15 +21,12 @@
WmLookup::Set(nullptr);
}
-WmRootWindowController* WmLookupAura::GetRootWindowControllerWithDisplayId(
+RootWindowController* WmLookupAura::GetRootWindowControllerWithDisplayId(
int64_t id) {
aura::Window* root_window = Shell::GetInstance()
->window_tree_host_manager()
->GetRootWindowForDisplayId(id);
- return root_window
- ? RootWindowController::ForWindow(root_window)
- ->wm_root_window_controller()
- : nullptr;
+ return root_window ? RootWindowController::ForWindow(root_window) : nullptr;
}
WmWindow* WmLookupAura::GetWindowForWidget(views::Widget* widget) {
diff --git a/ash/aura/wm_lookup_aura.h b/ash/aura/wm_lookup_aura.h
index 68bedaf..eb80257 100644
--- a/ash/aura/wm_lookup_aura.h
+++ b/ash/aura/wm_lookup_aura.h
@@ -17,7 +17,7 @@
~WmLookupAura() override;
// WmLookup:
- WmRootWindowController* GetRootWindowControllerWithDisplayId(
+ RootWindowController* GetRootWindowControllerWithDisplayId(
int64_t id) override;
WmWindow* GetWindowForWidget(views::Widget* widget) override;
diff --git a/ash/aura/wm_window_aura.cc b/ash/aura/wm_window_aura.cc
index 0179758..e127dc8e 100644
--- a/ash/aura/wm_window_aura.cc
+++ b/ash/aura/wm_window_aura.cc
@@ -150,13 +150,9 @@
return Get(window_->GetRootWindow());
}
-WmRootWindowController* WmWindowAura::GetRootWindowController() {
+RootWindowController* WmWindowAura::GetRootWindowController() {
aura::Window* root = window_->GetRootWindow();
- if (!root)
- return nullptr;
-
- RootWindowController* rwc = RootWindowController::ForWindow(root);
- return rwc ? rwc->wm_root_window_controller() : nullptr;
+ return root ? RootWindowController::ForWindow(root) : nullptr;
}
WmShell* WmWindowAura::GetShell() const {
diff --git a/ash/aura/wm_window_aura.h b/ash/aura/wm_window_aura.h
index 62ab8fe..3542255e 100644
--- a/ash/aura/wm_window_aura.h
+++ b/ash/aura/wm_window_aura.h
@@ -53,7 +53,7 @@
// WmWindow:
void Destroy() override;
const WmWindow* GetRootWindow() const override;
- WmRootWindowController* GetRootWindowController() override;
+ RootWindowController* GetRootWindowController() override;
WmShell* GetShell() const override;
void SetName(const char* name) override;
std::string GetName() const override;
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index 45540c3..d7dd7bc1 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -16,13 +16,18 @@
#include "ash/common/media_controller.h"
#include "ash/common/multi_profile_uma.h"
#include "ash/common/new_window_controller.h"
+#include "ash/common/palette_delegate.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/system/brightness_control_delegate.h"
+#include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
+#include "ash/common/system/chromeos/palette/palette_tray.h"
+#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/common/system/keyboard_brightness_control_delegate.h"
#include "ash/common/system/status_area_widget.h"
+#include "ash/common/system/system_notifier.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/web_notification/web_notification_tray.h"
@@ -32,35 +37,23 @@
#include "ash/common/wm/window_positioning_utils.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/root_window_controller.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
-#include "ui/base/accelerators/accelerator.h"
-#include "ui/base/accelerators/accelerator_manager.h"
-#include "ui/keyboard/keyboard_controller.h"
-
-#if defined(OS_CHROMEOS)
-#include "ash/common/palette_delegate.h"
-#include "ash/common/shelf/wm_shelf.h"
-#include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
-#include "ash/common/system/chromeos/palette/palette_tray.h"
-#include "ash/common/system/chromeos/palette/palette_utils.h"
-#include "ash/common/system/status_area_widget.h"
-#include "ash/common/system/system_notifier.h"
-#include "ash/common/wm_root_window_controller.h"
-#include "ash/common/wm_window.h"
-#include "ash/resources/vector_icons/vector_icons.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager_client.h"
#include "grit/ash_strings.h"
+#include "ui/base/accelerators/accelerator.h"
+#include "ui/base/accelerators/accelerator_manager.h"
#include "ui/base/ime/chromeos/ime_keyboard.h"
#include "ui/base/ime/chromeos/input_method_manager.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
+#include "ui/keyboard/keyboard_controller.h"
#include "ui/message_center/message_center.h"
-#endif // defined(OS_CHROMEOS)
namespace ash {
namespace {
@@ -423,7 +416,7 @@
void HandleShowStylusTools() {
base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools"));
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmShell::Get()->GetRootWindowForNewWindows()->GetRootWindowController();
PaletteTray* palette_tray =
root_window_controller->GetShelf()->GetStatusAreaWidget()->palette_tray();
diff --git a/ash/common/accelerators/debug_commands.cc b/ash/common/accelerators/debug_commands.cc
index 1c30ec17..f6747d9 100644
--- a/ash/common/accelerators/debug_commands.cc
+++ b/ash/common/accelerators/debug_commands.cc
@@ -12,9 +12,9 @@
#include "ash/common/wallpaper/wallpaper_controller.h"
#include "ash/common/wallpaper/wallpaper_delegate.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
diff --git a/ash/common/accelerators/exit_warning_handler.cc b/ash/common/accelerators/exit_warning_handler.cc
index a5cc5e3..b868f64 100644
--- a/ash/common/accelerators/exit_warning_handler.cc
+++ b/ash/common/accelerators/exit_warning_handler.cc
@@ -5,10 +5,10 @@
#include "ash/common/accelerators/exit_warning_handler.h"
#include "ash/common/shell_delegate.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
diff --git a/ash/common/devtools/ash_devtools_dom_agent.cc b/ash/common/devtools/ash_devtools_dom_agent.cc
index d68091a..f6bf8d1 100644
--- a/ash/common/devtools/ash_devtools_dom_agent.cc
+++ b/ash/common/devtools/ash_devtools_dom_agent.cc
@@ -5,9 +5,9 @@
#include "ash/common/devtools/ash_devtools_dom_agent.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "components/ui_devtools/devtools_server.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/display/display.h"
diff --git a/ash/common/devtools/ash_devtools_unittest.cc b/ash/common/devtools/ash_devtools_unittest.cc
index 9226051..d3e29a045 100644
--- a/ash/common/devtools/ash_devtools_unittest.cc
+++ b/ash/common/devtools/ash_devtools_unittest.cc
@@ -6,9 +6,9 @@
#include "ash/common/devtools/ash_devtools_dom_agent.h"
#include "ash/common/test/ash_test.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "ui/display/display.h"
diff --git a/ash/common/drag_drop/drag_image_view.cc b/ash/common/drag_drop/drag_image_view.cc
index 74c04f3..5c763c3 100644
--- a/ash/common/drag_drop/drag_image_view.cc
+++ b/ash/common/drag_drop/drag_image_view.cc
@@ -7,9 +7,9 @@
#include <memory>
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "skia/ext/image_operations.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
diff --git a/ash/common/shelf/overflow_bubble_view.cc b/ash/common/shelf/overflow_bubble_view.cc
index 146c780..db47ae84 100644
--- a/ash/common/shelf/overflow_bubble_view.cc
+++ b/ash/common/shelf/overflow_bubble_view.cc
@@ -11,9 +11,9 @@
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
diff --git a/ash/common/shelf/shelf_controller.cc b/ash/common/shelf/shelf_controller.cc
index 2cea707e4..c41657f 100644
--- a/ash/common/shelf/shelf_controller.cc
+++ b/ash/common/shelf/shelf_controller.cc
@@ -8,9 +8,9 @@
#include "ash/common/shelf/shelf_menu_model.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
@@ -138,7 +138,7 @@
// Returns the WmShelf instance for the display with the given |display_id|.
WmShelf* GetShelfForDisplay(int64_t display_id) {
// The controller may be null for invalid ids or for displays being removed.
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id);
return root_window_controller ? root_window_controller->GetShelf() : nullptr;
}
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index c2545f2..d51f088 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -20,10 +20,10 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/i18n/rtl.h"
@@ -452,7 +452,7 @@
state.auto_hide_state = CalculateAutoHideState(visibility_state);
WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_);
- WmRootWindowController* controller = shelf_window->GetRootWindowController();
+ RootWindowController* controller = shelf_window->GetRootWindowController();
state.window_state = controller ? controller->GetWorkspaceWindowState()
: wm::WORKSPACE_WINDOW_STATE_DEFAULT;
// Preserve the log in screen states.
diff --git a/ash/common/shelf/shelf_tooltip_manager.cc b/ash/common/shelf/shelf_tooltip_manager.cc
index 50c481e..130505d 100644
--- a/ash/common/shelf/shelf_tooltip_manager.cc
+++ b/ash/common/shelf/shelf_tooltip_manager.cc
@@ -8,10 +8,10 @@
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/bind.h"
#include "base/strings/string16.h"
#include "base/threading/thread_task_runner_handle.h"
diff --git a/ash/common/shelf/shelf_widget.cc b/ash/common/shelf/shelf_widget.cc
index 4ebc52e..e80b8bf 100644
--- a/ash/common/shelf/shelf_widget.cc
+++ b/ash/common/shelf/shelf_widget.cc
@@ -18,10 +18,10 @@
#include "ash/common/system/status_area_layout_manager.h"
#include "ash/common/system/status_area_widget.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "grit/ash_resources.h"
#include "ui/base/resource/resource_bundle.h"
diff --git a/ash/common/shelf/shelf_window_watcher_unittest.cc b/ash/common/shelf/shelf_window_watcher_unittest.cc
index 698abdf..d50c8579 100644
--- a/ash/common/shelf/shelf_window_watcher_unittest.cc
+++ b/ash/common/shelf/shelf_window_watcher_unittest.cc
@@ -10,11 +10,11 @@
#include "ash/common/wm/window_resizer.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/test/ash_test_base.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
diff --git a/ash/common/shelf/wm_shelf.cc b/ash/common/shelf/wm_shelf.cc
index 191d11e..d42d4ad 100644
--- a/ash/common/shelf/wm_shelf.cc
+++ b/ash/common/shelf/wm_shelf.cc
@@ -15,10 +15,10 @@
#include "ash/common/shelf/wm_shelf_observer.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shelf/shelf_bezel_event_handler.h"
#include "ash/shell.h"
#include "base/logging.h"
diff --git a/ash/common/system/chromeos/audio/tray_audio.cc b/ash/common/system/chromeos/audio/tray_audio.cc
index a203026e..7260102 100644
--- a/ash/common/system/chromeos/audio/tray_audio.cc
+++ b/ash/common/system/chromeos/audio/tray_audio.cc
@@ -9,9 +9,9 @@
#include "ash/common/system/chromeos/audio/volume_view.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/tray_constants.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "grit/ash_resources.h"
#include "ui/display/display.h"
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 78479dee..1d2f344d 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -22,10 +22,10 @@
#include "ash/common/system/tray/tray_popup_utils.h"
#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "grit/ash_resources.h"
diff --git a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
index 05ce6f1..b87f56b 100644
--- a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
+++ b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc
@@ -32,10 +32,10 @@
#include "ash/common/system/tray/tray_popup_label_button.h"
#include "ash/common/system/tray/tri_view.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index 0ffec05..affb069 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -19,11 +19,11 @@
#include "ash/common/system/tray/tray_popup_header_button.h"
#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/root_window_controller.h"
#include "base/metrics/histogram_macros.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
diff --git a/ash/common/system/chromeos/session/logout_confirmation_dialog.cc b/ash/common/system/chromeos/session/logout_confirmation_dialog.cc
index bdd5cbe5..1bb3fbd 100644
--- a/ash/common/system/chromeos/session/logout_confirmation_dialog.cc
+++ b/ash/common/system/chromeos/session/logout_confirmation_dialog.cc
@@ -6,10 +6,10 @@
#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
#include "ash/common/system/tray/tray_constants.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/location.h"
#include "base/time/tick_clock.h"
#include "grit/ash_strings.h"
diff --git a/ash/common/system/status_area_widget.cc b/ash/common/system/status_area_widget.cc
index 73400e1..c091e7a 100644
--- a/ash/common/system/status_area_widget.cc
+++ b/ash/common/system/status_area_widget.cc
@@ -17,10 +17,10 @@
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/web_notification/web_notification_tray.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/i18n/time_formatting.h"
#include "ui/display/display.h"
#include "ui/native_theme/native_theme_dark_aura.h"
diff --git a/ash/common/system/status_area_widget_delegate.cc b/ash/common/system/status_area_widget_delegate.cc
index 307053b8..fda7c12 100644
--- a/ash/common/system/status_area_widget_delegate.cc
+++ b/ash/common/system/status_area_widget_delegate.cc
@@ -12,10 +12,10 @@
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
diff --git a/ash/common/system/toast/toast_overlay.cc b/ash/common/system/toast/toast_overlay.cc
index efb516d2..5b5e652 100644
--- a/ash/common/system/toast/toast_overlay.cc
+++ b/ash/common/system/toast/toast_overlay.cc
@@ -6,10 +6,10 @@
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
diff --git a/ash/common/system/tray/system_tray.cc b/ash/common/system/tray/system_tray.cc
index 85010dd..7e18fd7 100644
--- a/ash/common/system/tray/system_tray.cc
+++ b/ash/common/system/tray/system_tray.cc
@@ -49,10 +49,10 @@
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm_activation_observer.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/timer/timer.h"
diff --git a/ash/common/system/tray/system_tray_controller.cc b/ash/common/system/tray/system_tray_controller.cc
index 5c8646eac..c4317df 100644
--- a/ash/common/system/tray/system_tray_controller.cc
+++ b/ash/common/system/tray/system_tray_controller.cc
@@ -7,9 +7,9 @@
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/update/tray_update.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
namespace ash {
diff --git a/ash/common/system/tray/system_tray_unittest.cc b/ash/common/system/tray/system_tray_unittest.cc
index 332d9b9b..edfb2c6 100644
--- a/ash/common/system/tray/system_tray_unittest.cc
+++ b/ash/common/system/tray/system_tray_unittest.cc
@@ -17,10 +17,10 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_item_container.h"
#include "ash/common/system/web_notification/web_notification_tray.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/status_area_widget_test_helper.h"
#include "ash/test/test_system_tray_item.h"
diff --git a/ash/common/system/user/user_view.cc b/ash/common/system/user/user_view.cc
index db3771d6..b94f1868 100644
--- a/ash/common/system/user/user_view.cc
+++ b/ash/common/system/user/user_view.cc
@@ -25,11 +25,11 @@
#include "ash/common/system/user/rounded_image_view.h"
#include "ash/common/system/user/user_card_view.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "components/signin/core/account_id/account_id.h"
#include "components/user_manager/user_info.h"
diff --git a/ash/common/system/web_notification/ash_popup_alignment_delegate.cc b/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
index b87906d..46b2719 100644
--- a/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
+++ b/ash/common/system/web_notification/ash_popup_alignment_delegate.cc
@@ -6,11 +6,11 @@
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/wm_shelf.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/i18n/rtl.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
diff --git a/ash/common/system/web_notification/web_notification_tray.cc b/ash/common/system/web_notification/web_notification_tray.cc
index 685195a..0cbd26d58 100644
--- a/ash/common/system/web_notification/web_notification_tray.cc
+++ b/ash/common/system/web_notification/web_notification_tray.cc
@@ -17,11 +17,11 @@
#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/system/web_notification/ash_popup_alignment_delegate.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
diff --git a/ash/common/test/ash_test.cc b/ash/common/test/ash_test.cc
index ef192df3..3afcf64e 100644
--- a/ash/common/test/ash_test.cc
+++ b/ash/common/test/ash_test.cc
@@ -9,9 +9,9 @@
#include "ash/common/test/ash_test_impl.h"
#include "ash/common/test/test_session_state_delegate.h"
#include "ash/common/test/test_system_tray_delegate.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "ui/compositor/layer_type.h"
diff --git a/ash/common/wallpaper/wallpaper_controller.cc b/ash/common/wallpaper/wallpaper_controller.cc
index 4da1034..8b9b4048 100644
--- a/ash/common/wallpaper/wallpaper_controller.cc
+++ b/ash/common/wallpaper/wallpaper_controller.cc
@@ -8,10 +8,10 @@
#include "ash/common/wallpaper/wallpaper_delegate.h"
#include "ash/common/wallpaper/wallpaper_view.h"
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/task_runner.h"
@@ -220,7 +220,7 @@
return;
}
- WmRootWindowController* controller = root_window->GetRootWindowController();
+ RootWindowController* controller = root_window->GetRootWindowController();
controller->SetAnimatingWallpaperWidgetController(
new AnimatingWallpaperWidgetController(component));
component->StartAnimating(controller);
@@ -235,7 +235,7 @@
bool WallpaperController::ReparentWallpaper(int container) {
bool moved = false;
for (WmWindow* root_window : WmShell::Get()->GetAllRootWindows()) {
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
root_window->GetRootWindowController();
// In the steady state (no animation playing) the wallpaper widget
// controller exists in the RootWindowController.
diff --git a/ash/common/wallpaper/wallpaper_controller_unittest.cc b/ash/common/wallpaper/wallpaper_controller_unittest.cc
index 72e5895..acbb0bf 100644
--- a/ash/common/wallpaper/wallpaper_controller_unittest.cc
+++ b/ash/common/wallpaper/wallpaper_controller_unittest.cc
@@ -9,10 +9,10 @@
#include "ash/common/wallpaper/wallpaper_view.h"
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/test_wallpaper_delegate.h"
#include "base/message_loop/message_loop.h"
@@ -111,7 +111,7 @@
test::AshTestBase::SetUp();
// Ash shell initialization creates wallpaper. Reset it so we can manually
// control wallpaper creation and animation in our tests.
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController();
root_window_controller->SetWallpaperWidgetController(nullptr);
root_window_controller->SetAnimatingWallpaperWidgetController(nullptr);
@@ -236,7 +236,7 @@
controller->CreateEmptyWallpaper();
// The new wallpaper is ready to animate.
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController();
EXPECT_TRUE(root_window_controller->animating_wallpaper_widget_controller()
->GetController(false));
@@ -272,7 +272,7 @@
// In this state we have two wallpaper views stored in different properties.
// Both are in the lock screen wallpaper container.
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController();
EXPECT_TRUE(root_window_controller->animating_wallpaper_widget_controller()
->GetController(false));
@@ -313,7 +313,7 @@
// Change to a new wallpaper.
controller->CreateEmptyWallpaper();
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmShell::Get()->GetPrimaryRootWindow()->GetRootWindowController();
WallpaperWidgetController* animating_controller =
root_window_controller->animating_wallpaper_widget_controller()
diff --git a/ash/common/wallpaper/wallpaper_view.cc b/ash/common/wallpaper/wallpaper_view.cc
index 35c27ce..c690b520 100644
--- a/ash/common/wallpaper/wallpaper_view.cc
+++ b/ash/common/wallpaper/wallpaper_view.cc
@@ -10,9 +10,9 @@
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
#include "ash/common/wm/overview/window_selector_controller.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/display/screen.h"
@@ -210,7 +210,7 @@
WmLookup::Get()->GetWindowForWidget(wallpaper_widget);
wallpaper_window->SetVisibilityAnimationType(animation_type);
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
root_window->GetRootWindowController();
// Enable wallpaper transition for the following cases:
diff --git a/ash/common/wallpaper/wallpaper_widget_controller.cc b/ash/common/wallpaper/wallpaper_widget_controller.cc
index 637455eb..b86bf61 100644
--- a/ash/common/wallpaper/wallpaper_widget_controller.cc
+++ b/ash/common/wallpaper/wallpaper_widget_controller.cc
@@ -7,9 +7,9 @@
#include "ash/ash_export.h"
#include "ash/common/wallpaper/wallpaper_delegate.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/views/widget/widget.h"
@@ -20,7 +20,7 @@
class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
public views::WidgetObserver {
public:
- ShowWallpaperAnimationObserver(WmRootWindowController* root_window_controller,
+ ShowWallpaperAnimationObserver(RootWindowController* root_window_controller,
views::Widget* wallpaper_widget,
bool is_initial_animation)
: root_window_controller_(root_window_controller),
@@ -51,7 +51,7 @@
// Overridden from views::WidgetObserver.
void OnWidgetDestroying(views::Widget* widget) override { delete this; }
- WmRootWindowController* root_window_controller_;
+ RootWindowController* root_window_controller_;
views::Widget* wallpaper_widget_;
// Is this object observing the initial brightness/grayscale animation?
@@ -114,7 +114,7 @@
}
void WallpaperWidgetController::StartAnimating(
- WmRootWindowController* root_window_controller) {
+ RootWindowController* root_window_controller) {
if (widget_) {
ui::ScopedLayerAnimationSettings settings(
widget_->GetLayer()->GetAnimator());
diff --git a/ash/common/wallpaper/wallpaper_widget_controller.h b/ash/common/wallpaper/wallpaper_widget_controller.h
index 853fe9a..d125caf 100644
--- a/ash/common/wallpaper/wallpaper_widget_controller.h
+++ b/ash/common/wallpaper/wallpaper_widget_controller.h
@@ -14,7 +14,7 @@
namespace ash {
-class WmRootWindowController;
+class RootWindowController;
class WmWindow;
// This class implements a widget-based wallpaper.
@@ -41,7 +41,7 @@
// Starts wallpaper fade in animation. |root_window_controller| is
// the root window where the animation will happen. (This is
// necessary this as |layer_| doesn't have access to the root window).
- void StartAnimating(WmRootWindowController* root_window_controller);
+ void StartAnimating(RootWindowController* root_window_controller);
views::Widget* widget() { return widget_; }
diff --git a/ash/common/wm/container_finder.cc b/ash/common/wm/container_finder.cc
index d29ebcee..f859279 100644
--- a/ash/common/wm/container_finder.cc
+++ b/ash/common/wm/container_finder.cc
@@ -8,11 +8,11 @@
#include "ash/common/wm/always_on_top_controller.h"
#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
diff --git a/ash/common/wm/default_state.cc b/ash/common/wm/default_state.cc
index ada7075..e15f888 100644
--- a/ash/common/wm/default_state.cc
+++ b/ash/common/wm/default_state.cc
@@ -14,10 +14,10 @@
#include "ash/common/wm/window_state_util.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
diff --git a/ash/common/wm/dock/docked_window_layout_manager.cc b/ash/common/wm/dock/docked_window_layout_manager.cc
index 6a0992f3..68bba9a 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.cc
+++ b/ash/common/wm/dock/docked_window_layout_manager.cc
@@ -16,10 +16,10 @@
#include "ash/common/wm/window_resizer.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "base/metrics/histogram.h"
#include "grit/ash_resources.h"
diff --git a/ash/common/wm/dock/docked_window_layout_manager.h b/ash/common/wm/dock/docked_window_layout_manager.h
index 7704465..d7e0977b 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.h
+++ b/ash/common/wm/dock/docked_window_layout_manager.h
@@ -27,7 +27,7 @@
class DockedBackgroundWidget;
class DockedWindowLayoutManagerObserver;
class DockedWindowResizerTest;
-class WmRootWindowController;
+class RootWindowController;
class WmShelf;
// DockedWindowLayoutManager is responsible for organizing windows when they are
@@ -252,7 +252,7 @@
// Parent window associated with this layout manager.
WmWindow* dock_container_;
- WmRootWindowController* root_window_controller_;
+ RootWindowController* root_window_controller_;
// Protect against recursive calls to Relayout().
bool in_layout_;
diff --git a/ash/common/wm/dock/docked_window_resizer.cc b/ash/common/wm/dock/docked_window_resizer.cc
index 7721be93..44774f1e 100644
--- a/ash/common/wm/dock/docked_window_resizer.cc
+++ b/ash/common/wm/dock/docked_window_resizer.cc
@@ -10,10 +10,10 @@
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/workspace/magnetism_matcher.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_types.h"
#include "ui/display/display.h"
diff --git a/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc b/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
index ddcc1c4..03dee3e 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_window_manager.cc
@@ -14,11 +14,11 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/workspace_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
@@ -317,7 +317,7 @@
// Inform the WorkspaceLayoutManager that we want to show a backdrop behind
// the topmost window of its container.
for (WmWindow* root : WmShell::Get()->GetAllRootWindows()) {
- WmRootWindowController* controller = root->GetRootWindowController();
+ RootWindowController* controller = root->GetRootWindowController();
WmWindow* default_container =
root->GetChildByShellWindowId(kShellWindowId_DefaultContainer);
controller->workspace_controller()->SetMaximizeBackdropDelegate(
diff --git a/ash/common/wm/maximize_mode/workspace_backdrop_delegate.cc b/ash/common/wm/maximize_mode/workspace_backdrop_delegate.cc
index 1a36741a..c29c9db 100644
--- a/ash/common/wm/maximize_mode/workspace_backdrop_delegate.cc
+++ b/ash/common/wm/maximize_mode/workspace_backdrop_delegate.cc
@@ -6,10 +6,10 @@
#include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_observer.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
diff --git a/ash/common/wm/overview/scoped_transform_overview_window.cc b/ash/common/wm/overview/scoped_transform_overview_window.cc
index 5601d8df..cf808310 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/common/wm/overview/scoped_transform_overview_window.cc
@@ -12,10 +12,10 @@
#include "ash/common/wm/overview/window_selector_item.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
+#include "ash/root_window_controller.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
diff --git a/ash/common/wm/overview/window_grid.cc b/ash/common/wm/overview/window_grid.cc
index e4aa513..4b3827aa 100644
--- a/ash/common/wm/overview/window_grid.cc
+++ b/ash/common/wm/overview/window_grid.cc
@@ -21,10 +21,10 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/i18n/string_search.h"
#include "base/memory/scoped_vector.h"
diff --git a/ash/common/wm/overview/window_selector.cc b/ash/common/wm/overview/window_selector.cc
index 3963265..d2c6abb 100644
--- a/ash/common/wm/overview/window_selector.cc
+++ b/ash/common/wm/overview/window_selector.cc
@@ -23,10 +23,10 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/metrics/histogram.h"
diff --git a/ash/common/wm/overview/window_selector_item.cc b/ash/common/wm/overview/window_selector_item.cc
index 647b739..c225ef9 100644
--- a/ash/common/wm/overview/window_selector_item.cc
+++ b/ash/common/wm/overview/window_selector_item.cc
@@ -18,12 +18,12 @@
#include "ash/common/wm/overview/window_selector_controller.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/ash/common/wm/panels/panel_layout_manager.cc b/ash/common/wm/panels/panel_layout_manager.cc
index 37a3c646..2bc0fb5 100644
--- a/ash/common/wm/panels/panel_layout_manager.cc
+++ b/ash/common/wm/panels/panel_layout_manager.cc
@@ -15,11 +15,11 @@
#include "ash/common/wm/window_parenting_utils.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/auto_reset.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPaint.h"
diff --git a/ash/common/wm/panels/panel_layout_manager.h b/ash/common/wm/panels/panel_layout_manager.h
index 9bb1761..db78889c 100644
--- a/ash/common/wm/panels/panel_layout_manager.h
+++ b/ash/common/wm/panels/panel_layout_manager.h
@@ -36,7 +36,7 @@
class WmShelf;
namespace wm {
-class WmRootWindowController;
+class RootWindowController;
}
// PanelLayoutManager is responsible for organizing panels within the
@@ -170,7 +170,7 @@
// Parent window associated with this layout manager.
WmWindow* panel_container_;
- WmRootWindowController* root_window_controller_;
+ RootWindowController* root_window_controller_;
// Protect against recursive calls to OnWindowAddedToLayout().
bool in_add_window_;
diff --git a/ash/common/wm/panels/panel_window_resizer.cc b/ash/common/wm/panels/panel_window_resizer.cc
index e553a6b..9a8aa83 100644
--- a/ash/common/wm/panels/panel_window_resizer.cc
+++ b/ash/common/wm/panels/panel_window_resizer.cc
@@ -9,10 +9,10 @@
#include "ash/common/wm/window_parenting_utils.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_types.h"
#include "ui/display/display.h"
diff --git a/ash/common/wm/root_window_finder.cc b/ash/common/wm/root_window_finder.cc
index 8753f62..bfd3221 100644
--- a/ash/common/wm/root_window_finder.cc
+++ b/ash/common/wm/root_window_finder.cc
@@ -5,8 +5,8 @@
#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/point.h"
@@ -19,7 +19,7 @@
const display::Display& display =
display::Screen::GetScreen()->GetDisplayNearestPoint(point);
DCHECK(display.is_valid());
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmLookup::Get()->GetRootWindowControllerWithDisplayId(display.id());
return root_window_controller ? root_window_controller->GetWindow() : nullptr;
}
@@ -27,7 +27,7 @@
WmWindow* GetRootWindowMatching(const gfx::Rect& rect) {
const display::Display& display =
display::Screen::GetScreen()->GetDisplayMatching(rect);
- WmRootWindowController* root_window_controller =
+ RootWindowController* root_window_controller =
WmLookup::Get()->GetRootWindowControllerWithDisplayId(display.id());
return root_window_controller ? root_window_controller->GetWindow() : nullptr;
}
diff --git a/ash/common/wm/window_cycle_list.cc b/ash/common/wm/window_cycle_list.cc
index 28d2007..82199ec0 100644
--- a/ash/common/wm/window_cycle_list.cc
+++ b/ash/common/wm/window_cycle_list.cc
@@ -9,10 +9,10 @@
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "ui/accessibility/ax_node_data.h"
diff --git a/ash/common/wm/window_positioning_utils.cc b/ash/common/wm/window_positioning_utils.cc
index 02ef979..aac29493 100644
--- a/ash/common/wm/window_positioning_utils.cc
+++ b/ash/common/wm/window_positioning_utils.cc
@@ -11,10 +11,10 @@
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_tracker.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/geometry/rect.h"
@@ -138,7 +138,7 @@
// display.
if (!window->GetTransientParent() &&
!IsWindowOrAncestorLockedToRoot(window)) {
- WmRootWindowController* dst_root_window_controller =
+ RootWindowController* dst_root_window_controller =
WmLookup::Get()->GetRootWindowControllerWithDisplayId(display.id());
DCHECK(dst_root_window_controller);
WmWindow* dst_root = dst_root_window_controller->GetWindow();
diff --git a/ash/common/wm/wm_screen_util.cc b/ash/common/wm/wm_screen_util.cc
index fdc7396..9e11aea 100644
--- a/ash/common/wm/wm_screen_util.cc
+++ b/ash/common/wm/wm_screen_util.cc
@@ -4,9 +4,9 @@
#include "ash/common/wm/wm_screen_util.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/geometry/size_conversions.h"
diff --git a/ash/common/wm/workspace/multi_window_resize_controller.cc b/ash/common/wm/workspace/multi_window_resize_controller.cc
index 846127f..a96fec8 100644
--- a/ash/common/wm/workspace/multi_window_resize_controller.cc
+++ b/ash/common/wm/workspace/multi_window_resize_controller.cc
@@ -6,9 +6,9 @@
#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "grit/ash_resources.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/hit_test.h"
diff --git a/ash/common/wm/workspace/phantom_window_controller.cc b/ash/common/wm/workspace/phantom_window_controller.cc
index cfeb709..bd56e4d 100644
--- a/ash/common/wm/workspace/phantom_window_controller.cc
+++ b/ash/common/wm/workspace/phantom_window_controller.cc
@@ -8,9 +8,9 @@
#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "grit/ash_resources.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
diff --git a/ash/common/wm/workspace/workspace_layout_manager.cc b/ash/common/wm/workspace/workspace_layout_manager.cc
index 3768eadeb6..a1a3696 100644
--- a/ash/common/wm/workspace/workspace_layout_manager.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager.cc
@@ -15,11 +15,11 @@
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "ui/base/ui_base_switches.h"
#include "ui/compositor/layer.h"
diff --git a/ash/common/wm/workspace/workspace_layout_manager.h b/ash/common/wm/workspace/workspace_layout_manager.h
index ca3abb1..80cefe83 100644
--- a/ash/common/wm/workspace/workspace_layout_manager.h
+++ b/ash/common/wm/workspace/workspace_layout_manager.h
@@ -21,8 +21,8 @@
#include "ui/keyboard/keyboard_controller_observer.h"
namespace ash {
+class RootWindowController;
class WmShell;
-class WmRootWindowController;
class WorkspaceLayoutManagerBackdropDelegate;
namespace wm {
@@ -116,7 +116,7 @@
WmWindow* window_;
WmWindow* root_window_;
- WmRootWindowController* root_window_controller_;
+ RootWindowController* root_window_controller_;
WmShell* shell_;
// Set of windows we're listening to.
diff --git a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
index 7cd55d8a..b2e11e5a 100644
--- a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
@@ -21,9 +21,9 @@
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "ui/aura/env.h"
@@ -389,7 +389,7 @@
WmWindow* window = window_owner.window();
window->GetWindowState()->Maximize();
WmWindow* default_container =
- WmShell::Get()->GetPrimaryRootWindowController()->GetContainer(
+ WmShell::Get()->GetPrimaryRootWindowController()->GetWmContainer(
kShellWindowId_DefaultContainer);
default_container->AddChild(window);
window->Show();
@@ -944,7 +944,7 @@
AshTest::SetUp();
UpdateDisplay("800x600");
default_container_ =
- WmShell::Get()->GetPrimaryRootWindowController()->GetContainer(
+ WmShell::Get()->GetPrimaryRootWindowController()->GetWmContainer(
kShellWindowId_DefaultContainer);
}
@@ -1125,7 +1125,7 @@
AshTest::SetUp();
UpdateDisplay("800x600");
WmWindow* default_container =
- WmShell::Get()->GetPrimaryRootWindowController()->GetContainer(
+ WmShell::Get()->GetPrimaryRootWindowController()->GetWmContainer(
kShellWindowId_DefaultContainer);
layout_manager_ = GetWorkspaceLayoutManager(default_container);
}
diff --git a/ash/common/wm/workspace/workspace_window_resizer.cc b/ash/common/wm/workspace/workspace_window_resizer.cc
index 4a712e5..32c89b0 100644
--- a/ash/common/wm/workspace/workspace_window_resizer.cc
+++ b/ash/common/wm/workspace/workspace_window_resizer.cc
@@ -22,10 +22,10 @@
#include "ash/common/wm/workspace/phantom_window_controller.h"
#include "ash/common/wm/workspace/two_step_edge_cycler.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "ui/base/hit_test.h"
diff --git a/ash/common/wm/workspace_controller.cc b/ash/common/wm/workspace_controller.cc
index 21809a50..d93bae8 100644
--- a/ash/common/wm/workspace_controller.cc
+++ b/ash/common/wm/workspace_controller.cc
@@ -14,10 +14,10 @@
#include "ash/common/wm/workspace/workspace_event_handler.h"
#include "ash/common/wm/workspace/workspace_layout_manager.h"
#include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
diff --git a/ash/common/wm_lookup.h b/ash/common/wm_lookup.h
index e677360..c6b4b63b 100644
--- a/ash/common/wm_lookup.h
+++ b/ash/common/wm_lookup.h
@@ -15,7 +15,7 @@
namespace ash {
-class WmRootWindowController;
+class RootWindowController;
class WmWindow;
// WmLookup is used to lookup various wm types.
@@ -24,9 +24,9 @@
static void Set(WmLookup* lookup);
static WmLookup* Get();
- // Returns the WmRootWindowController with the specified display id, or null
- // if there isn't one.
- virtual WmRootWindowController* GetRootWindowControllerWithDisplayId(
+ // Returns the RootWindowController with the specified display id, or null if
+ // there isn't one.
+ virtual RootWindowController* GetRootWindowControllerWithDisplayId(
int64_t id) = 0;
// Returns the WmWindow for the specified widget.
diff --git a/ash/common/wm_root_window_controller.cc b/ash/common/wm_root_window_controller.cc
index c236c16..35767001 100644
--- a/ash/common/wm_root_window_controller.cc
+++ b/ash/common/wm_root_window_controller.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/common/wm_root_window_controller.h"
+#include "ash/root_window_controller.h"
#include "ash/aura/wm_window_aura.h"
#include "ash/common/session/session_state_delegate.h"
@@ -41,7 +41,10 @@
#include "ui/events/event_utils.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
#include "ui/views/controls/menu/menu_runner.h"
+#include "ui/wm/core/coordinate_conversion.h"
+// TODO(sky): this file is temporary and here to make review easier. The
+// contents of this file will be folded into root_window_controller.cc shortly.
namespace ash {
namespace {
@@ -63,6 +66,7 @@
}
// Reparents |window| to |new_parent|.
+// TODO(sky): This should take an aura::Window. http://crbug.com/671246.
void ReparentWindow(WmWindow* window, WmWindow* new_parent) {
const gfx::Size src_size = window->GetParent()->GetBounds().size();
const gfx::Size dst_size = new_parent->GetBounds().size();
@@ -96,6 +100,7 @@
}
// Reparents the appropriate set of windows from |src| to |dst|.
+// TODO(sky): This should take an aura::Window. http://crbug.com/671246.
void ReparentAllWindows(WmWindow* src, WmWindow* dst) {
// Set of windows to move.
const int kContainerIdsToMove[] = {
@@ -143,6 +148,7 @@
}
// Creates a new window for use as a container.
+// TODO(sky): This should create an aura::Window. http://crbug.com/671246.
WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) {
WmWindow* window = WmShell::Get()->NewWindow(ui::wm::WINDOW_TYPE_UNKNOWN,
ui::LAYER_NOT_DRAWN);
@@ -154,210 +160,178 @@
return window;
}
+// TODO(sky): This should take an aura::Window. http://crbug.com/671246.
+bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) {
+ if (!WmWindowAura::GetAuraWindow(window)->owned_by_parent())
+ return false;
+
+ if (!WmShell::Get()->IsRunningInMash())
+ return true;
+
+ aura::WindowMus* window_mus =
+ aura::WindowMus::Get(WmWindowAura::GetAuraWindow(window));
+ return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) ||
+ Shell::window_tree_client()->IsRoot(window_mus);
+}
+
} // namespace
-WmRootWindowController::WmRootWindowController(
- RootWindowController* root_window_controller,
- WmWindow* root)
- : root_window_controller_(root_window_controller), root_(root) {
- DCHECK(root_window_controller_);
- DCHECK(root_);
-}
-
-WmRootWindowController::~WmRootWindowController() {
- if (animating_wallpaper_widget_controller_.get())
- animating_wallpaper_widget_controller_->StopAnimating();
-}
-
-void WmRootWindowController::SetWallpaperWidgetController(
+void RootWindowController::SetWallpaperWidgetController(
WallpaperWidgetController* controller) {
wallpaper_widget_controller_.reset(controller);
}
-void WmRootWindowController::SetAnimatingWallpaperWidgetController(
+void RootWindowController::SetAnimatingWallpaperWidgetController(
AnimatingWallpaperWidgetController* controller) {
if (animating_wallpaper_widget_controller_.get())
animating_wallpaper_widget_controller_->StopAnimating();
animating_wallpaper_widget_controller_.reset(controller);
}
-wm::WorkspaceWindowState WmRootWindowController::GetWorkspaceWindowState() {
+wm::WorkspaceWindowState RootWindowController::GetWorkspaceWindowState() {
return workspace_controller_ ? workspace_controller()->GetWindowState()
: wm::WORKSPACE_WINDOW_STATE_DEFAULT;
}
SystemModalContainerLayoutManager*
-WmRootWindowController::GetSystemModalLayoutManager(WmWindow* window) {
+RootWindowController::GetSystemModalLayoutManager(WmWindow* window) {
WmWindow* modal_container = nullptr;
if (window) {
WmWindow* window_container = wm::GetContainerForWindow(window);
if (window_container &&
window_container->GetShellWindowId() >=
kShellWindowId_LockScreenContainer) {
- modal_container = GetContainer(kShellWindowId_LockSystemModalContainer);
+ modal_container = GetWmContainer(kShellWindowId_LockSystemModalContainer);
} else {
- modal_container = GetContainer(kShellWindowId_SystemModalContainer);
+ modal_container = GetWmContainer(kShellWindowId_SystemModalContainer);
}
} else {
int modal_window_id =
WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()
? kShellWindowId_LockSystemModalContainer
: kShellWindowId_SystemModalContainer;
- modal_container = GetContainer(modal_window_id);
+ modal_container = GetWmContainer(modal_window_id);
}
return modal_container ? static_cast<SystemModalContainerLayoutManager*>(
modal_container->GetLayoutManager())
: nullptr;
}
-bool WmRootWindowController::HasShelf() {
- return GetShelf()->shelf_widget() != nullptr;
+bool RootWindowController::HasShelf() {
+ return wm_shelf_->shelf_widget() != nullptr;
}
-WmShelf* WmRootWindowController::GetShelf() {
- return root_window_controller_->wm_shelf();
+WmShelf* RootWindowController::GetShelf() {
+ return wm_shelf_.get();
}
-void WmRootWindowController::CreateShelf() {
- WmShelf* shelf = GetShelf();
- if (shelf->IsShelfInitialized())
+void RootWindowController::CreateShelf() {
+ if (wm_shelf_->IsShelfInitialized())
return;
- shelf->InitializeShelf();
+ wm_shelf_->InitializeShelf();
if (panel_layout_manager_)
- panel_layout_manager_->SetShelf(shelf);
+ panel_layout_manager_->SetShelf(wm_shelf_.get());
if (docked_window_layout_manager_) {
- docked_window_layout_manager_->SetShelf(shelf);
- if (shelf->shelf_layout_manager())
- docked_window_layout_manager_->AddObserver(shelf->shelf_layout_manager());
+ docked_window_layout_manager_->SetShelf(wm_shelf_.get());
+ if (wm_shelf_->shelf_layout_manager())
+ docked_window_layout_manager_->AddObserver(
+ wm_shelf_->shelf_layout_manager());
}
// Notify shell observers that the shelf has been created.
// TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will
// require changing AttachedPanelWidgetTargeter's access to WmShelf.
- WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow());
+ WmShell::Get()->NotifyShelfCreatedForRootWindow(
+ WmWindowAura::Get(GetRootWindow()));
- shelf->shelf_widget()->PostCreateShelf();
+ wm_shelf_->shelf_widget()->PostCreateShelf();
}
-void WmRootWindowController::ShowShelf() {
- WmShelf* shelf = GetShelf();
- if (!shelf->IsShelfInitialized())
+void RootWindowController::ShowShelf() {
+ if (!wm_shelf_->IsShelfInitialized())
return;
// TODO(jamescook): Move this into WmShelf.
- shelf->shelf_widget()->SetShelfVisibility(true);
- shelf->shelf_widget()->status_area_widget()->Show();
+ wm_shelf_->shelf_widget()->SetShelfVisibility(true);
+ wm_shelf_->shelf_widget()->status_area_widget()->Show();
}
-SystemTray* WmRootWindowController::GetSystemTray() {
- ShelfWidget* shelf_widget = GetShelf()->shelf_widget();
- if (!shelf_widget || !shelf_widget->status_area_widget())
- return nullptr;
- return shelf_widget->status_area_widget()->system_tray();
+const WmWindow* RootWindowController::GetWindow() const {
+ return WmWindowAura::Get(GetRootWindow());
}
-WmWindow* WmRootWindowController::GetWindow() {
- return root_;
+const WmWindow* RootWindowController::GetWmContainer(int container_id) const {
+ const aura::Window* window = GetContainer(container_id);
+ return WmWindowAura::Get(window);
}
-WmWindow* WmRootWindowController::GetContainer(int container_id) {
- return root_->GetChildByShellWindowId(container_id);
-}
-
-const WmWindow* WmRootWindowController::GetContainer(int container_id) const {
- return root_->GetChildByShellWindowId(container_id);
-}
-
-void WmRootWindowController::ConfigureWidgetInitParamsForContainer(
+void RootWindowController::ConfigureWidgetInitParamsForContainer(
views::Widget* widget,
int shell_container_id,
views::Widget::InitParams* init_params) {
- init_params->parent = WmWindowAura::GetAuraWindow(
- GetWindow()->GetChildByShellWindowId(shell_container_id));
+ init_params->parent = GetContainer(shell_container_id);
}
-WmWindow* WmRootWindowController::FindEventTarget(
+WmWindow* RootWindowController::FindEventTarget(
const gfx::Point& location_in_screen) {
- gfx::Point location_in_root =
- GetWindow()->ConvertPointFromScreen(location_in_screen);
- aura::Window* root = WmWindowAura::GetAuraWindow(GetWindow());
+ gfx::Point location_in_root(location_in_screen);
+ aura::Window* root_window = GetRootWindow();
+ ::wm::ConvertPointFromScreen(root_window, &location_in_root);
ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root,
location_in_root, ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE);
- ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root)
- ->GetEventTargeter()
- ->FindTargetForEvent(root, &test_event);
+ ui::EventTarget* event_handler =
+ static_cast<ui::EventTarget*>(root_window)
+ ->GetEventTargeter()
+ ->FindTargetForEvent(root_window, &test_event);
return WmWindowAura::Get(static_cast<aura::Window*>(event_handler));
}
-gfx::Point WmRootWindowController::GetLastMouseLocationInRoot() {
- return WmWindowAura::GetAuraWindow(GetWindow())
- ->GetHost()
- ->dispatcher()
- ->GetLastMouseLocationInRoot();
+gfx::Point RootWindowController::GetLastMouseLocationInRoot() {
+ return window_tree_host_->dispatcher()->GetLastMouseLocationInRoot();
}
-void WmRootWindowController::ShowContextMenu(
- const gfx::Point& location_in_screen,
- ui::MenuSourceType source_type) {
+void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
+ ui::MenuSourceType source_type) {
ShellDelegate* delegate = WmShell::Get()->delegate();
DCHECK(delegate);
- menu_model_.reset(delegate->CreateContextMenu(GetShelf(), nullptr));
+ menu_model_.reset(delegate->CreateContextMenu(wm_shelf_.get(), nullptr));
if (!menu_model_)
return;
- menu_model_adapter_.reset(new views::MenuModelAdapter(
- menu_model_.get(), base::Bind(&WmRootWindowController::OnMenuClosed,
- base::Unretained(this))));
+ menu_model_adapter_ = base::MakeUnique<views::MenuModelAdapter>(
+ menu_model_.get(),
+ base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this)));
// The wallpaper controller may not be set yet if the user clicked on the
// status area before the initial animation completion. See crbug.com/222218
if (!wallpaper_widget_controller())
return;
- menu_runner_.reset(new views::MenuRunner(
+ menu_runner_ = base::MakeUnique<views::MenuRunner>(
menu_model_adapter_->CreateMenu(),
- views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC));
+ views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC);
ignore_result(
menu_runner_->RunMenuAt(wallpaper_widget_controller()->widget(), nullptr,
gfx::Rect(location_in_screen, gfx::Size()),
views::MENU_ANCHOR_TOPLEFT, source_type));
}
-void WmRootWindowController::OnInitialWallpaperAnimationStarted() {
- root_window_controller_->OnInitialWallpaperAnimationStarted();
-}
-
-void WmRootWindowController::OnWallpaperAnimationFinished(
- views::Widget* widget) {
- root_window_controller_->OnWallpaperAnimationFinished(widget);
- WmShell::Get()->wallpaper_delegate()->OnWallpaperAnimationFinished();
- // Only removes old component when wallpaper animation finished. If we
- // remove the old one before the new wallpaper is done fading in there will
- // be a white flash during the animation.
- if (animating_wallpaper_widget_controller()) {
- WallpaperWidgetController* controller =
- animating_wallpaper_widget_controller()->GetController(true);
- DCHECK_EQ(controller->widget(), widget);
- // Release the old controller and close its wallpaper widget.
- SetWallpaperWidgetController(controller);
- }
-}
-
-void WmRootWindowController::UpdateAfterLoginStatusChange(LoginStatus status) {
+void RootWindowController::UpdateAfterLoginStatusChange(LoginStatus status) {
StatusAreaWidget* status_area_widget =
- GetShelf()->shelf_widget()->status_area_widget();
+ wm_shelf_->shelf_widget()->status_area_widget();
if (status_area_widget)
status_area_widget->UpdateAfterLoginStatusChange(status);
}
-void WmRootWindowController::MoveWindowsTo(WmWindow* dest) {
+void RootWindowController::MoveWindowsTo(aura::Window* dst) {
// Clear the workspace controller, so it doesn't incorrectly update the shelf.
workspace_controller_.reset();
- ReparentAllWindows(GetWindow(), dest);
+ ReparentAllWindows(GetWindow(), WmWindowAura::Get(dst));
}
-void WmRootWindowController::CreateContainers() {
+void RootWindowController::CreateContainers() {
+ WmWindow* root = GetWindow();
// These containers are just used by PowerButtonController to animate groups
// of containers simultaneously without messing up the current transformations
// on those containers. These are direct children of the root window; all of
@@ -368,27 +342,27 @@
// is moved to the lock screen wallpaper container (and moved back on unlock).
// Ensure that there's an opaque layer occluding the non-lock-screen layers.
WmWindow* wallpaper_container = CreateContainer(
- kShellWindowId_WallpaperContainer, "WallpaperContainer", root_);
+ kShellWindowId_WallpaperContainer, "WallpaperContainer", root);
wallpaper_container->SetChildWindowVisibilityChangesAnimated();
WmWindow* non_lock_screen_containers =
CreateContainer(kShellWindowId_NonLockScreenContainersContainer,
- "NonLockScreenContainersContainer", root_);
+ "NonLockScreenContainersContainer", root);
// Clip all windows inside this container, as half pixel of the window's
// texture may become visible when the screen is scaled. crbug.com/368591.
non_lock_screen_containers->SetMasksToBounds(true);
WmWindow* lock_wallpaper_containers =
CreateContainer(kShellWindowId_LockScreenWallpaperContainer,
- "LockScreenWallpaperContainer", root_);
+ "LockScreenWallpaperContainer", root);
lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated();
WmWindow* lock_screen_containers =
CreateContainer(kShellWindowId_LockScreenContainersContainer,
- "LockScreenContainersContainer", root_);
+ "LockScreenContainersContainer", root);
WmWindow* lock_screen_related_containers =
CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer,
- "LockScreenRelatedContainersContainer", root_);
+ "LockScreenRelatedContainersContainer", root);
CreateContainer(kShellWindowId_UnparentedControlContainer,
"UnparentedControlContainer", non_lock_screen_containers);
@@ -525,78 +499,82 @@
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
WmWindow* mouse_cursor_container = CreateContainer(
- kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root_);
+ kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root);
mouse_cursor_container->SetBoundsInScreenBehaviorForChildren(
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
CreateContainer(kShellWindowId_PowerButtonAnimationContainer,
- "PowerButtonAnimationContainer", root_);
+ "PowerButtonAnimationContainer", root);
}
-void WmRootWindowController::CreateLayoutManagers() {
+void RootWindowController::CreateLayoutManagers() {
GetShelf()->CreateShelfWidget(GetWindow());
- root_window_layout_manager_ = new wm::RootWindowLayoutManager(root_);
- root_->SetLayoutManager(base::WrapUnique(root_window_layout_manager_));
+ WmWindow* root = GetWindow();
+ root_window_layout_manager_ = new wm::RootWindowLayoutManager(root);
+ root->SetLayoutManager(base::WrapUnique(root_window_layout_manager_));
- WmWindow* default_container = GetContainer(kShellWindowId_DefaultContainer);
+ WmWindow* default_container = GetWmContainer(kShellWindowId_DefaultContainer);
// Installs WorkspaceLayoutManager on |default_container|.
workspace_controller_.reset(new WorkspaceController(default_container));
- WmWindow* modal_container = GetContainer(kShellWindowId_SystemModalContainer);
+ WmWindow* modal_container =
+ GetWmContainer(kShellWindowId_SystemModalContainer);
DCHECK(modal_container);
modal_container->SetLayoutManager(
base::MakeUnique<SystemModalContainerLayoutManager>(modal_container));
WmWindow* lock_modal_container =
- GetContainer(kShellWindowId_LockSystemModalContainer);
+ GetWmContainer(kShellWindowId_LockSystemModalContainer);
DCHECK(lock_modal_container);
lock_modal_container->SetLayoutManager(
base::MakeUnique<SystemModalContainerLayoutManager>(
lock_modal_container));
- WmWindow* lock_container = GetContainer(kShellWindowId_LockScreenContainer);
+ WmWindow* lock_container = GetWmContainer(kShellWindowId_LockScreenContainer);
DCHECK(lock_container);
lock_container->SetLayoutManager(
base::MakeUnique<LockLayoutManager>(lock_container));
WmWindow* always_on_top_container =
- GetContainer(kShellWindowId_AlwaysOnTopContainer);
+ GetWmContainer(kShellWindowId_AlwaysOnTopContainer);
DCHECK(always_on_top_container);
always_on_top_controller_ =
base::MakeUnique<AlwaysOnTopController>(always_on_top_container);
// Create Docked windows layout manager
- WmWindow* docked_container = GetContainer(kShellWindowId_DockedContainer);
+ WmWindow* docked_container = GetWmContainer(kShellWindowId_DockedContainer);
docked_window_layout_manager_ =
new DockedWindowLayoutManager(docked_container);
docked_container->SetLayoutManager(
base::WrapUnique(docked_window_layout_manager_));
// Create Panel layout manager
- WmWindow* panel_container = GetContainer(kShellWindowId_PanelContainer);
+ WmWindow* panel_container = GetWmContainer(kShellWindowId_PanelContainer);
panel_layout_manager_ = new PanelLayoutManager(panel_container);
panel_container->SetLayoutManager(base::WrapUnique(panel_layout_manager_));
- wm::WmSnapToPixelLayoutManager::InstallOnContainers(root_);
+ wm::WmSnapToPixelLayoutManager::InstallOnContainers(root);
}
-void WmRootWindowController::ResetRootForNewWindowsIfNecessary() {
+void RootWindowController::ResetRootForNewWindowsIfNecessary() {
WmShell* shell = WmShell::Get();
// Change the target root window before closing child windows. If any child
// being removed triggers a relayout of the shelf it will try to build a
// window list adding windows from the target root window's containers which
// may have already gone away.
- if (shell->GetRootWindowForNewWindows() == GetWindow()) {
+ WmWindow* root = GetWindow();
+ if (shell->GetRootWindowForNewWindows() == root) {
// The root window for new windows is being destroyed. Switch to the primary
// root window if possible.
WmWindow* primary_root = shell->GetPrimaryRootWindow();
- shell->set_root_window_for_new_windows(
- primary_root == GetWindow() ? nullptr : primary_root);
+ shell->set_root_window_for_new_windows(primary_root == root ? nullptr
+ : primary_root);
}
}
-void WmRootWindowController::CloseChildWindows() {
+// TODO(sky): fold into CloseChildWindows() when move back.
+void RootWindowController::CloseChildWindowsImpl() {
// NOTE: this may be called multiple times.
// |panel_layout_manager_| needs to be shut down before windows are destroyed.
@@ -620,7 +598,8 @@
// Explicitly destroy top level windows. We do this because such windows may
// query the RootWindow for state.
WmWindowTracker non_toplevel_windows;
- non_toplevel_windows.Add(root_);
+ WmWindow* root = GetWindow();
+ non_toplevel_windows.Add(root);
while (!non_toplevel_windows.windows().empty()) {
WmWindow* non_toplevel_window = non_toplevel_windows.Pop();
WmWindowTracker toplevel_windows;
@@ -636,12 +615,12 @@
toplevel_windows.Pop()->Destroy();
}
// And then remove the containers.
- while (!root_->GetChildren().empty()) {
- WmWindow* child = root_->GetChildren()[0];
+ while (!root->GetChildren().empty()) {
+ WmWindow* child = root->GetChildren()[0];
if (ShouldDestroyWindowInCloseChildWindows(child))
child->Destroy();
else
- root_->RemoveChild(child);
+ root->RemoveChild(child);
}
shelf->DestroyShelfWidget();
@@ -652,25 +631,11 @@
shelf->ShutdownShelf();
}
-bool WmRootWindowController::ShouldDestroyWindowInCloseChildWindows(
- WmWindow* window) {
- if (!WmWindowAura::GetAuraWindow(window)->owned_by_parent())
- return false;
-
- if (aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL)
- return true;
-
- aura::WindowMus* window_mus =
- aura::WindowMus::Get(WmWindowAura::GetAuraWindow(window));
- return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) ||
- Shell::window_tree_client()->IsRoot(window_mus);
-}
-
-void WmRootWindowController::OnMenuClosed() {
+void RootWindowController::OnMenuClosed() {
menu_runner_.reset();
menu_model_adapter_.reset();
menu_model_.reset();
- GetShelf()->UpdateVisibilityState();
+ wm_shelf_->UpdateVisibilityState();
}
} // namespace ash
diff --git a/ash/common/wm_root_window_controller.h b/ash/common/wm_root_window_controller.h
deleted file mode 100644
index 15e811c..0000000
--- a/ash/common/wm_root_window_controller.h
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_
-#define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_
-
-#include "ash/ash_export.h"
-#include "ash/common/wm/workspace/workspace_types.h"
-#include "base/macros.h"
-#include "ui/base/ui_base_types.h"
-#include "ui/views/widget/widget.h"
-
-namespace gfx {
-class Point;
-}
-
-namespace ui {
-class MenuModel;
-}
-
-namespace views {
-class MenuModelAdapter;
-class MenuRunner;
-}
-
-namespace ash {
-
-class AlwaysOnTopController;
-class AnimatingWallpaperWidgetController;
-class DockedWindowLayoutManager;
-class PanelLayoutManager;
-class RootWindowController;
-class SystemModalContainerLayoutManager;
-class SystemTray;
-class WallpaperWidgetController;
-class WmShelf;
-class WmWindow;
-class WorkspaceController;
-
-enum class LoginStatus;
-
-namespace wm {
-class RootWindowLayoutManager;
-}
-
-// Provides state associated with a root of a window hierarchy.
-class ASH_EXPORT WmRootWindowController {
- public:
- WmRootWindowController(RootWindowController* root_window_controller,
- WmWindow* window);
- ~WmRootWindowController();
-
- DockedWindowLayoutManager* docked_window_layout_manager() {
- return docked_window_layout_manager_;
- }
-
- PanelLayoutManager* panel_layout_manager() { return panel_layout_manager_; }
-
- wm::RootWindowLayoutManager* root_window_layout_manager() {
- return root_window_layout_manager_;
- }
-
- WallpaperWidgetController* wallpaper_widget_controller() {
- return wallpaper_widget_controller_.get();
- }
- void SetWallpaperWidgetController(WallpaperWidgetController* controller);
-
- AnimatingWallpaperWidgetController* animating_wallpaper_widget_controller() {
- return animating_wallpaper_widget_controller_.get();
- }
- void SetAnimatingWallpaperWidgetController(
- AnimatingWallpaperWidgetController* controller);
-
- WorkspaceController* workspace_controller() {
- return workspace_controller_.get();
- }
-
- AlwaysOnTopController* always_on_top_controller() {
- return always_on_top_controller_.get();
- }
-
- wm::WorkspaceWindowState GetWorkspaceWindowState();
-
- // Returns the layout manager for the appropriate modal-container. If the
- // window is inside the lockscreen modal container, then the layout manager
- // for that is returned. Otherwise the layout manager for the default modal
- // container is returned.
- // If no window is specified (i.e. |window| is null), then the lockscreen
- // modal container is used if the screen is currently locked. Otherwise, the
- // default modal container is used.
- SystemModalContainerLayoutManager* GetSystemModalLayoutManager(
- WmWindow* window);
-
- bool HasShelf();
-
- WmShelf* GetShelf();
-
- // Creates the shelf for this root window and notifies observers.
- void CreateShelf();
-
- // Show shelf view if it was created hidden (before session has started).
- // TODO(jamescook): Eliminate this and handle show via Shelf.
- void ShowShelf();
-
- // Returns the system tray controller. May be null for external displays.
- SystemTray* GetSystemTray();
-
- // Returns the window associated with this WmRootWindowController.
- WmWindow* GetWindow();
-
- // Gets the WmWindow whose shell window id is |container_id|.
- WmWindow* GetContainer(int container_id);
- const WmWindow* GetContainer(int container_id) const;
-
- // Configures |init_params| prior to initializing |widget|.
- // |shell_container_id| is the id of the container to parent |widget| to.
- void ConfigureWidgetInitParamsForContainer(
- views::Widget* widget,
- int shell_container_id,
- views::Widget::InitParams* init_params);
-
- // Returns the window events will be targeted at for the specified location
- // (in screen coordinates).
- //
- // NOTE: the returned window may not contain the location as resize handles
- // may extend outside the bounds of the window.
- WmWindow* FindEventTarget(const gfx::Point& location_in_screen);
-
- // Gets the last location seen in a mouse event in this root window's
- // coordinates. This may return a point outside the root window's bounds.
- gfx::Point GetLastMouseLocationInRoot();
-
- // Shows a context menu at the |location_in_screen|.
- void ShowContextMenu(const gfx::Point& location_in_screen,
- ui::MenuSourceType source_type);
-
- // Called when the wallpaper animation has started or finished.
- // TODO: port remaining classic ash wallpaper functionality here.
- void OnInitialWallpaperAnimationStarted();
- void OnWallpaperAnimationFinished(views::Widget* widget);
-
- // Called when the login status changes after login (such as lock/unlock).
- // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
- virtual void UpdateAfterLoginStatusChange(LoginStatus status);
-
- protected:
- // Moves child windows to |dest|.
- void MoveWindowsTo(WmWindow* dest);
-
- // Creates the containers (WmWindows) used by the shell.
- void CreateContainers();
-
- // Creates the LayoutManagers for the windows created by CreateContainers().
- void CreateLayoutManagers();
-
- // Resets WmShell::GetRootWindowForNewWindows() if appropriate. This is called
- // during shutdown to make sure GetRootWindowForNewWindows() isn't referencing
- // this.
- void ResetRootForNewWindowsIfNecessary();
-
- // Called during shutdown to destroy state such as windows and LayoutManagers.
- void CloseChildWindows();
-
- private:
- friend class RootWindowController;
-
- // Called from CloseChildWindows() to determine if the specified window should
- // be destroyed.
- bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window);
-
- // Callback for MenuModelAdapter.
- void OnMenuClosed();
-
- // TODO(sky): remove this, needed until merge two classes.
- RootWindowController* root_window_controller_;
-
- WmWindow* root_;
-
- // LayoutManagers are owned by the window they are installed on.
- DockedWindowLayoutManager* docked_window_layout_manager_ = nullptr;
- PanelLayoutManager* panel_layout_manager_ = nullptr;
- wm::RootWindowLayoutManager* root_window_layout_manager_ = nullptr;
-
- std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_;
- std::unique_ptr<AnimatingWallpaperWidgetController>
- animating_wallpaper_widget_controller_;
- std::unique_ptr<WorkspaceController> workspace_controller_;
-
- std::unique_ptr<AlwaysOnTopController> always_on_top_controller_;
-
- // Manages the context menu.
- std::unique_ptr<ui::MenuModel> menu_model_;
- std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_;
- std::unique_ptr<views::MenuRunner> menu_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(WmRootWindowController);
-};
-
-} // namespace ash
-
-#endif // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index f86da79..4015512 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -46,9 +46,9 @@
#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_cycle_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
@@ -286,7 +286,7 @@
WmShell::~WmShell() {}
-WmRootWindowController* WmShell::GetPrimaryRootWindowController() {
+RootWindowController* WmShell::GetPrimaryRootWindowController() {
return GetPrimaryRootWindow()->GetRootWindowController();
}
diff --git a/ash/common/wm_shell.h b/ash/common/wm_shell.h
index 7073651..a5589c97 100644
--- a/ash/common/wm_shell.h
+++ b/ash/common/wm_shell.h
@@ -65,6 +65,7 @@
class MruWindowTracker;
class NewWindowController;
class PaletteDelegate;
+class RootWindowController;
class ScopedDisableInternalMouseAndKeyboard;
class SessionController;
class SessionStateDelegate;
@@ -88,7 +89,6 @@
class WindowSelectorController;
class WmActivationObserver;
class WmDisplayObserver;
-class WmRootWindowController;
class WmWindow;
class WorkspaceEventHandler;
@@ -225,7 +225,7 @@
virtual WmWindow* GetCaptureWindow() = 0;
// Convenience for GetPrimaryRootWindow()->GetRootWindowController().
- WmRootWindowController* GetPrimaryRootWindowController();
+ RootWindowController* GetPrimaryRootWindowController();
virtual WmWindow* GetPrimaryRootWindow() = 0;
diff --git a/ash/common/wm_window.h b/ash/common/wm_window.h
index 927863b..d9486255 100644
--- a/ash/common/wm_window.h
+++ b/ash/common/wm_window.h
@@ -42,8 +42,8 @@
namespace ash {
class ImmersiveFullscreenController;
+class RootWindowController;
class WmLayoutManager;
-class WmRootWindowController;
class WmShell;
class WmTransientWindowObserver;
class WmWindowObserver;
@@ -72,7 +72,7 @@
const_cast<const WmWindow*>(this)->GetRootWindow());
}
virtual const WmWindow* GetRootWindow() const = 0;
- virtual WmRootWindowController* GetRootWindowController() = 0;
+ virtual RootWindowController* GetRootWindowController() = 0;
// TODO(sky): fix constness.
virtual WmShell* GetShell() const = 0;
diff --git a/ash/mus/accelerators/accelerator_controller_unittest.cc b/ash/mus/accelerators/accelerator_controller_unittest.cc
index 7acdf80..c3aa7484 100644
--- a/ash/mus/accelerators/accelerator_controller_unittest.cc
+++ b/ash/mus/accelerators/accelerator_controller_unittest.cc
@@ -19,7 +19,6 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/mus/accelerators/accelerator_controller_registrar_test_api.h"
#include "ash/mus/bridge/wm_shell_mus_test_api.h"
@@ -27,6 +26,7 @@
#include "ash/mus/property_util.h"
#include "ash/mus/test/wm_test_base.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "base/command_line.h"
#include "base/test/user_action_tester.cc"
#include "services/ui/public/interfaces/window_manager.mojom.h"
diff --git a/ash/mus/bridge/wm_lookup_mus.cc b/ash/mus/bridge/wm_lookup_mus.cc
index 8f96d88..b9b0be19 100644
--- a/ash/mus/bridge/wm_lookup_mus.cc
+++ b/ash/mus/bridge/wm_lookup_mus.cc
@@ -21,12 +21,11 @@
WmLookup::Set(nullptr);
}
-WmRootWindowController* WmLookupMus::GetRootWindowControllerWithDisplayId(
+ash::RootWindowController* WmLookupMus::GetRootWindowControllerWithDisplayId(
int64_t id) {
return WmShellMus::Get()
->GetRootWindowControllerWithDisplayId(id)
- ->ash_root_window_controller()
- ->wm_root_window_controller();
+ ->ash_root_window_controller();
}
WmWindow* WmLookupMus::GetWindowForWidget(views::Widget* widget) {
diff --git a/ash/mus/bridge/wm_lookup_mus.h b/ash/mus/bridge/wm_lookup_mus.h
index 93d5ccbd..91ad320 100644
--- a/ash/mus/bridge/wm_lookup_mus.h
+++ b/ash/mus/bridge/wm_lookup_mus.h
@@ -20,7 +20,7 @@
~WmLookupMus() override;
// WmLookup:
- WmRootWindowController* GetRootWindowControllerWithDisplayId(
+ ash::RootWindowController* GetRootWindowControllerWithDisplayId(
int64_t id) override;
WmWindow* GetWindowForWidget(views::Widget* widget) override;
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index ac91f77..569c469 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -10,7 +10,6 @@
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/display/screen_position_controller.h"
#include "ash/mus/accelerators/accelerator_handler.h"
#include "ash/mus/accelerators/accelerator_ids.h"
@@ -27,6 +26,7 @@
#include "ash/mus/window_manager_observer.h"
#include "ash/mus/window_properties.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/wm/ash_focus_rules.h"
#include "ash/wm/event_client_impl.h"
@@ -230,7 +230,6 @@
// TODO: this should be called when logged in. See http://crbug.com/654606.
root_window_controller->ash_root_window_controller()
- ->wm_root_window_controller()
->CreateShelf();
for (auto& observer : observers_)
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index b8e46a33..57193be 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -29,6 +29,7 @@
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm/dock/docked_window_layout_manager.h"
#include "ash/common/wm/fullscreen_window_finder.h"
+#include "ash/common/wm/lock_layout_manager.h"
#include "ash/common/wm/panels/panel_layout_manager.h"
#include "ash/common/wm/root_window_layout_manager.h"
#include "ash/common/wm/switchable_windows.h"
@@ -36,7 +37,6 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/workspace/workspace_layout_manager.h"
#include "ash/common/wm/workspace_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/high_contrast/high_contrast_controller.h"
@@ -65,17 +65,24 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/client/screen_position_client.h"
+#include "ui/aura/mus/window_mus.h"
+#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tracker.h"
+#include "ui/base/models/menu_model.h"
#include "ui/chromeos/touch_exploration_controller.h"
#include "ui/display/types/display_constants.h"
+#include "ui/events/event_utils.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
+#include "ui/views/controls/menu/menu_model_adapter.h"
+#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/view_model.h"
#include "ui/views/view_model_utils.h"
#include "ui/wm/core/capture_controller.h"
+#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/visibility_controller.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/tooltip_client.h"
@@ -146,6 +153,8 @@
// The CaptureClient needs to be around for as long as the RootWindow is
// valid.
capture_client_.reset();
+ if (animating_wallpaper_widget_controller_.get())
+ animating_wallpaper_widget_controller_->StopAnimating();
}
void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) {
@@ -189,16 +198,12 @@
return GetHost()->window();
}
-WorkspaceController* RootWindowController::workspace_controller() {
- return wm_root_window_controller_->workspace_controller();
-}
-
void RootWindowController::Shutdown() {
WmShell::Get()->RemoveShellObserver(this);
touch_exploration_manager_.reset();
- wm_root_window_controller_->ResetRootForNewWindowsIfNecessary();
+ ResetRootForNewWindowsIfNecessary();
CloseChildWindows();
aura::Window* root_window = GetRootWindow();
@@ -281,6 +286,17 @@
// Make sure the wallpaper is visible.
system_wallpaper_->SetColor(SK_ColorBLACK);
boot_splash_screen_.reset();
+ WmShell::Get()->wallpaper_delegate()->OnWallpaperAnimationFinished();
+ // Only removes old component when wallpaper animation finished. If we
+ // remove the old one before the new wallpaper is done fading in there will
+ // be a white flash during the animation.
+ if (animating_wallpaper_widget_controller()) {
+ WallpaperWidgetController* controller =
+ animating_wallpaper_widget_controller()->GetController(true);
+ DCHECK_EQ(controller->widget(), widget);
+ // Release the old controller and close its wallpaper widget.
+ SetWallpaperWidgetController(controller);
+ }
}
void RootWindowController::CloseChildWindows() {
@@ -295,16 +311,12 @@
// down associated layout managers.
DeactivateKeyboard(keyboard::KeyboardController::GetInstance());
- wm_root_window_controller_->CloseChildWindows();
+ CloseChildWindowsImpl();
aura::client::SetDragDropClient(GetRootWindow(), nullptr);
aura::client::SetTooltipClient(GetRootWindow(), nullptr);
}
-void RootWindowController::MoveWindowsTo(aura::Window* dst) {
- wm_root_window_controller_->MoveWindowsTo(WmWindowAura::Get(dst));
-}
-
ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() {
return wm_shelf_->shelf_layout_manager();
}
@@ -342,8 +354,7 @@
keyboard_controller->AddObserver(docked_window_layout_manager());
keyboard_controller->AddObserver(workspace_controller()->layout_manager());
keyboard_controller->AddObserver(
- wm_root_window_controller_->always_on_top_controller()
- ->GetLayoutManager());
+ always_on_top_controller_->GetLayoutManager());
WmShell::Get()->NotifyVirtualKeyboardActivated(true);
aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer);
DCHECK(parent);
@@ -373,8 +384,7 @@
keyboard_controller->RemoveObserver(
workspace_controller()->layout_manager());
keyboard_controller->RemoveObserver(
- wm_root_window_controller_->always_on_top_controller()
- ->GetLayoutManager());
+ always_on_top_controller_->GetLayoutManager());
WmShell::Get()->NotifyVirtualKeyboardActivated(false);
}
}
@@ -400,17 +410,11 @@
mus_window_tree_host_(window_tree_host),
window_tree_host_(ash_host ? ash_host->AsWindowTreeHost()
: window_tree_host),
- wm_shelf_(base::MakeUnique<WmShelf>()),
- touch_hud_debug_(NULL),
- touch_hud_projection_(NULL) {
+ wm_shelf_(base::MakeUnique<WmShelf>()) {
DCHECK((ash_host && !window_tree_host) || (!ash_host && window_tree_host));
aura::Window* root_window = GetRootWindow();
GetRootWindowSettings(root_window)->controller = this;
- // Has to happen after this is set as |controller| of RootWindowSettings.
- wm_root_window_controller_ = base::MakeUnique<WmRootWindowController>(
- this, WmWindowAura::Get(root_window));
-
stacking_controller_.reset(new StackingController);
aura::client::SetWindowParentingClient(root_window,
stacking_controller_.get());
@@ -426,7 +430,7 @@
shell->InitRootWindow(root_window);
}
- wm_root_window_controller_->CreateContainers();
+ CreateContainers();
CreateSystemWallpaper(root_window_type);
@@ -436,13 +440,12 @@
if (wm_shell->GetPrimaryRootWindowController()
->GetSystemModalLayoutManager(nullptr)
->has_window_dimmer()) {
- wm_root_window_controller_->GetSystemModalLayoutManager(nullptr)
- ->CreateModalBackground();
+ GetSystemModalLayoutManager(nullptr)->CreateModalBackground();
}
wm_shell->AddShellObserver(this);
- wm_root_window_controller_->root_window_layout_manager()->OnWindowResized();
+ root_window_layout_manager_->OnWindowResized();
if (root_window_type == RootWindowType::PRIMARY) {
if (!wm_shell->IsRunningInMash())
shell->InitKeyboard();
@@ -451,7 +454,7 @@
// Create a shelf if a user is already logged in.
if (wm_shell->GetSessionStateDelegate()->NumberOfLoggedInUsers())
- wm_root_window_controller_->CreateShelf();
+ CreateShelf();
// Notify shell observers about new root window.
if (!wm_shell->IsRunningInMash())
@@ -475,7 +478,7 @@
WmWindow* wm_shelf_container = WmWindowAura::Get(shelf_container);
WmWindow* wm_status_container = WmWindowAura::Get(status_container);
- wm_root_window_controller_->CreateLayoutManagers();
+ CreateLayoutManagers();
// Make it easier to resize windows that partially overlap the shelf. Must
// occur after the ShelfLayoutManager is constructed by ShelfWidget.
@@ -549,15 +552,6 @@
touch_hud_projection_->Remove();
}
-DockedWindowLayoutManager*
-RootWindowController::docked_window_layout_manager() {
- return wm_root_window_controller_->docked_window_layout_manager();
-}
-
-PanelLayoutManager* RootWindowController::panel_layout_manager() {
- return wm_root_window_controller_->panel_layout_manager();
-}
-
void RootWindowController::OnLoginStateChanged(LoginStatus status) {
wm_shelf_->UpdateVisibilityState();
}
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index eb59b13..64e589a1 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -10,10 +10,12 @@
#include "ash/ash_export.h"
#include "ash/common/shell_observer.h"
+#include "ash/common/wm/workspace/workspace_types.h"
#include "ash/public/cpp/shelf_types.h"
#include "base/macros.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/views/widget/widget.h"
namespace aura {
class Window;
@@ -29,11 +31,13 @@
namespace ui {
class EventHandler;
+class MenuModel;
class WindowTreeHost;
}
namespace views {
-class Widget;
+class MenuModelAdapter;
+class MenuRunner;
}
namespace wm {
@@ -41,6 +45,8 @@
}
namespace ash {
+class AlwaysOnTopController;
+class AnimatingWallpaperWidgetController;
class AshTouchExplorationManager;
class AshWindowTreeHost;
class BootSplashScreen;
@@ -50,11 +56,12 @@
class ShelfLayoutManager;
class StackingController;
class StatusAreaWidget;
+class SystemModalContainerLayoutManager;
class SystemTray;
class SystemWallpaperController;
class TouchHudDebug;
class TouchHudProjection;
-class WmRootWindowController;
+class WallpaperWidgetController;
class WmShelf;
class WorkspaceController;
@@ -62,6 +69,10 @@
class RootWindowController;
}
+namespace wm {
+class RootWindowLayoutManager;
+}
+
// This class maintains the per root window state for ash. This class
// owns the root window and other dependent objects that should be
// deleted upon the deletion of the root window. This object is
@@ -90,6 +101,14 @@
// Returns the RootWindowController of the target root window.
static RootWindowController* ForTargetRootWindow();
+ // Configures |init_params| prior to initializing |widget|.
+ // |shell_container_id| is the id of the container to parent |widget| to.
+ // TODO(sky): remove this, http://crbug.com/671246.
+ void ConfigureWidgetInitParamsForContainer(
+ views::Widget* widget,
+ int shell_container_id,
+ views::Widget::InitParams* init_params);
+
// TODO(sky): move these to a separate class or use AshWindowTreeHost in
// mash. http://crbug.com/671246.
AshWindowTreeHost* ash_host() { return ash_host_.get(); }
@@ -100,13 +119,31 @@
aura::Window* GetRootWindow();
const aura::Window* GetRootWindow() const;
- WorkspaceController* workspace_controller();
+ // TODO(sky): remove these. http://crbug.com/671246.
+ WmWindow* GetWindow() {
+ return const_cast<WmWindow*>(
+ const_cast<const RootWindowController*>(this)->GetWindow());
+ }
+ const WmWindow* GetWindow() const;
+
+ WorkspaceController* workspace_controller() {
+ return workspace_controller_.get();
+ }
+
+ wm::WorkspaceWindowState GetWorkspaceWindowState();
WmShelf* wm_shelf() const { return wm_shelf_.get(); }
- WmRootWindowController* wm_root_window_controller() {
- return wm_root_window_controller_.get();
- }
+ bool HasShelf();
+
+ WmShelf* GetShelf();
+
+ // Creates the shelf for this root window and notifies observers.
+ void CreateShelf();
+
+ // Show shelf view if it was created hidden (before session has started).
+ // TODO(jamescook): Eliminate this and handle show via Shelf.
+ void ShowShelf();
// Get touch HUDs associated with this root window controller.
TouchHudDebug* touch_hud_debug() const { return touch_hud_debug_; }
@@ -123,10 +160,34 @@
touch_hud_projection_ = hud;
}
+ DockedWindowLayoutManager* docked_window_layout_manager() {
+ return docked_window_layout_manager_;
+ }
+
+ PanelLayoutManager* panel_layout_manager() { return panel_layout_manager_; }
+
+ wm::RootWindowLayoutManager* root_window_layout_manager() {
+ return root_window_layout_manager_;
+ }
+
// Access the shelf layout manager associated with this root
// window controller, NULL if no such shelf exists.
ShelfLayoutManager* GetShelfLayoutManager();
+ // Returns the layout manager for the appropriate modal-container. If the
+ // window is inside the lockscreen modal container, then the layout manager
+ // for that is returned. Otherwise the layout manager for the default modal
+ // container is returned.
+ // If no window is specified (i.e. |window| is null), then the lockscreen
+ // modal container is used if the screen is currently locked. Otherwise, the
+ // default modal container is used.
+ SystemModalContainerLayoutManager* GetSystemModalLayoutManager(
+ WmWindow* window);
+
+ AlwaysOnTopController* always_on_top_controller() {
+ return always_on_top_controller_.get();
+ }
+
// May return null, for example for a secondary monitor at the login screen.
StatusAreaWidget* GetStatusAreaWidget();
@@ -138,9 +199,39 @@
// True if the window can receive events on this root window.
bool CanWindowReceiveEvents(aura::Window* window);
+ // Returns the window events will be targeted at for the specified location
+ // (in screen coordinates).
+ //
+ // NOTE: the returned window may not contain the location as resize handles
+ // may extend outside the bounds of the window.
+ WmWindow* FindEventTarget(const gfx::Point& location_in_screen);
+
+ // Gets the last location seen in a mouse event in this root window's
+ // coordinates. This may return a point outside the root window's bounds.
+ gfx::Point GetLastMouseLocationInRoot();
+
aura::Window* GetContainer(int container_id);
const aura::Window* GetContainer(int container_id) const;
+ // TODO(sky): remove these. http://crbug.com/671246.
+ WmWindow* GetWmContainer(int container_id) {
+ return const_cast<WmWindow*>(
+ const_cast<const RootWindowController*>(this)->GetWmContainer(
+ container_id));
+ }
+ const WmWindow* GetWmContainer(int container_id) const;
+
+ WallpaperWidgetController* wallpaper_widget_controller() {
+ return wallpaper_widget_controller_.get();
+ }
+ void SetWallpaperWidgetController(WallpaperWidgetController* controller);
+
+ AnimatingWallpaperWidgetController* animating_wallpaper_widget_controller() {
+ return animating_wallpaper_widget_controller_.get();
+ }
+ void SetAnimatingWallpaperWidgetController(
+ AnimatingWallpaperWidgetController* controller);
+
// Called when the brightness/grayscale animation from white to the login
// wallpaper image has started. Starts |boot_splash_screen_|'s hiding
// animation (if the screen is non-NULL).
@@ -187,6 +278,14 @@
// controller so that synthesized touch events are anchored at this point.
void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point);
+ // Shows a context menu at the |location_in_screen|.
+ void ShowContextMenu(const gfx::Point& location_in_screen,
+ ui::MenuSourceType source_type);
+
+ // Called when the login status changes after login (such as lock/unlock).
+ // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
+ void UpdateAfterLoginStatusChange(LoginStatus status);
+
private:
// TODO(sky): remove this. Temporary during ash-mus unification.
// http://crbug.com/671246.
@@ -204,6 +303,13 @@
void InitLayoutManagers();
+ // Creates the containers (WmWindows) used by the shell.
+ void CreateContainers();
+
+ // Creates the LayoutManagers for the windows created by CreateContainers().
+ // TODO(sky): merge this with InitLayoutManagers().
+ void CreateLayoutManagers();
+
// Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|.
// The initial color is determined by the |root_window_type| and whether or
// not this is the first boot.
@@ -215,19 +321,42 @@
// Disables projection touch HUD.
void DisableTouchHudProjection();
- DockedWindowLayoutManager* docked_window_layout_manager();
- PanelLayoutManager* panel_layout_manager();
+ // Resets WmShell::GetRootWindowForNewWindows() if appropriate. This is called
+ // during shutdown to make sure GetRootWindowForNewWindows() isn't referencing
+ // this.
+ void ResetRootForNewWindowsIfNecessary();
+
+ // Callback for MenuModelAdapter.
+ void OnMenuClosed();
// Overridden from ShellObserver.
void OnLoginStateChanged(LoginStatus status) override;
void OnTouchHudProjectionToggled(bool enabled) override;
+ // TODO(sky): temporary, fold into CloseChildWindows().
+ void CloseChildWindowsImpl();
+
std::unique_ptr<AshWindowTreeHost> ash_host_;
std::unique_ptr<aura::WindowTreeHost> mus_window_tree_host_;
// This comes from |ash_host_| or |mus_window_tree_host_|.
aura::WindowTreeHost* window_tree_host_;
- std::unique_ptr<WmRootWindowController> wm_root_window_controller_;
+ // LayoutManagers are owned by the window they are installed on.
+ DockedWindowLayoutManager* docked_window_layout_manager_ = nullptr;
+ PanelLayoutManager* panel_layout_manager_ = nullptr;
+ wm::RootWindowLayoutManager* root_window_layout_manager_ = nullptr;
+
+ std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_;
+ std::unique_ptr<AnimatingWallpaperWidgetController>
+ animating_wallpaper_widget_controller_;
+ std::unique_ptr<WorkspaceController> workspace_controller_;
+
+ std::unique_ptr<AlwaysOnTopController> always_on_top_controller_;
+
+ // Manages the context menu.
+ std::unique_ptr<ui::MenuModel> menu_model_;
+ std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_;
+ std::unique_ptr<views::MenuRunner> menu_runner_;
std::unique_ptr<StackingController> stacking_controller_;
@@ -245,8 +374,8 @@
// Heads-up displays for touch events. These HUDs are not owned by the root
// window controller and manage their own lifetimes.
- TouchHudDebug* touch_hud_debug_;
- TouchHudProjection* touch_hud_projection_;
+ TouchHudDebug* touch_hud_debug_ = nullptr;
+ TouchHudProjection* touch_hud_projection_ = nullptr;
// Handles double clicks on the panel window header.
std::unique_ptr<ui::EventHandler> panel_container_handler_;
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index f204b44..fab0f26 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -13,10 +13,10 @@
#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_md_test_base.h"
#include "ash/test/ash_test_base.h"
@@ -99,6 +99,10 @@
DISALLOW_COPY_AND_ASSIGN(DeleteOnBlurDelegate);
};
+WmLayoutManager* GetLayoutManager(RootWindowController* controller, int id) {
+ return WmWindowAura::Get(controller->GetContainer(id))->GetLayoutManager();
+}
+
} // namespace
namespace test {
@@ -380,38 +384,34 @@
TEST_P(RootWindowControllerTest, ModalContainer) {
UpdateDisplay("600x600");
WmShell* wm_shell = WmShell::Get();
- WmRootWindowController* controller =
- wm_shell->GetPrimaryRootWindowController();
+ RootWindowController* controller = wm_shell->GetPrimaryRootWindowController();
EXPECT_EQ(LoginStatus::USER,
wm_shell->system_tray_delegate()->GetUserLoginStatus());
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(NULL));
views::Widget* session_modal_widget =
CreateModalWidget(gfx::Rect(300, 10, 100, 100));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(
WmLookup::Get()->GetWindowForWidget(session_modal_widget)));
wm_shell->GetSessionStateDelegate()->LockScreen();
EXPECT_EQ(LoginStatus::LOCKED,
wm_shell->system_tray_delegate()->GetUserLoginStatus());
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(NULL));
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(nullptr));
- aura::Window* lock_container = WmWindowAura::GetAuraWindow(
- controller->GetContainer(kShellWindowId_LockScreenContainer));
+ aura::Window* lock_container =
+ controller->GetContainer(kShellWindowId_LockScreenContainer);
views::Widget* lock_modal_widget =
CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container);
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(
- WmLookup::Get()->GetWindowForWidget(lock_modal_widget)));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(
+ WmLookup::Get()->GetWindowForWidget(lock_modal_widget)));
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(
WmLookup::Get()->GetWindowForWidget(session_modal_widget)));
@@ -430,20 +430,20 @@
EXPECT_EQ(0, session_state_delegate->NumberOfLoggedInUsers());
EXPECT_FALSE(session_state_delegate->IsActiveUserSessionStarted());
- WmRootWindowController* controller =
+ RootWindowController* controller =
WmShell::Get()->GetPrimaryRootWindowController();
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(NULL));
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(NULL));
- aura::Window* lock_container = WmWindowAura::GetAuraWindow(
- controller->GetContainer(kShellWindowId_LockScreenContainer));
+ aura::Window* lock_container =
+ controller->GetContainer(kShellWindowId_LockScreenContainer);
views::Widget* login_modal_widget =
CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container);
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(
- WmLookup::Get()->GetWindowForWidget(login_modal_widget)));
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(
+ WmLookup::Get()->GetWindowForWidget(login_modal_widget)));
login_modal_widget->Close();
// Configure user session environment.
@@ -453,53 +453,48 @@
WmShell::Get()->system_tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(1, session_state_delegate->NumberOfLoggedInUsers());
EXPECT_TRUE(session_state_delegate->IsActiveUserSessionStarted());
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(NULL));
views::Widget* session_modal_widget =
CreateModalWidget(gfx::Rect(300, 10, 100, 100));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(
WmLookup::Get()->GetWindowForWidget(session_modal_widget)));
}
TEST_P(RootWindowControllerTest, ModalContainerBlockedSession) {
UpdateDisplay("600x600");
- WmRootWindowController* controller =
+ RootWindowController* controller =
WmShell::Get()->GetPrimaryRootWindowController();
- aura::Window* lock_container = WmWindowAura::GetAuraWindow(
- controller->GetContainer(kShellWindowId_LockScreenContainer));
+ aura::Window* lock_container =
+ controller->GetContainer(kShellWindowId_LockScreenContainer);
for (int block_reason = FIRST_BLOCK_REASON;
block_reason < NUMBER_OF_BLOCK_REASONS; ++block_reason) {
views::Widget* session_modal_widget =
CreateModalWidget(gfx::Rect(300, 10, 100, 100));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(
WmLookup::Get()->GetWindowForWidget(session_modal_widget)));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(NULL));
session_modal_widget->Close();
BlockUserSession(static_cast<UserSessionBlockReason>(block_reason));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(NULL));
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(NULL));
views::Widget* lock_modal_widget = CreateModalWidgetWithParent(
gfx::Rect(300, 10, 100, 100), lock_container);
- EXPECT_EQ(controller->GetContainer(kShellWindowId_LockSystemModalContainer)
- ->GetLayoutManager(),
- controller->GetSystemModalLayoutManager(
- WmLookup::Get()->GetWindowForWidget(lock_modal_widget)));
+ EXPECT_EQ(
+ GetLayoutManager(controller, kShellWindowId_LockSystemModalContainer),
+ controller->GetSystemModalLayoutManager(
+ WmLookup::Get()->GetWindowForWidget(lock_modal_widget)));
session_modal_widget = CreateModalWidget(gfx::Rect(300, 10, 100, 100));
- EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer)
- ->GetLayoutManager(),
+ EXPECT_EQ(GetLayoutManager(controller, kShellWindowId_SystemModalContainer),
controller->GetSystemModalLayoutManager(
WmLookup::Get()->GetWindowForWidget(session_modal_widget)));
session_modal_widget->Close();
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 470bb20..7fcf4a1 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -27,10 +27,10 @@
#include "ash/common/test/test_shelf_item_delegate.h"
#include "ash/common/test/test_system_tray_delegate.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/ash_test_helper.h"
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index 7a59f5a..dc1430a 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -10,7 +10,6 @@
#include "ash/common/shelf/shelf_view.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/system/status_area_widget.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/root_window_controller.h"
diff --git a/ash/shell.cc b/ash/shell.cc
index 6b60772..2a5b064 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -41,7 +41,6 @@
#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_positioner.h"
#include "ash/common/wm/workspace_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/display/cursor_window_controller.h"
#include "ash/display/display_color_manager_chromeos.h"
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 6679bdd..fe929cb6 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -12,7 +12,6 @@
#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/display/mouse_cursor_event_filter.h"
diff --git a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
index 919a972..d40daa8 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
@@ -9,10 +9,10 @@
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "base/command_line.h"
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 5b1d9bc..0b1234d3 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -10,7 +10,6 @@
#include "ash/common/test/test_session_state_delegate.h"
#include "ash/common/test/test_system_tray_delegate.h"
#include "ash/common/wm/window_positioner.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/display/extended_mouse_warp_controller.h"
@@ -18,6 +17,7 @@
#include "ash/display/unified_mouse_warp_controller.h"
#include "ash/display/window_tree_host_manager.h"
#include "ash/ime/input_method_event_handler.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/shell/toplevel_window.h"
#include "ash/test/ash_test_environment.h"
diff --git a/ash/wm/always_on_top_controller_unittest.cc b/ash/wm/always_on_top_controller_unittest.cc
index 58cdcaa2..fb6e2e6 100644
--- a/ash/wm/always_on_top_controller_unittest.cc
+++ b/ash/wm/always_on_top_controller_unittest.cc
@@ -6,7 +6,6 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/wm/workspace/workspace_layout_manager.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/shell.h"
@@ -68,7 +67,7 @@
new TestLayoutManager(WmWindowAura::Get(always_on_top_container));
RootWindowController* controller = Shell::GetPrimaryRootWindowController();
AlwaysOnTopController* always_on_top_controller =
- controller->wm_root_window_controller()->always_on_top_controller();
+ controller->always_on_top_controller();
always_on_top_controller->SetLayoutManagerForTest(base::WrapUnique(manager));
// Activate keyboard. This triggers keyboard listeners to be registered.
controller->ActivateKeyboard(keyboard_controller);
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index d194ed1..6744b13 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -15,11 +15,11 @@
#include "ash/common/test/test_shelf_delegate.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/shelf_view_test_api.h"
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index d311d4ae..5c52d0a 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -9,7 +9,6 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/wm/container_finder.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 6700bf0..38cb682 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -11,8 +11,7 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
-#include "ash/common/wm_root_window_controller.h"
-#include "ash/common/wm_window.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_state_aura.h"
@@ -74,11 +73,10 @@
target->GetWidget()->GetNativeView()->GetRootWindow();
if (!target_root || target_root == window->GetRootWindow())
return false;
- WmWindow* window_container = WmWindowAura::Get(target_root)
- ->GetRootWindowController()
- ->GetContainer(window->parent()->id());
+ aura::Window* window_container = RootWindowController::ForWindow(target_root)
+ ->GetContainer(window->parent()->id());
// Move the window to the target launcher.
- window_container->AddChild(WmWindowAura::Get(window));
+ window_container->AddChild(window);
return true;
}
diff --git a/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc b/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
index 14a8d757..cf537cb 100644
--- a/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_keyboard_unittest.cc
@@ -20,10 +20,10 @@
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "base/command_line.h"
#include "ui/base/ui_base_switches.h"
@@ -58,7 +58,7 @@
AshTest::SetUp();
UpdateDisplay("800x600");
WmWindow* default_container =
- WmShell::Get()->GetPrimaryRootWindowController()->GetContainer(
+ WmShell::Get()->GetPrimaryRootWindowController()->GetWmContainer(
kShellWindowId_DefaultContainer);
layout_manager_ = GetWorkspaceLayoutManager(default_container);
}
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index 2a014a3d..08b4e76 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -22,7 +22,6 @@
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/common/wm_lookup.h"
-#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"