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

Unified Diff: ash/root_window_controller.cc

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index dde74bfe0942b6acf274acfe1c779490e324b9ae..2a45337b27ace4fb190714e61756066b9164a61b 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -27,7 +27,6 @@
#include "ash/common/wallpaper/wallpaper_widget_controller.h"
#include "ash/common/wm/always_on_top_controller.h"
#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"
@@ -171,11 +170,9 @@ void ReparentWindow(WmWindow* window, WmWindow* new_parent) {
// Update the restore bounds to make it relative to the display.
wm::WindowState* state = window->GetWindowState();
gfx::Rect restore_bounds;
- bool has_restore_bounds = state->HasRestoreBounds();
+ const bool has_restore_bounds = state->HasRestoreBounds();
- bool update_bounds =
- (state->IsNormalOrSnapped() || state->IsMinimized()) &&
- new_parent->GetShellWindowId() != kShellWindowId_DockedContainer;
+ const bool update_bounds = state->IsNormalOrSnapped() || state->IsMinimized();
gfx::Rect work_area_in_new_parent =
wm::GetDisplayWorkAreaBoundsInParent(new_parent);
@@ -208,7 +205,6 @@ void ReparentAllWindows(WmWindow* src, WmWindow* dst) {
// Set of windows to move.
const int kContainerIdsToMove[] = {
kShellWindowId_DefaultContainer,
- kShellWindowId_DockedContainer,
kShellWindowId_PanelContainer,
kShellWindowId_AlwaysOnTopContainer,
kShellWindowId_SystemModalContainer,
@@ -376,12 +372,6 @@ void RootWindowController::CreateShelfView() {
// managers.
if (panel_layout_manager_)
panel_layout_manager_->SetShelf(wm_shelf_.get());
- if (docked_window_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
@@ -572,13 +562,6 @@ void RootWindowController::Shutdown() {
void RootWindowController::CloseChildWindows() {
// NOTE: this may be called multiple times.
- // Remove observer as deactivating keyboard causes
- // docked_window_layout_manager() to fire notifications.
- if (docked_window_layout_manager() && wm_shelf_->shelf_layout_manager()) {
- docked_window_layout_manager()->RemoveObserver(
- wm_shelf_->shelf_layout_manager());
- }
-
// Deactivate keyboard container before closing child windows and shutting
// down associated layout managers.
DeactivateKeyboard(keyboard::KeyboardController::GetInstance());
@@ -589,13 +572,6 @@ void RootWindowController::CloseChildWindows() {
panel_layout_manager_ = nullptr;
}
- // |docked_window_layout_manager_| needs to be shut down before windows are
- // destroyed.
- if (docked_window_layout_manager_) {
- docked_window_layout_manager_->Shutdown();
- docked_window_layout_manager_ = nullptr;
- }
-
WmShelf* shelf = GetShelf();
shelf->ShutdownShelfWidget();
@@ -675,7 +651,6 @@ void RootWindowController::ActivateKeyboard(
DCHECK(keyboard_controller);
keyboard_controller->AddObserver(wm_shelf_->shelf_layout_manager());
keyboard_controller->AddObserver(panel_layout_manager());
- keyboard_controller->AddObserver(docked_window_layout_manager());
keyboard_controller->AddObserver(workspace_controller()->layout_manager());
keyboard_controller->AddObserver(
always_on_top_controller_->GetLayoutManager());
@@ -705,7 +680,6 @@ void RootWindowController::DeactivateKeyboard(
parent->RemoveChild(keyboard_container);
keyboard_controller->RemoveObserver(wm_shelf_->shelf_layout_manager());
keyboard_controller->RemoveObserver(panel_layout_manager());
- keyboard_controller->RemoveObserver(docked_window_layout_manager());
keyboard_controller->RemoveObserver(
workspace_controller()->layout_manager());
keyboard_controller->RemoveObserver(
@@ -866,13 +840,6 @@ void RootWindowController::InitLayoutManagers() {
always_on_top_controller_ =
base::MakeUnique<AlwaysOnTopController>(always_on_top_container);
- // Create Docked windows layout manager
- 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* wm_panel_container = GetWmContainer(kShellWindowId_PanelContainer);
panel_layout_manager_ = new PanelLayoutManager(wm_panel_container);
@@ -962,15 +929,6 @@ void RootWindowController::CreateContainers() {
always_on_top_container->SetBoundsInScreenBehaviorForChildren(
WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
- WmWindow* docked_container =
- CreateContainer(kShellWindowId_DockedContainer, "DockedContainer",
- non_lock_screen_containers);
- docked_container->SetChildWindowVisibilityChangesAnimated();
- docked_container->SetSnapsChildrenToPhysicalPixelBoundary();
- docked_container->SetBoundsInScreenBehaviorForChildren(
- WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES);
- docked_container->SetChildrenUseExtendedHitRegion();
-
WmWindow* shelf_container =
CreateContainer(kShellWindowId_ShelfContainer, "ShelfContainer",
non_lock_screen_containers);

Powered by Google App Engine
This is Rietveld 408576698