summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-05 20:05:05 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-05 20:05:05 +0000
commitd8a2495464eed0b6071dfa08b84ad0899b2b56b3 (patch)
tree8faaf3b9e985d1f02b3e051fa9cecb87acbd8b07
parentce729f8e6b9887cc0e1d8947ba5284ad0f4e4863 (diff)
downloadchromium_src-d8a2495464eed0b6071dfa08b84ad0899b2b56b3.zip
chromium_src-d8a2495464eed0b6071dfa08b84ad0899b2b56b3.tar.gz
chromium_src-d8a2495464eed0b6071dfa08b84ad0899b2b56b3.tar.bz2
Retires WorkspaceContainer.
Now DefaultContainer holds the normal windows. BUG=264396 R=sky@chromium.org TEST=ash_unittests still passes Review URL: https://chromiumcodereview.appspot.com/21806009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215664 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/display/screen_position_controller.cc3
-rw-r--r--ash/root_window_controller.cc35
-rw-r--r--ash/root_window_controller.h3
-rw-r--r--ash/shelf/shelf_layout_manager.cc2
-rw-r--r--ash/shell_window_ids.h40
-rw-r--r--ash/wm/activation_controller.cc24
-rw-r--r--ash/wm/always_on_top_controller.cc3
-rw-r--r--ash/wm/ash_focus_rules.cc21
-rw-r--r--ash/wm/dock/docked_window_layout_manager_unittest.cc7
-rw-r--r--ash/wm/dock/docked_window_resizer_unittest.cc89
-rw-r--r--ash/wm/frame_painter.cc40
-rw-r--r--ash/wm/gestures/shelf_gesture_handler.cc2
-rw-r--r--ash/wm/mru_window_tracker.cc52
-rw-r--r--ash/wm/mru_window_tracker.h1
-rw-r--r--ash/wm/panels/panel_window_resizer_unittest.cc16
-rw-r--r--ash/wm/workspace/workspace_window_resizer.cc13
-rw-r--r--ash/wm/workspace_controller.cc68
-rw-r--r--ash/wm/workspace_controller.h4
-rw-r--r--ash/wm/workspace_controller_unittest.cc7
19 files changed, 129 insertions, 301 deletions
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc
index c863333..03033b4 100644
--- a/ash/display/screen_position_controller.cc
+++ b/ash/display/screen_position_controller.cc
@@ -11,7 +11,6 @@
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/system_modal_container_layout_manager.h"
#include "ash/wm/window_properties.h"
-#include "ash/wm/workspace_controller.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/focus_client.h"
@@ -174,7 +173,7 @@ void ScreenPositionController::SetBounds(aura::Window* window,
// Dragging a docked window to another root window should show it floating
// rather than docked in another screen's dock.
if (container_id == kShellWindowId_DockedContainer)
- container_id = kShellWindowId_WorkspaceContainer;
+ container_id = kShellWindowId_DefaultContainer;
// All containers that uses screen coordinates must have valid window ids.
DCHECK_GE(container_id, 0);
// Don't move modal background.
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 578fdec..33e6873 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -81,26 +81,6 @@ aura::Window* CreateContainer(int window_id,
return container;
}
-// Returns all the children of the workspace windows, eg the standard top-level
-// windows.
-std::vector<aura::Window*> GetWorkspaceWindows(aura::RootWindow* root) {
- using aura::Window;
-
- std::vector<Window*> windows;
- Window* container = Shell::GetContainer(
- root, internal::kShellWindowId_DefaultContainer);
- for (Window::Windows::const_reverse_iterator i =
- container->children().rbegin();
- i != container->children().rend(); ++i) {
- Window* workspace_window = *i;
- if (workspace_window->id() == internal::kShellWindowId_WorkspaceContainer) {
- windows.insert(windows.end(), workspace_window->children().begin(),
- workspace_window->children().end());
- }
- }
- return windows;
-}
-
// Reparents |window| to |new_parent|.
void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
// Update the restore bounds to make it relative to the display.
@@ -114,7 +94,6 @@ void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
void ReparentAllWindows(aura::RootWindow* src, aura::RootWindow* dst) {
// Set of windows to move.
const int kContainerIdsToMove[] = {
- internal::kShellWindowId_WorkspaceContainer,
internal::kShellWindowId_DefaultContainer,
internal::kShellWindowId_DockedContainer,
internal::kShellWindowId_PanelContainer,
@@ -124,14 +103,8 @@ void ReparentAllWindows(aura::RootWindow* src, aura::RootWindow* dst) {
internal::kShellWindowId_InputMethodContainer,
internal::kShellWindowId_UnparentedControlContainer,
};
- // For workspace windows we need to manually reparent the windows. This way
- // workspace can move the windows to the appropriate workspace.
- std::vector<aura::Window*> windows(GetWorkspaceWindows(src));
for (size_t i = 0; i < arraysize(kContainerIdsToMove); i++) {
int id = kContainerIdsToMove[i];
- if (id == internal::kShellWindowId_DefaultContainer)
- continue;
-
aura::Window* src_container = Shell::GetContainer(src, id);
aura::Window* dst_container = Shell::GetContainer(dst, id);
while (!src_container->children().empty()) {
@@ -265,6 +238,10 @@ aura::Window* RootWindowController::GetContainer(int container_id) {
return root_window_->GetChildById(container_id);
}
+const aura::Window* RootWindowController::GetContainer(int container_id) const {
+ return root_window_->GetChildById(container_id);
+}
+
void RootWindowController::Init(bool first_run_after_boot) {
root_window_->SetCursor(ui::kCursorPointer);
CreateContainersInRootWindow(root_window_.get());
@@ -422,8 +399,8 @@ void RootWindowController::UpdateShelfVisibility() {
shelf_->shelf_layout_manager()->UpdateVisibilityState();
}
-aura::Window* RootWindowController::GetFullscreenWindow() const {
- aura::Window* container = workspace_controller_->GetActiveWorkspaceWindow();
+const aura::Window* RootWindowController::GetFullscreenWindow() const {
+ const aura::Window* container = GetContainer(kShellWindowId_DefaultContainer);
for (size_t i = 0; i < container->children().size(); ++i) {
aura::Window* child = container->children()[i];
if (wm::IsWindowFullscreen(child))
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index 920c553..05ab29f 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -157,6 +157,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
aura::Window* window);
aura::Window* GetContainer(int container_id);
+ const aura::Window* GetContainer(int container_id) const;
// Initializes the RootWindowController. |first_run_after_boot| is
// set to true only for primary root window after boot.
@@ -204,7 +205,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
// Returns the window, if any, which is in fullscreen mode in the active
// workspace. Exposed here so clients of Ash don't need to know the details
// of workspace management.
- aura::Window* GetFullscreenWindow() const;
+ const aura::Window* GetFullscreenWindow() const;
private:
void InitLayoutManagers();
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 17ef7e4..4283fd2 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -522,7 +522,7 @@ bool ShelfLayoutManager::FullscreenWithMinimalChrome() const {
RootWindowController* controller = GetRootWindowController(root_window_);
if (!controller)
return false;
- aura::Window* window = controller->GetFullscreenWindow();
+ const aura::Window* window = controller->GetFullscreenWindow();
if (!window)
return false;
if (!window->GetProperty(kFullscreenUsesMinimalChromeKey))
diff --git a/ash/shell_window_ids.h b/ash/shell_window_ids.h
index 046f43a..406f417 100644
--- a/ash/shell_window_ids.h
+++ b/ash/shell_window_ids.h
@@ -39,68 +39,62 @@ const int kShellWindowId_DesktopBackgroundContainer = 4;
// TODO(sky): rename kShellWindowId_DefaultContainer.
// The container for standard top-level windows.
-// WARNING: the only children of kShellWindowId_DefaultContainer are
-// kShellWindowId_WorkspaceContainer.
const int kShellWindowId_DefaultContainer = 5;
-// Used by Worskpace2 for each workspace. Contains standard top-level windows.
-// WARNING: there may be more than one container with this id.
-const int kShellWindowId_WorkspaceContainer = 6;
-
// The container for top-level windows with the 'always-on-top' flag set.
-const int kShellWindowId_AlwaysOnTopContainer = 7;
+const int kShellWindowId_AlwaysOnTopContainer = 6;
// The container for windows docked to either side of the desktop.
-const int kShellWindowId_DockedContainer = 8;
+const int kShellWindowId_DockedContainer = 7;
// The container for panel windows.
-const int kShellWindowId_PanelContainer = 9;
+const int kShellWindowId_PanelContainer = 8;
// The container for the shelf.
-const int kShellWindowId_ShelfContainer = 10;
+const int kShellWindowId_ShelfContainer = 9;
// The container for the app list.
-const int kShellWindowId_AppListContainer = 11;
+const int kShellWindowId_AppListContainer = 10;
// The container for user-specific modal windows.
-const int kShellWindowId_SystemModalContainer = 12;
+const int kShellWindowId_SystemModalContainer = 11;
// The container for input method components such like candidate windows. They
// are almost panels but have no activations/focus, and they should appear over
// the AppList and SystemModal dialogs.
-const int kShellWindowId_InputMethodContainer = 13;
+const int kShellWindowId_InputMethodContainer = 12;
// The container for the lock screen background.
-const int kShellWindowId_LockScreenBackgroundContainer = 14;
+const int kShellWindowId_LockScreenBackgroundContainer = 13;
// The container for the lock screen.
-const int kShellWindowId_LockScreenContainer = 15;
+const int kShellWindowId_LockScreenContainer = 14;
// The container for the lock screen modal windows.
-const int kShellWindowId_LockSystemModalContainer = 16;
+const int kShellWindowId_LockSystemModalContainer = 15;
// The container for the status area.
-const int kShellWindowId_StatusContainer = 17;
+const int kShellWindowId_StatusContainer = 16;
// The container for menus.
-const int kShellWindowId_MenuContainer = 18;
+const int kShellWindowId_MenuContainer = 17;
// The container for drag/drop images and tooltips.
-const int kShellWindowId_DragImageAndTooltipContainer = 19;
+const int kShellWindowId_DragImageAndTooltipContainer = 18;
// The container for bubbles briefly overlaid onscreen to show settings changes
// (volume, brightness, etc.).
-const int kShellWindowId_SettingBubbleContainer = 20;
+const int kShellWindowId_SettingBubbleContainer = 19;
// The container for special components overlaid onscreen, such as the
// region selector for partial screenshots.
-const int kShellWindowId_OverlayContainer = 21;
+const int kShellWindowId_OverlayContainer = 20;
// ID of the window created by PhantomWindowController or DragWindowController.
-const int kShellWindowId_PhantomWindow = 22;
+const int kShellWindowId_PhantomWindow = 21;
// The topmost container, used for power off animation.
-const int kShellWindowId_PowerButtonAnimationContainer = 23;
+const int kShellWindowId_PowerButtonAnimationContainer = 22;
} // namespace internal
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 885ad6c..328c34c 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -10,7 +10,6 @@
#include "ash/wm/activation_controller_delegate.h"
#include "ash/wm/property_util.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace_controller.h"
#include "base/auto_reset.h"
#include "ui/aura/client/activation_change_observer.h"
#include "ui/aura/client/activation_delegate.h"
@@ -60,14 +59,9 @@ bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window,
// Returns true if children of |window| can be activated.
// These are the only containers in which windows can receive focus.
bool SupportsChildActivation(aura::Window* window) {
- if (window->id() == kShellWindowId_WorkspaceContainer)
- return true;
-
for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) {
- if (window->id() == kWindowContainerIds[i] &&
- window->id() != kShellWindowId_DefaultContainer) {
+ if (window->id() == kWindowContainerIds[i])
return true;
- }
}
return false;
}
@@ -99,7 +93,7 @@ bool VisibilityMatches(aura::Window* window, ActivateVisibilityType type) {
window->TargetVisibility();
return visible || wm::IsWindowMinimized(window) ||
(window->TargetVisibility() &&
- (window->parent()->id() == kShellWindowId_WorkspaceContainer ||
+ (window->parent()->id() == kShellWindowId_DefaultContainer ||
window->parent()->id() == kShellWindowId_LockScreenContainer));
}
@@ -394,20 +388,6 @@ aura::Window* ActivationController::GetTopmostWindowToActivate(
aura::Window* ActivationController::GetTopmostWindowToActivateInContainer(
aura::Window* container,
aura::Window* ignore) const {
- // Workspace has an extra level of windows that needs to be special cased.
- if (container->id() == kShellWindowId_DefaultContainer) {
- for (aura::Window::Windows::const_reverse_iterator i =
- container->children().rbegin();
- i != container->children().rend(); ++i) {
- if ((*i)->IsVisible()) {
- aura::Window* window = GetTopmostWindowToActivateInContainer(
- *i, ignore);
- if (window)
- return window;
- }
- }
- return NULL;
- }
for (aura::Window::Windows::const_reverse_iterator i =
container->children().rbegin();
i != container->children().rend();
diff --git a/ash/wm/always_on_top_controller.cc b/ash/wm/always_on_top_controller.cc
index d5fa71c..f937e88 100644
--- a/ash/wm/always_on_top_controller.cc
+++ b/ash/wm/always_on_top_controller.cc
@@ -7,7 +7,6 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/property_util.h"
-#include "ash/wm/workspace_controller.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
@@ -40,7 +39,7 @@ aura::Window* AlwaysOnTopController::GetContainer(aura::Window* window) const {
if (window->GetProperty(aura::client::kAlwaysOnTopKey))
return always_on_top_container_;
return Shell::GetContainer(always_on_top_container_->GetRootWindow(),
- kShellWindowId_WorkspaceContainer);
+ kShellWindowId_DefaultContainer);
}
void AlwaysOnTopController::OnWindowAdded(aura::Window* child) {
diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc
index d24a1f9..0b5aa33 100644
--- a/ash/wm/ash_focus_rules.cc
+++ b/ash/wm/ash_focus_rules.cc
@@ -57,11 +57,8 @@ AshFocusRules::~AshFocusRules() {
// AshFocusRules, views::corewm::FocusRules:
bool AshFocusRules::SupportsChildActivation(aura::Window* window) const {
- if (window->id() == internal::kShellWindowId_WorkspaceContainer)
- return true;
-
if (window->id() == internal::kShellWindowId_DefaultContainer)
- return false;
+ return true;
for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) {
if (window->id() == kWindowContainerIds[i])
@@ -81,7 +78,7 @@ bool AshFocusRules::IsWindowConsideredVisibleForActivation(
return true;
return window->TargetVisibility() && (window->parent()->id() ==
- internal::kShellWindowId_WorkspaceContainer || window->parent()->id() ==
+ internal::kShellWindowId_DefaultContainer || window->parent()->id() ==
internal::kShellWindowId_LockScreenContainer);
}
@@ -153,20 +150,6 @@ aura::Window* AshFocusRules::GetTopmostWindowToActivateForContainerIndex(
aura::Window* AshFocusRules::GetTopmostWindowToActivateInContainer(
aura::Window* container,
aura::Window* ignore) const {
- // Workspace has an extra level of windows that needs to be special cased.
- if (container->id() == internal::kShellWindowId_DefaultContainer) {
- for (aura::Window::Windows::const_reverse_iterator i =
- container->children().rbegin();
- i != container->children().rend(); ++i) {
- if ((*i)->IsVisible()) {
- aura::Window* window =
- GetTopmostWindowToActivateInContainer(*i, ignore);
- if (window)
- return window;
- }
- }
- return NULL;
- }
for (aura::Window::Windows::const_reverse_iterator i =
container->children().rbegin();
i != container->children().rend();
diff --git a/ash/wm/dock/docked_window_layout_manager_unittest.cc b/ash/wm/dock/docked_window_layout_manager_unittest.cc
index f3e6647..cf7b476 100644
--- a/ash/wm/dock/docked_window_layout_manager_unittest.cc
+++ b/ash/wm/dock/docked_window_layout_manager_unittest.cc
@@ -134,13 +134,14 @@ class DockedWindowLayoutManagerTest
// Panels are parented by panel container during drags.
// Docked windows are parented by dock container during drags.
- // All other windows that we are testing here have workspace as a parent.
+ // All other windows that we are testing here have default container as a
+ // parent.
int CorrectContainerIdDuringDrag(DockedState is_docked) {
if (window_type_ == aura::client::WINDOW_TYPE_PANEL)
return internal::kShellWindowId_PanelContainer;
if (is_docked == DOCKED)
return internal::kShellWindowId_DockedContainer;
- return internal::kShellWindowId_WorkspaceContainer;
+ return internal::kShellWindowId_DefaultContainer;
}
// Test dragging the window vertically (to detach if it is a panel) and then
@@ -193,7 +194,7 @@ class DockedWindowLayoutManagerTest
DragEnd();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
EXPECT_EQ(root_window, window->GetRootWindow());
}
diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc
index 0660b8f..606e6f4 100644
--- a/ash/wm/dock/docked_window_resizer_unittest.cc
+++ b/ash/wm/dock/docked_window_resizer_unittest.cc
@@ -146,13 +146,14 @@ class DockedWindowResizerTest
// Panels are parented by panel container during drags.
// Docked windows are parented by dock container during drags.
- // All other windows that we are testing here have workspace as a parent.
+ // All other windows that we are testing here have default container as a
+ // parent.
int CorrectContainerIdDuringDrag(DockedState is_docked) {
if (window_type_ == aura::client::WINDOW_TYPE_PANEL)
return internal::kShellWindowId_PanelContainer;
if (is_docked == DOCKED)
return internal::kShellWindowId_DockedContainer;
- return internal::kShellWindowId_WorkspaceContainer;
+ return internal::kShellWindowId_DefaultContainer;
}
// Test dragging the window vertically (to detach if it is a panel) and then
@@ -205,7 +206,7 @@ class DockedWindowResizerTest
DragEnd();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
EXPECT_EQ(root_window, window->GetRootWindow());
}
@@ -275,7 +276,7 @@ TEST_P(DockedWindowResizerTest, AttachRightOvershoot) {
}
// Verifies a window can be dragged and then if not quite reaching the screen
-// edge it does not get docked to a screen edge and stays in the workspace.
+// edge it does not get docked to a screen edge and stays in the desktop.
TEST_P(DockedWindowResizerTest, AttachRightUndershoot) {
if (!SupportsHostWindowResize())
return;
@@ -286,7 +287,7 @@ TEST_P(DockedWindowResizerTest, AttachRightUndershoot) {
// The window should not be attached to the dock.
EXPECT_EQ(window->GetRootWindow()->bounds().right() - 1,
window->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -320,7 +321,7 @@ TEST_P(DockedWindowResizerTest, AttachLeftOvershoot) {
}
// Verifies a window can be dragged and then if not quite reaching the screen
-// edge it does not get docked to a screen edge and stays in the workspace.
+// edge it does not get docked to a screen edge and stays in the desktop.
TEST_P(DockedWindowResizerTest, AttachLeftUndershoot) {
if (!SupportsHostWindowResize())
return;
@@ -331,7 +332,7 @@ TEST_P(DockedWindowResizerTest, AttachLeftUndershoot) {
// The window should not be attached to the dock.
EXPECT_EQ(window->GetRootWindow()->bounds().x() + 1,
window->GetBoundsInScreen().x());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -405,10 +406,10 @@ TEST_P(DockedWindowResizerTest, AttachTryDetach) {
// Release the mouse and the window should be no longer attached to the dock.
DragEnd();
- // The window should be floating on a workspace again.
+ // The window should be floating on the desktop again.
EXPECT_EQ(window->GetRootWindow()->bounds().right() - 32,
window->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -467,10 +468,10 @@ TEST_P(DockedWindowResizerTest, AttachTwoWindows)
w1->GetBoundsInScreen().right());
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
- // The second window should be floating on a workspace again.
+ // The second window should be floating on the desktop again.
EXPECT_EQ(w2->GetRootWindow()->bounds().right() - 32,
w2->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
w2->parent()->id());
}
@@ -493,7 +494,7 @@ TEST_P(DockedWindowResizerTest, AttachOnTwoSides)
// The second window should be near the left edge but not snapped.
EXPECT_EQ(w2->GetRootWindow()->bounds().x(), w2->GetBoundsInScreen().x());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
}
// Reverting drag
@@ -519,7 +520,7 @@ TEST_P(DockedWindowResizerTest, RevertDragRestoresAttachment) {
ASSERT_NO_FATAL_FAILURE(DragStart(window.get()));
DragMove(-50, 0);
DragEnd();
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -548,7 +549,7 @@ TEST_P(DockedWindowResizerTest, DragAcrossDisplays) {
DragEnd();
EXPECT_NE(window->GetRootWindow()->bounds().right(),
window->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
EXPECT_EQ(root_windows[0], window->GetRootWindow());
@@ -575,7 +576,7 @@ TEST_P(DockedWindowResizerTest, DragAcrossDisplays) {
DragEnd();
EXPECT_NE(window->GetRootWindow()->bounds().right(),
window->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
EXPECT_EQ(root_windows[1], window->GetRootWindow());
@@ -597,7 +598,7 @@ TEST_P(DockedWindowResizerTest, DragAcrossDisplays) {
}
// Dock two windows, undock one.
-// Test the docked windows area size and workspace resizing.
+// Test the docked windows area size and default container resizing.
TEST_P(DockedWindowResizerTest, AttachTwoWindowsDetachOne)
{
if (!SupportsHostWindowResize())
@@ -659,18 +660,18 @@ TEST_P(DockedWindowResizerTest, AttachTwoWindowsDetachOne)
// Release the mouse and the window should be no longer attached to the edge.
DragEnd();
- // The second window should be floating on a workspace again.
+ // The second window should be floating on the desktop again.
EXPECT_EQ(w2->GetRootWindow()->bounds().right() -
(w2->bounds().width()/2 + 20),
w2->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Dock width should be set to remaining single docked window.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
EXPECT_EQ(DOCKED_ALIGNMENT_RIGHT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
}
-// Dock one windows. Maximize other testing workspace resizing.
+// Dock one windows. Maximize other testing desktop resizing.
TEST_P(DockedWindowResizerTest, AttachWindowMaximizeOther)
{
if (!SupportsHostWindowResize())
@@ -701,16 +702,16 @@ TEST_P(DockedWindowResizerTest, AttachWindowMaximizeOther)
w1->GetBoundsInScreen().right());
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
- // The second window should be floating on a workspace.
+ // The second window should be floating on the desktop.
EXPECT_EQ(w2->GetRootWindow()->bounds().right() -
(w2->bounds().width()/2 + 20),
w2->GetBoundsInScreen().right());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Dock width should be set to remaining single docked window.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
EXPECT_EQ(DOCKED_ALIGNMENT_RIGHT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // Workspace work area should now shrink.
+ // Desktop work area should now shrink.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
@@ -732,9 +733,9 @@ TEST_P(DockedWindowResizerTest, AttachWindowMaximizeOther)
manager->alignment_);
// Release the mouse and the window should be no longer attached to the edge.
DragEnd();
- // Dock should get shrunk and workspace should get expanded.
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w1->parent()->id());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ // Dock should get shrunk and desktop should get expanded.
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w1->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
EXPECT_EQ(DOCKED_ALIGNMENT_NONE, manager->alignment_);
EXPECT_EQ(0, manager->docked_width_);
// The second window should now get resized and take up the whole screen.
@@ -749,12 +750,12 @@ TEST_P(DockedWindowResizerTest, AttachWindowMaximizeOther)
EXPECT_EQ(DOCKED_ALIGNMENT_NONE, manager->alignment_);
// Release the mouse and the window should be now attached to the edge.
DragEnd();
- // Dock should get expanded and workspace should get shrunk.
+ // Dock should get expanded and desktop should get shrunk.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // Second window should still be in a workspace.
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ // Second window should still be in the desktop.
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Maximized window should be shrunk.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
@@ -766,7 +767,7 @@ TEST_P(DockedWindowResizerTest, AttachWindowMaximizeOther)
EXPECT_EQ(restored_bounds, w2->bounds());
}
-// Dock one window. Test the sticky behavior near screen or workspace edge.
+// Dock one window. Test the sticky behavior near screen or desktop edge.
TEST_P(DockedWindowResizerTest, AttachOneTestSticky)
{
if (!SupportsHostWindowResize())
@@ -793,15 +794,15 @@ TEST_P(DockedWindowResizerTest, AttachOneTestSticky)
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // Position second window in the workspace just to the right of the docked w1.
+ // Position second window in the desktop just to the right of the docked w1.
DragToVerticalPositionRelativeToEdge(DOCKED_EDGE_LEFT,
w2.get(),
w1->bounds().right() + 20,
50);
- // The second window should be floating on a workspace.
+ // The second window should be floating on the desktop.
EXPECT_EQ(w2->GetRootWindow()->bounds().x() + (w1->bounds().right() + 20),
w2->GetBoundsInScreen().x());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Dock width should be set to that of a single docked window.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
@@ -817,9 +818,9 @@ TEST_P(DockedWindowResizerTest, AttachOneTestSticky)
// Dock should still have only one window in it.
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // The second window should still be in the workspace.
+ // The second window should still be in the desktop.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Drag w2 by a bit more - it should resist the drag (stuck edges)
int start_x = w2->bounds().x();
@@ -836,9 +837,9 @@ TEST_P(DockedWindowResizerTest, AttachOneTestSticky)
// Dock should still have only one window in it
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // The second window should still be in the workspace
+ // The second window should still be in the desktop
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Drag w2 by more than the stuck threshold and drop it into the dock.
ASSERT_NO_FATAL_FAILURE(DragStart(w2.get()));
@@ -852,18 +853,18 @@ TEST_P(DockedWindowResizerTest, AttachOneTestSticky)
// Both windows are docked now.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w2->parent()->id());
- // Dock should get expanded and workspace should get shrunk.
+ // Dock should get expanded and desktop should get shrunk.
EXPECT_EQ(DOCKED_ALIGNMENT_LEFT, manager->alignment_);
EXPECT_EQ(std::max(w1->bounds().width(), w2->bounds().width()),
manager->docked_width_);
- // Workspace work area should now shrink by dock width.
+ // Desktop work area should now shrink by dock width.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
}
// Dock two windows, resize one or both.
-// Test the docked windows area size and remaining workspace resizing.
+// Test the docked windows area size and remaining desktop resizing.
TEST_P(DockedWindowResizerTest, ResizeTwoWindows)
{
if (!SupportsHostWindowResize())
@@ -917,7 +918,7 @@ TEST_P(DockedWindowResizerTest, ResizeTwoWindows)
EXPECT_EQ(previous_width + kResizeSpan1, w1->bounds().width());
EXPECT_GT(w1->bounds().width(), w2->bounds().width());
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // Workspace work area should shrink.
+ // Desktop work area should shrink.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
@@ -944,7 +945,7 @@ TEST_P(DockedWindowResizerTest, ResizeTwoWindows)
EXPECT_EQ(previous_width + kResizeSpan2, w1->bounds().width());
EXPECT_GT(w1->bounds().width(), w2->bounds().width());
EXPECT_EQ(w2->bounds().width(), manager->docked_width_);
- // Workspace work area should shrink.
+ // Desktop work area should shrink.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
@@ -969,7 +970,7 @@ TEST_P(DockedWindowResizerTest, ResizeTwoWindows)
EXPECT_EQ(previous_width - kResizeSpan3, w1->bounds().width());
EXPECT_GT(w1->bounds().width(), w2->bounds().width());
EXPECT_EQ(w1->bounds().width(), manager->docked_width_);
- // Workspace work area should shrink.
+ // Desktop work area should shrink.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
@@ -995,13 +996,13 @@ TEST_P(DockedWindowResizerTest, ResizeTwoWindows)
EXPECT_EQ(DOCKED_ALIGNMENT_RIGHT, manager->alignment_);
// Release the mouse and the window should be no longer attached to the edge.
DragEnd();
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer, w2->parent()->id());
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id());
// Dock should get shrunk to minimum size.
EXPECT_EQ(DOCKED_ALIGNMENT_RIGHT, manager->alignment_);
EXPECT_EQ(manager->kMinDockWidth, manager->docked_width_);
// The first window should be still docked.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id());
- // Workspace work area should be inset.
+ // Desktop work area should be inset.
EXPECT_EQ(ScreenAsh::GetDisplayBoundsInParent(w2.get()).width() -
manager->docked_width_ - DockedWindowLayoutManager::kMinDockGap,
ScreenAsh::GetDisplayWorkAreaBoundsInParent(w2.get()).width());
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc
index 6450278..c39d3f5 100644
--- a/ash/wm/frame_painter.cc
+++ b/ash/wm/frame_painter.cc
@@ -13,7 +13,6 @@
#include "ash/wm/property_util.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace_controller.h"
#include "base/logging.h" // DCHECK
#include "grit/ash_resources.h"
#include "third_party/skia/include/core/SkCanvas.h"
@@ -184,24 +183,21 @@ std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) {
std::vector<Window*> windows;
// During shutdown there may not be a workspace controller. In that case
// we don't care about updating any windows.
- ash::internal::WorkspaceController* workspace_controller =
- ash::GetRootWindowController(root_window)->workspace_controller();
- if (workspace_controller) {
- // Avoid memory allocations for typical window counts.
- windows.reserve(16);
- // Collect windows from the active workspace.
- Window* workspace = workspace_controller->GetActiveWorkspaceWindow();
- windows.insert(windows.end(),
- workspace->children().begin(),
- workspace->children().end());
- // Collect "always on top" windows.
- Window* top_container =
- ash::Shell::GetContainer(
- root_window, ash::internal::kShellWindowId_AlwaysOnTopContainer);
- windows.insert(windows.end(),
- top_container->children().begin(),
- top_container->children().end());
- }
+ // Avoid memory allocations for typical window counts.
+ windows.reserve(16);
+ // Collect windows from the desktop.
+ Window* desktop = ash::Shell::GetContainer(
+ root_window, ash::internal::kShellWindowId_DefaultContainer);
+ windows.insert(windows.end(),
+ desktop->children().begin(),
+ desktop->children().end());
+ // Collect "always on top" windows.
+ Window* top_container =
+ ash::Shell::GetContainer(
+ root_window, ash::internal::kShellWindowId_AlwaysOnTopContainer);
+ windows.insert(windows.end(),
+ top_container->children().begin(),
+ top_container->children().end());
return windows;
}
} // namespace
@@ -291,7 +287,7 @@ void FramePainter::Init(views::Widget* frame,
window_->AddObserver(this);
// Solo-window header updates are handled by the workspace controller when
- // this window is added to the active workspace.
+ // this window is added to the desktop.
}
// static
@@ -899,8 +895,8 @@ void FramePainter::UpdateSoloWindowInRoot(RootWindow* root,
if (old_solo_header == new_solo_header)
return;
root->SetProperty(internal::kSoloWindowHeaderKey, new_solo_header);
- // Invalidate all the window frames in the active workspace. There should
- // only be a few.
+ // Invalidate all the window frames in the desktop. There should only be
+ // a few.
std::vector<Window*> windows = GetWindowsForSoloHeaderUpdate(root);
for (std::vector<Window*>::const_iterator it = windows.begin();
it != windows.end();
diff --git a/ash/wm/gestures/shelf_gesture_handler.cc b/ash/wm/gestures/shelf_gesture_handler.cc
index 2d3e9b9..5b99363 100644
--- a/ash/wm/gestures/shelf_gesture_handler.cc
+++ b/ash/wm/gestures/shelf_gesture_handler.cc
@@ -45,7 +45,7 @@ bool ShelfGestureHandler::ProcessGestureEvent(const ui::GestureEvent& event) {
// The gesture are disabled for fullscreen windows that are not in immersive
// mode.
- aura::Window* fullscreen = controller->GetFullscreenWindow();
+ const aura::Window* fullscreen = controller->GetFullscreenWindow();
if (fullscreen && !shelf->FullscreenWithMinimalChrome())
return false;
diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc
index d129c47..b02991c 100644
--- a/ash/wm/mru_window_tracker.cc
+++ b/ash/wm/mru_window_tracker.cc
@@ -27,30 +27,14 @@ const int kContainerIds[] = {
internal::kShellWindowId_AlwaysOnTopContainer
};
-// Adds all the children of |window| to |windows|.
-void AddAllChildren(aura::Window* window,
- MruWindowTracker::WindowList* windows) {
- const MruWindowTracker::WindowList& children(window->children());
- windows->insert(windows->end(), children.begin(), children.end());
-}
-
-// Adds all the children of all of |window|s children to |windows|.
-void AddWorkspaceChildren(aura::Window* window,
- MruWindowTracker::WindowList* windows) {
- for (size_t i = 0; i < window->children().size(); ++i)
- AddAllChildren(window->children()[i], windows);
-}
-
// Adds the windows that can be cycled through for the specified window id to
// |windows|.
void AddTrackedWindows(aura::RootWindow* root,
int container_id,
MruWindowTracker::WindowList* windows) {
aura::Window* container = Shell::GetContainer(root, container_id);
- if (container_id == internal::kShellWindowId_DefaultContainer)
- AddWorkspaceChildren(container, windows);
- else
- AddAllChildren(container, windows);
+ const MruWindowTracker::WindowList& children(container->children());
+ windows->insert(windows->end(), children.begin(), children.end());
}
// Returns a list of windows ordered by their stacking order.
@@ -129,16 +113,6 @@ MruWindowTracker::~MruWindowTracker() {
if (container)
container->RemoveObserver(this);
}
- aura::Window* default_container =
- Shell::GetContainer(*iter, internal::kShellWindowId_DefaultContainer);
- if (default_container) {
- for (size_t i = 0; i < default_container->children().size(); ++i) {
- aura::Window* workspace_window = default_container->children()[i];
- DCHECK_EQ(internal::kShellWindowId_WorkspaceContainer,
- workspace_window->id());
- workspace_window->RemoveObserver(this);
- }
- }
}
activation_client_->RemoveObserver(this);
@@ -160,16 +134,6 @@ void MruWindowTracker::OnRootWindowAdded(aura::RootWindow* root_window) {
Shell::GetContainer(root_window, kContainerIds[i]);
container->AddObserver(this);
}
-
- aura::Window* default_container =
- Shell::GetContainer(root_window,
- internal::kShellWindowId_DefaultContainer);
- for (size_t i = 0; i < default_container->children().size(); ++i) {
- aura::Window* workspace_window = default_container->children()[i];
- DCHECK_EQ(internal::kShellWindowId_WorkspaceContainer,
- workspace_window->id());
- workspace_window->AddObserver(this);
- }
}
void MruWindowTracker::SetIgnoreActivations(bool ignore) {
@@ -192,11 +156,10 @@ bool MruWindowTracker::IsTrackedContainer(aura::Window* window) {
if (!window)
return false;
for (size_t i = 0; i < arraysize(kContainerIds); ++i) {
- if (window->id() == kContainerIds[i]) {
+ if (window->id() == kContainerIds[i])
return true;
- }
}
- return window->id() == internal::kShellWindowId_WorkspaceContainer;
+ return false;
}
void MruWindowTracker::OnWindowActivated(aura::Window* gained_active,
@@ -208,15 +171,8 @@ void MruWindowTracker::OnWindowActivated(aura::Window* gained_active,
}
}
-void MruWindowTracker::OnWindowAdded(aura::Window* window) {
- if (window->id() == internal::kShellWindowId_WorkspaceContainer)
- window->AddObserver(this);
-}
-
void MruWindowTracker::OnWillRemoveWindow(aura::Window* window) {
mru_windows_.remove(window);
- if (window->id() == internal::kShellWindowId_WorkspaceContainer)
- window->RemoveObserver(this);
}
void MruWindowTracker::OnWindowDestroying(aura::Window* window) {
diff --git a/ash/wm/mru_window_tracker.h b/ash/wm/mru_window_tracker.h
index fadfdb9..9ff3bd1 100644
--- a/ash/wm/mru_window_tracker.h
+++ b/ash/wm/mru_window_tracker.h
@@ -68,7 +68,6 @@ class ASH_EXPORT MruWindowTracker
aura::Window* lost_active) OVERRIDE;
// Overridden from WindowObserver:
- virtual void OnWindowAdded(aura::Window* window) OVERRIDE;
virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE;
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc
index fd5f6456..1f1bdf5 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -119,7 +119,7 @@ class PanelWindowResizerTest : public test::AshTestBase {
DragEnd();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
EXPECT_EQ(root_window, window->GetRootWindow());
@@ -291,7 +291,7 @@ TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) {
EXPECT_EQ(initial_bounds.x(), window->GetBoundsInScreen().x());
EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
DragStart(window.get());
@@ -301,7 +301,7 @@ TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) {
EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -322,7 +322,7 @@ TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) {
EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x());
EXPECT_EQ(initial_bounds.y() - 100, window->GetBoundsInScreen().y());
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -401,7 +401,7 @@ TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) {
DragMove(0, -100);
DragEnd();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
// Drag back to launcher.
@@ -411,7 +411,7 @@ TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) {
// When the drag is reverted it should remain detached.
DragRevert();
EXPECT_FALSE(window->GetProperty(kPanelAttachedKey));
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
@@ -420,7 +420,7 @@ TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
DragStart(window.get());
DragMove(0, -100);
DragEnd();
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
// While moving the panel window should be moved to the panel container.
@@ -430,7 +430,7 @@ TEST_F(PanelWindowResizerTest, DragMovesToPanelLayer) {
DragEnd();
// When dropped it should return to the default container.
- EXPECT_EQ(internal::kShellWindowId_WorkspaceContainer,
+ EXPECT_EQ(internal::kShellWindowId_DefaultContainer,
window->parent()->id());
}
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 121fe32..2143e45 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -24,7 +24,6 @@
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/phantom_window_controller.h"
#include "ash/wm/workspace/snap_sizer.h"
-#include "ash/wm/workspace_controller.h"
#include "base/command_line.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/screen_position_client.h"
@@ -62,7 +61,7 @@ scoped_ptr<WindowResizer> CreateWindowResizer(
// It may be possible to refactor and eliminate chaining.
WindowResizer* window_resizer = NULL;
if (window->parent() &&
- (window->parent()->id() == internal::kShellWindowId_WorkspaceContainer ||
+ (window->parent()->id() == internal::kShellWindowId_DefaultContainer ||
window->parent()->id() == internal::kShellWindowId_DockedContainer ||
window->parent()->id() == internal::kShellWindowId_PanelContainer)) {
// Allow dragging maximized windows if it's not tracked by workspace. This
@@ -703,13 +702,9 @@ bool WorkspaceWindowResizer::UpdateMagnetismWindow(const gfx::Rect& bounds,
for (Shell::RootWindowList::iterator iter = root_windows.begin();
iter != root_windows.end(); ++iter) {
const aura::RootWindow* root_window = *iter;
- internal::WorkspaceController* workspace_controller =
- GetRootWindowController(root_window)->workspace_controller();
- if (!workspace_controller)
- continue;
- // Test all children from the active workspace in each root window.
- const aura::Window::Windows& children =
- workspace_controller->GetActiveWorkspaceWindow()->children();
+ // Test all children from the desktop in each root window.
+ const aura::Window::Windows& children = Shell::GetContainer(
+ root_window, kShellWindowId_DefaultContainer)->children();
for (aura::Window::Windows::const_reverse_iterator i = children.rbegin();
i != children.rend() && !matcher.AreEdgesObscured(); ++i) {
aura::Window* other = *i;
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
index b40123a..3e78097 100644
--- a/ash/wm/workspace_controller.cc
+++ b/ash/wm/workspace_controller.cc
@@ -29,70 +29,30 @@ namespace {
// animation (when logging in).
const int kInitialPauseTimeMS = 750;
-// LayoutManager installed on the parent window of the desktop window (eg
-// DefaultContainer).
-class LayoutManagerImpl : public BaseLayoutManager {
- public:
- explicit LayoutManagerImpl(aura::Window* viewport)
- : BaseLayoutManager(viewport->GetRootWindow()),
- viewport_(viewport) {
- }
- virtual ~LayoutManagerImpl() {}
-
- // Overridden from BaseWorkspaceLayoutManager:
- virtual void OnWindowResized() OVERRIDE {
- for (size_t i = 0; i < viewport_->children().size(); ++i) {
- viewport_->children()[i]->SetBounds(
- gfx::Rect(viewport_->bounds().size()));
- }
- }
-
- virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE {
- // Only workspaces should be added as children.
- DCHECK(child->id() == kShellWindowId_WorkspaceContainer);
- child->SetBounds(gfx::Rect(viewport_->bounds().size()));
- }
-
- private:
- aura::Window* viewport_;
-
- DISALLOW_COPY_AND_ASSIGN(LayoutManagerImpl);
-};
-
} // namespace
WorkspaceController::WorkspaceController(aura::Window* viewport)
: viewport_(viewport),
shelf_(NULL),
- desktop_(new aura::Window(NULL)),
- event_handler_(new WorkspaceEventHandler(desktop_.get())) {
- viewport_->SetEventFilter(NULL);
- viewport_->SetLayoutManager(new LayoutManagerImpl(viewport_));
-
- views::corewm::SetChildWindowVisibilityChangesAnimated(desktop_.get());
+ event_handler_(new WorkspaceEventHandler(viewport_)) {
SetWindowVisibilityAnimationTransition(
- desktop_.get(), views::corewm::ANIMATE_NONE);
- desktop_->set_id(kShellWindowId_WorkspaceContainer);
- desktop_->SetName("DesktopWorkspaceContainer");
- desktop_->Init(ui::LAYER_NOT_DRAWN);
+ viewport_, views::corewm::ANIMATE_NONE);
// Do this so when animating out windows don't extend beyond the bounds.
- desktop_->layer()->SetMasksToBounds(true);
- viewport_->AddChild(desktop_.get());
- desktop_->SetProperty(internal::kUsesScreenCoordinatesKey, true);
+ viewport_->layer()->SetMasksToBounds(true);
// The layout-manager cannot be created in the initializer list since it
// depends on the window to have been initialized.
- layout_manager_ = new WorkspaceLayoutManager(desktop_.get());
- desktop_->SetLayoutManager(layout_manager_);
+ layout_manager_ = new WorkspaceLayoutManager(viewport_);
+ viewport_->SetLayoutManager(layout_manager_);
- desktop_->Show();
+ viewport_->Show();
}
WorkspaceController::~WorkspaceController() {
- desktop_->SetLayoutManager(NULL);
- desktop_->SetEventFilter(NULL);
- desktop_->RemovePreTargetHandler(event_handler_.get());
- desktop_->RemovePostTargetHandler(event_handler_.get());
+ viewport_->SetLayoutManager(NULL);
+ viewport_->SetEventFilter(NULL);
+ viewport_->RemovePreTargetHandler(event_handler_.get());
+ viewport_->RemovePostTargetHandler(event_handler_.get());
}
WorkspaceWindowState WorkspaceController::GetWindowState() const {
@@ -100,7 +60,7 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
return WORKSPACE_WINDOW_STATE_DEFAULT;
const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
- const aura::Window::Windows& windows(desktop_->children());
+ const aura::Window::Windows& windows(viewport_->children());
bool window_overlaps_launcher = false;
bool has_maximized_window = false;
for (aura::Window::Windows::const_iterator i = windows.begin();
@@ -133,15 +93,11 @@ void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) {
layout_manager_->SetShelf(shelf);
}
-aura::Window* WorkspaceController::GetActiveWorkspaceWindow() {
- return desktop_.get();
-}
-
void WorkspaceController::DoInitialAnimation() {
WorkspaceAnimationDetails details;
details.animate = details.animate_opacity = details.animate_scale = true;
details.pause_time_ms = kInitialPauseTimeMS;
- ash::internal::ShowWorkspace(desktop_.get(), details);
+ ash::internal::ShowWorkspace(viewport_, details);
}
} // namespace internal
diff --git a/ash/wm/workspace_controller.h b/ash/wm/workspace_controller.h
index a359228..84df41c 100644
--- a/ash/wm/workspace_controller.h
+++ b/ash/wm/workspace_controller.h
@@ -34,9 +34,6 @@ class ASH_EXPORT WorkspaceController {
void SetShelf(ShelfLayoutManager* shelf);
- // Returns the container window for the active workspace, never NULL.
- aura::Window* GetActiveWorkspaceWindow();
-
// Starts the animation that occurs on first login.
void DoInitialAnimation();
@@ -46,7 +43,6 @@ class ASH_EXPORT WorkspaceController {
aura::Window* viewport_;
internal::ShelfLayoutManager* shelf_;
- scoped_ptr<aura::Window> desktop_;
scoped_ptr<internal::WorkspaceEventHandler> event_handler_;
internal::WorkspaceLayoutManager* layout_manager_;
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index c0730f5..f6a4ffb 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -113,14 +113,9 @@ class WorkspaceControllerTest : public test::AshTestBase {
return window;
}
- aura::Window* GetViewport() {
- return Shell::GetContainer(Shell::GetPrimaryRootWindow(),
- kShellWindowId_DefaultContainer);
- }
-
aura::Window* GetDesktop() {
return Shell::GetContainer(Shell::GetPrimaryRootWindow(),
- kShellWindowId_WorkspaceContainer);
+ kShellWindowId_DefaultContainer);
}
gfx::Rect GetFullscreenBounds(aura::Window* window) {