diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-31 20:57:33 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-31 20:57:33 +0000 |
commit | ef0e32cc3e739c6ec518070329e35e90b8994891 (patch) | |
tree | f23ab6e0cdda97e8045e7ee565d4290101bc3fb1 /ash | |
parent | f809d3bb86532d666d6094497b5b7f93f3b32a9e (diff) | |
download | chromium_src-ef0e32cc3e739c6ec518070329e35e90b8994891.zip chromium_src-ef0e32cc3e739c6ec518070329e35e90b8994891.tar.gz chromium_src-ef0e32cc3e739c6ec518070329e35e90b8994891.tar.bz2 |
Renames Workspace*2 -> Workspace*.
BUG=none
TEST=none
R=ben@chromium.org
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/11293014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash.gyp | 16 | ||||
-rw-r--r-- | ash/root_window_controller.cc | 4 | ||||
-rw-r--r-- | ash/shell_window_ids.h | 7 | ||||
-rw-r--r-- | ash/wm/activation_controller.cc | 2 | ||||
-rw-r--r-- | ash/wm/window_cycle_controller.cc | 6 | ||||
-rw-r--r-- | ash/wm/window_resizer.cc | 2 | ||||
-rw-r--r-- | ash/wm/workspace/workspace.cc (renamed from ash/wm/workspace/workspace2.cc) | 28 | ||||
-rw-r--r-- | ash/wm/workspace/workspace.h (renamed from ash/wm/workspace/workspace2.h) | 34 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_layout_manager.cc (renamed from ash/wm/workspace/workspace_layout_manager2.cc) | 58 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_layout_manager.h (renamed from ash/wm/workspace/workspace_layout_manager2.h) | 22 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_layout_manager_unittest.cc (renamed from ash/wm/workspace/workspace_layout_manager2_unittest.cc) | 20 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager.cc (renamed from ash/wm/workspace/workspace_manager2.cc) | 156 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager.h (renamed from ash/wm/workspace/workspace_manager2.h) | 76 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager_unittest.cc (renamed from ash/wm/workspace/workspace_manager2_unittest.cc) | 98 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer_unittest.cc | 2 | ||||
-rw-r--r-- | ash/wm/workspace_controller.cc | 4 | ||||
-rw-r--r-- | ash/wm/workspace_controller.h | 4 | ||||
-rw-r--r-- | ash/wm/workspace_controller_test_helper.h | 4 |
18 files changed, 271 insertions, 272 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index b0bb95a..114ff7e 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -388,16 +388,16 @@ 'wm/workspace/snap_sizer.cc', 'wm/workspace/snap_sizer.h', 'wm/workspace/snap_types.h', - 'wm/workspace/workspace2.cc', - 'wm/workspace/workspace2.h', + 'wm/workspace/workspace.cc', + 'wm/workspace/workspace.h', 'wm/workspace/workspace_animations.cc', 'wm/workspace/workspace_animations.h', 'wm/workspace/workspace_event_handler.cc', 'wm/workspace/workspace_event_handler.h', - 'wm/workspace/workspace_layout_manager2.cc', - 'wm/workspace/workspace_layout_manager2.h', - 'wm/workspace/workspace_manager2.cc', - 'wm/workspace/workspace_manager2.h', + 'wm/workspace/workspace_layout_manager.cc', + 'wm/workspace/workspace_layout_manager.h', + 'wm/workspace/workspace_manager.cc', + 'wm/workspace/workspace_manager.h', 'wm/workspace/workspace_types.h', 'wm/workspace/workspace_window_resizer.cc', 'wm/workspace/workspace_window_resizer.h', @@ -561,8 +561,8 @@ 'wm/workspace/workspace_event_handler_test_helper.cc', 'wm/workspace/workspace_event_handler_test_helper.h', 'wm/workspace/workspace_event_handler_unittest.cc', - 'wm/workspace/workspace_layout_manager2_unittest.cc', - 'wm/workspace/workspace_manager2_unittest.cc', + 'wm/workspace/workspace_layout_manager_unittest.cc', + 'wm/workspace/workspace_manager_unittest.cc', 'wm/workspace/workspace_window_resizer_unittest.cc', '<(SHARED_INTERMEDIATE_DIR)/ash/ash_resources/ash_wallpaper_resources.rc', ], diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 771f997..3848aa3 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -106,8 +106,8 @@ void ReparentAllWindows(aura::RootWindow* src, aura::RootWindow* dst) { internal::kShellWindowId_LockSystemModalContainer, internal::kShellWindowId_InputMethodContainer, }; - // For Workspace2 we need to manually reparent the windows. This way - // Workspace2 can move the windows to the appropriate workspace. + // 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)); internal::WorkspaceController* workspace_controller = GetRootWindowController(dst)->workspace_controller(); diff --git a/ash/shell_window_ids.h b/ash/shell_window_ids.h index 2d73152..0a15aeb 100644 --- a/ash/shell_window_ids.h +++ b/ash/shell_window_ids.h @@ -36,12 +36,11 @@ const int kShellWindowId_UnparentedControlContainer = 3; // The desktop background window. const int kShellWindowId_DesktopBackgroundContainer = 4; -// TODO(sky): rename kShellWindowId_DefaultContainer when Workspace2 is the -// default. +// TODO(sky): rename kShellWindowId_DefaultContainer. // The container for standard top-level windows. -// WARNING: when Workspace2 is enabled the only children of -// kShellWindowId_DefaultContainer are kShellWindowId_WorkspaceContainer. +// 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. diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc index 762abc5..e347294 100644 --- a/ash/wm/activation_controller.cc +++ b/ash/wm/activation_controller.cc @@ -357,7 +357,7 @@ aura::Window* ActivationController::GetTopmostWindowToActivate( aura::Window* ActivationController::GetTopmostWindowToActivateInContainer( aura::Window* container, aura::Window* ignore) const { - // Workspace2 has an extra level of windows that needs to be special cased. + // 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(); diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc index 7568f15..1e332d3 100644 --- a/ash/wm/window_cycle_controller.cc +++ b/ash/wm/window_cycle_controller.cc @@ -93,8 +93,8 @@ void AddAllChildren(aura::Window* window, } // Adds all the children of all of |window|s children to |windows|. -void AddWorkspace2Children(aura::Window* window, - WindowCycleList::WindowList* windows) { +void AddWorkspaceChildren(aura::Window* window, + WindowCycleList::WindowList* windows) { for (size_t i = 0; i < window->children().size(); ++i) AddAllChildren(window->children()[i], windows); } @@ -106,7 +106,7 @@ void AddCycleWindows(aura::RootWindow* root, WindowCycleList::WindowList* windows) { aura::Window* container = Shell::GetContainer(root, container_id); if (container_id == internal::kShellWindowId_DefaultContainer) - AddWorkspace2Children(container, windows); + AddWorkspaceChildren(container, windows); else AddAllChildren(container, windows); } diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc index 7ed7f92..ef44c9b 100644 --- a/ash/wm/window_resizer.cc +++ b/ash/wm/window_resizer.cc @@ -8,7 +8,7 @@ #include "ash/shell.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" -#include "ash/wm/workspace/workspace_layout_manager2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" diff --git a/ash/wm/workspace/workspace2.cc b/ash/wm/workspace/workspace.cc index f495c5d..a2c0325 100644 --- a/ash/wm/workspace/workspace2.cc +++ b/ash/wm/workspace/workspace.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/wm/workspace/workspace2.h" +#include "ash/wm/workspace/workspace.h" #include "ash/shell_window_ids.h" #include "ash/wm/property_util.h" @@ -10,16 +10,16 @@ #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace_event_handler.h" -#include "ash/wm/workspace/workspace_layout_manager2.h" -#include "ash/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" +#include "ash/wm/workspace/workspace_manager.h" #include "ui/aura/window.h" namespace ash { namespace internal { -Workspace2::Workspace2(WorkspaceManager2* manager, - aura::Window* parent, - bool is_maximized) +Workspace::Workspace(WorkspaceManager* manager, + aura::Window* parent, + bool is_maximized) : is_maximized_(is_maximized), workspace_manager_(manager), window_(new aura::Window(NULL)), @@ -39,16 +39,16 @@ Workspace2::Workspace2(WorkspaceManager2* manager, // The layout-manager cannot be created in the initializer list since it // depends on the window to have been initialized. - workspace_layout_manager_ = new WorkspaceLayoutManager2(this); + workspace_layout_manager_ = new WorkspaceLayoutManager(this); window_->SetLayoutManager(workspace_layout_manager_); } -Workspace2::~Workspace2() { +Workspace::~Workspace() { // ReleaseWindow() should have been invoked before we're deleted. DCHECK(!window_); } -aura::Window* Workspace2::ReleaseWindow() { +aura::Window* Workspace::ReleaseWindow() { // Remove the LayoutManager and EventFilter as they refer back to us and/or // WorkspaceManager. window_->SetLayoutManager(NULL); @@ -58,7 +58,7 @@ aura::Window* Workspace2::ReleaseWindow() { return window; } -bool Workspace2::ShouldMoveToPending() const { +bool Workspace::ShouldMoveToPending() const { if (!is_maximized_) return false; @@ -68,7 +68,7 @@ bool Workspace2::ShouldMoveToPending() const { if (!GetTrackedByWorkspace(child) || !child->TargetVisibility() || wm::IsWindowMinimized(child)) continue; - if (WorkspaceManager2::IsMaximized(child)) + if (WorkspaceManager::IsMaximized(child)) return false; if (GetTrackedByWorkspace(child) && !GetPersistsAcrossAllWorkspaces(child)) @@ -77,13 +77,13 @@ bool Workspace2::ShouldMoveToPending() const { return !has_visible_non_maximized_window; } -int Workspace2::GetNumMaximizedWindows() const { +int Workspace::GetNumMaximizedWindows() const { int count = 0; for (size_t i = 0; i < window_->children().size(); ++i) { aura::Window* child = window_->children()[i]; if (GetTrackedByWorkspace(child) && - (WorkspaceManager2::IsMaximized(child) || - WorkspaceManager2::WillRestoreMaximized(child))) { + (WorkspaceManager::IsMaximized(child) || + WorkspaceManager::WillRestoreMaximized(child))) { if (++count == 2) return count; } diff --git a/ash/wm/workspace/workspace2.h b/ash/wm/workspace/workspace.h index bf53ea9..575a368 100644 --- a/ash/wm/workspace/workspace2.h +++ b/ash/wm/workspace/workspace.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_WORKSPACE_WORKSPACE2_H_ -#define ASH_WM_WORKSPACE_WORKSPACE2_H_ +#ifndef ASH_WM_WORKSPACE_WORKSPACE_H_ +#define ASH_WM_WORKSPACE_WORKSPACE_H_ #include <vector> @@ -23,18 +23,18 @@ namespace ash { namespace internal { class WorkspaceEventHandler; -class WorkspaceLayoutManager2; -class WorkspaceManager2; +class WorkspaceLayoutManager; +class WorkspaceManager; // Workspace is used to maintain either a single maximized windows (including // transients and other windows) or any number of windows (for the // desktop). Workspace is used by WorkspaceManager to manage a set of windows. -class ASH_EXPORT Workspace2 { +class ASH_EXPORT Workspace { public: - Workspace2(WorkspaceManager2* manager, - aura::Window* parent, - bool is_maximized); - ~Workspace2(); + Workspace(WorkspaceManager* manager, + aura::Window* parent, + bool is_maximized); + ~Workspace(); // Resets state. This should be used before destroying the Workspace. aura::Window* ReleaseWindow(); @@ -43,17 +43,17 @@ class ASH_EXPORT Workspace2 { aura::Window* window() { return window_; } - const WorkspaceLayoutManager2* workspace_layout_manager() const { + const WorkspaceLayoutManager* workspace_layout_manager() const { return workspace_layout_manager_; } - WorkspaceLayoutManager2* workspace_layout_manager() { + WorkspaceLayoutManager* workspace_layout_manager() { return workspace_layout_manager_; } - const WorkspaceManager2* workspace_manager() const { + const WorkspaceManager* workspace_manager() const { return workspace_manager_; } - WorkspaceManager2* workspace_manager() { return workspace_manager_; } + WorkspaceManager* workspace_manager() { return workspace_manager_; } // Returns true if the Workspace should be moved to pending. This is true // if there are no visible maximized windows. @@ -67,19 +67,19 @@ class ASH_EXPORT Workspace2 { // Is this a workspace for maximized windows? const bool is_maximized_; - WorkspaceManager2* workspace_manager_; + WorkspaceManager* workspace_manager_; // Our Window, owned by |parent| passed to the constructor. aura::Window* window_; scoped_ptr<WorkspaceEventHandler> event_handler_; - WorkspaceLayoutManager2* workspace_layout_manager_; + WorkspaceLayoutManager* workspace_layout_manager_; - DISALLOW_COPY_AND_ASSIGN(Workspace2); + DISALLOW_COPY_AND_ASSIGN(Workspace); }; } // namespace internal } // namespace ash -#endif // ASH_WM_WORKSPACE_WORKSPACE2_H_ +#endif // ASH_WM_WORKSPACE_WORKSPACE_H_ diff --git a/ash/wm/workspace/workspace_layout_manager2.cc b/ash/wm/workspace/workspace_layout_manager.cc index ecc5227..391a847 100644 --- a/ash/wm/workspace/workspace_layout_manager2.cc +++ b/ash/wm/workspace/workspace_layout_manager.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/wm/workspace/workspace_layout_manager2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" #include "ash/ash_switches.h" #include "ash/screen_ash.h" @@ -12,8 +12,8 @@ #include "ash/wm/window_animations.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" -#include "ash/wm/workspace/workspace2.h" -#include "ash/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace.h" +#include "ash/wm/workspace/workspace_manager.h" #include "ash/wm/workspace/workspace_window_resizer.h" #include "base/auto_reset.h" #include "base/command_line.h" @@ -70,7 +70,7 @@ void ResetConstrainedWindowBoundsIfNecessary(const BoundsMap& bounds_map, } // namespace -WorkspaceLayoutManager2::WorkspaceLayoutManager2(Workspace2* workspace) +WorkspaceLayoutManager::WorkspaceLayoutManager(Workspace* workspace) : root_window_(workspace->window()->GetRootWindow()), workspace_(workspace), work_area_(ScreenAsh::GetDisplayWorkAreaBoundsInParent( @@ -80,7 +80,7 @@ WorkspaceLayoutManager2::WorkspaceLayoutManager2(Workspace2* workspace) root_window_->AddObserver(this); } -WorkspaceLayoutManager2::~WorkspaceLayoutManager2() { +WorkspaceLayoutManager::~WorkspaceLayoutManager() { if (root_window_) { root_window_->RemoveObserver(this); root_window_->RemoveRootWindowObserver(this); @@ -90,7 +90,7 @@ WorkspaceLayoutManager2::~WorkspaceLayoutManager2() { Shell::GetInstance()->RemoveShellObserver(this); } -void WorkspaceLayoutManager2::OnWindowAddedToLayout(Window* child) { +void WorkspaceLayoutManager::OnWindowAddedToLayout(Window* child) { // Adjust window bounds in case that the new child is out of the workspace. AdjustWindowSizeForScreenChange(child, ADJUST_WINDOW_DISPLAY_INSETS_CHANGED); @@ -105,18 +105,18 @@ void WorkspaceLayoutManager2::OnWindowAddedToLayout(Window* child) { workspace_manager()->OnWindowAddedToWorkspace(workspace_, child); } -void WorkspaceLayoutManager2::OnWillRemoveWindowFromLayout(Window* child) { +void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(Window* child) { windows_.erase(child); child->RemoveObserver(this); workspace_manager()->OnWillRemoveWindowFromWorkspace(workspace_, child); } -void WorkspaceLayoutManager2::OnWindowRemovedFromLayout(Window* child) { +void WorkspaceLayoutManager::OnWindowRemovedFromLayout(Window* child) { workspace_manager()->OnWindowRemovedFromWorkspace(workspace_, child); } -void WorkspaceLayoutManager2::OnChildWindowVisibilityChanged(Window* child, - bool visible) { +void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child, + bool visible) { if (visible && wm::IsWindowMinimized(child)) { // Attempting to show a minimized window. Unminimize it. child->SetProperty(aura::client::kShowStateKey, @@ -127,7 +127,7 @@ void WorkspaceLayoutManager2::OnChildWindowVisibilityChanged(Window* child, child); } -void WorkspaceLayoutManager2::SetChildBounds( +void WorkspaceLayoutManager::SetChildBounds( Window* child, const gfx::Rect& requested_bounds) { if (!GetTrackedByWorkspace(child)) { @@ -147,12 +147,12 @@ void WorkspaceLayoutManager2::SetChildBounds( workspace_manager()->OnWorkspaceWindowChildBoundsChanged(workspace_, child); } -void WorkspaceLayoutManager2::OnRootWindowResized(const aura::RootWindow* root, - const gfx::Size& old_size) { +void WorkspaceLayoutManager::OnRootWindowResized(const aura::RootWindow* root, + const gfx::Size& old_size) { AdjustWindowSizesForScreenChange(ADJUST_WINDOW_SCREEN_SIZE_CHANGED); } -void WorkspaceLayoutManager2::OnDisplayWorkAreaInsetsChanged() { +void WorkspaceLayoutManager::OnDisplayWorkAreaInsetsChanged() { if (workspace_manager()->active_workspace_ == workspace_) { const gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent( workspace_->window()->parent())); @@ -161,17 +161,17 @@ void WorkspaceLayoutManager2::OnDisplayWorkAreaInsetsChanged() { } } -void WorkspaceLayoutManager2::OnWindowPropertyChanged(Window* window, - const void* key, - intptr_t old) { +void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window, + const void* key, + intptr_t old) { if (key == aura::client::kShowStateKey) { ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); ui::WindowShowState new_state = window->GetProperty(aura::client::kShowStateKey); if (old_state != ui::SHOW_STATE_MINIMIZED && GetRestoreBoundsInScreen(window) == NULL && - WorkspaceManager2::IsMaximizedState(new_state) && - !WorkspaceManager2::IsMaximizedState(old_state)) { + WorkspaceManager::IsMaximizedState(new_state) && + !WorkspaceManager::IsMaximizedState(old_state)) { SetRestoreBoundsInParent(window, window->bounds()); } // When restoring from a minimized state, we want to restore to the @@ -194,10 +194,10 @@ void WorkspaceLayoutManager2::OnWindowPropertyChanged(Window* window, ui::Layer* cloned_layer = NULL; BoundsMap bounds_map; if (wm::IsActiveWindow(window) && - ((WorkspaceManager2::IsMaximizedState(new_state) && + ((WorkspaceManager::IsMaximizedState(new_state) && wm::IsWindowStateNormal(old_state)) || - (!WorkspaceManager2::IsMaximizedState(new_state) && - WorkspaceManager2::IsMaximizedState(old_state) && + (!WorkspaceManager::IsMaximizedState(new_state) && + WorkspaceManager::IsMaximizedState(old_state) && new_state != ui::SHOW_STATE_MINIMIZED))) { BuildWindowBoundsMap(window, &bounds_map); cloned_layer = wm::RecreateWindowLayers(window, false); @@ -236,14 +236,14 @@ void WorkspaceLayoutManager2::OnWindowPropertyChanged(Window* window, } } -void WorkspaceLayoutManager2::OnWindowDestroying(aura::Window* window) { +void WorkspaceLayoutManager::OnWindowDestroying(aura::Window* window) { if (root_window_ == window) { root_window_->RemoveObserver(this); root_window_ = NULL; } } -void WorkspaceLayoutManager2::ShowStateChanged( +void WorkspaceLayoutManager::ShowStateChanged( Window* window, ui::WindowShowState last_show_state, ui::Layer* cloned_layer) { @@ -271,7 +271,7 @@ void WorkspaceLayoutManager2::ShowStateChanged( } } -void WorkspaceLayoutManager2::AdjustWindowSizesForScreenChange( +void WorkspaceLayoutManager::AdjustWindowSizesForScreenChange( AdjustWindowReason reason) { work_area_ = ScreenAsh::GetDisplayWorkAreaBoundsInParent( workspace_->window()->parent()); @@ -287,7 +287,7 @@ void WorkspaceLayoutManager2::AdjustWindowSizesForScreenChange( } } -void WorkspaceLayoutManager2::AdjustWindowSizeForScreenChange( +void WorkspaceLayoutManager::AdjustWindowSizeForScreenChange( Window* window, AdjustWindowReason reason) { if (GetTrackedByWorkspace(window) && @@ -326,7 +326,7 @@ void WorkspaceLayoutManager2::AdjustWindowSizeForScreenChange( } } -void WorkspaceLayoutManager2::UpdateBoundsFromShowState(Window* window) { +void WorkspaceLayoutManager::UpdateBoundsFromShowState(Window* window) { // See comment in SetMaximizedOrFullscreenBounds() as to why we use parent in // these calculation. switch (window->GetProperty(aura::client::kShowStateKey)) { @@ -357,7 +357,7 @@ void WorkspaceLayoutManager2::UpdateBoundsFromShowState(Window* window) { } } -bool WorkspaceLayoutManager2::SetMaximizedOrFullscreenBounds( +bool WorkspaceLayoutManager::SetMaximizedOrFullscreenBounds( aura::Window* window) { if (!GetTrackedByWorkspace(window)) return false; @@ -380,7 +380,7 @@ bool WorkspaceLayoutManager2::SetMaximizedOrFullscreenBounds( return false; } -WorkspaceManager2* WorkspaceLayoutManager2::workspace_manager() { +WorkspaceManager* WorkspaceLayoutManager::workspace_manager() { return workspace_->workspace_manager(); } diff --git a/ash/wm/workspace/workspace_layout_manager2.h b/ash/wm/workspace/workspace_layout_manager.h index 771a56a..d330a5c 100644 --- a/ash/wm/workspace/workspace_layout_manager2.h +++ b/ash/wm/workspace/workspace_layout_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER2_H_ -#define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER2_H_ +#ifndef ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ +#define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ #include <set> @@ -33,22 +33,22 @@ const int kMinimumOnScreenArea = 10; namespace internal { -class Workspace2; -class WorkspaceManager2; +class Workspace; +class WorkspaceManager; // LayoutManager used on the window created for a Workspace. // TODO(sky): this code shares a fair amount of similarities with // BaseLayoutManager, yet its different enough that subclassing is painful. // See if I can refactor the code to make it easier to share common bits. -class ASH_EXPORT WorkspaceLayoutManager2 +class ASH_EXPORT WorkspaceLayoutManager : public aura::LayoutManager, public aura::RootWindowObserver, public ash::ShellObserver, public aura::WindowObserver { public: public: - explicit WorkspaceLayoutManager2(Workspace2* workspace); - virtual ~WorkspaceLayoutManager2(); + explicit WorkspaceLayoutManager(Workspace* workspace); + virtual ~WorkspaceLayoutManager(); // Overridden from BaseWorkspaceLayoutManager: virtual void OnWindowResized() OVERRIDE {} @@ -109,11 +109,11 @@ class ASH_EXPORT WorkspaceLayoutManager2 // true is returned. Does nothing otherwise. bool SetMaximizedOrFullscreenBounds(aura::Window* window); - WorkspaceManager2* workspace_manager(); + WorkspaceManager* workspace_manager(); aura::RootWindow* root_window_; - Workspace2* workspace_; + Workspace* workspace_; // Set of windows we're listening to. WindowSet windows_; @@ -122,10 +122,10 @@ class ASH_EXPORT WorkspaceLayoutManager2 // workspace switch. gfx::Rect work_area_; - DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager2); + DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); }; } // namespace internal } // namespace ash -#endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER2_H_ +#endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ diff --git a/ash/wm/workspace/workspace_layout_manager2_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index 13496f0..698717a 100644 --- a/ash/wm/workspace/workspace_layout_manager2_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.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/wm/workspace/workspace_layout_manager2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" #include "ash/root_window_controller.h" #include "ash/shell.h" @@ -19,23 +19,23 @@ namespace ash { namespace { -class WorkspaceLayoutManager2Test : public test::AshTestBase { +class WorkspaceLayoutManagerTest : public test::AshTestBase { public: - WorkspaceLayoutManager2Test() {} - virtual ~WorkspaceLayoutManager2Test() {} + WorkspaceLayoutManagerTest() {} + virtual ~WorkspaceLayoutManagerTest() {} aura::Window* CreateTestWindow(const gfx::Rect& bounds) { return aura::test::CreateTestWindowWithBounds(bounds, NULL); } private: - DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager2Test); + DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerTest); }; // Verifies that a window containing a restore coordinate will be restored to // to the size prior to minimize, keeping the restore rectangle in tact (if // there is one). -TEST_F(WorkspaceLayoutManager2Test, RestoreFromMinimizeKeepsRestore) { +TEST_F(WorkspaceLayoutManagerTest, RestoreFromMinimizeKeepsRestore) { scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); gfx::Rect bounds(10, 15, 25, 35); window->SetBounds(bounds); @@ -83,7 +83,7 @@ class DontClobberRestoreBoundsWindowObserver : public aura::WindowObserver { // Creates a window, maximized the window and from within the maximized // notification sets the bounds of a window to overlap the shelf. Verifies this // doesn't effect the restore bounds. -TEST_F(WorkspaceLayoutManager2Test, DontClobberRestoreBounds) { +TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { DontClobberRestoreBoundsWindowObserver window_observer; scoped_ptr<aura::Window> window(new aura::Window(NULL)); window->SetType(aura::client::WINDOW_TYPE_NORMAL); @@ -107,7 +107,7 @@ TEST_F(WorkspaceLayoutManager2Test, DontClobberRestoreBounds) { } // Verifies when a window is maximized all descendant windows have a size. -TEST_F(WorkspaceLayoutManager2Test, ChildBoundsResetOnMaximize) { +TEST_F(WorkspaceLayoutManagerTest, ChildBoundsResetOnMaximize) { scoped_ptr<aura::Window> window( CreateTestWindow(gfx::Rect(10, 20, 30, 40))); window->Show(); @@ -120,7 +120,7 @@ TEST_F(WorkspaceLayoutManager2Test, ChildBoundsResetOnMaximize) { EXPECT_EQ("5,6 7x8", child_window->bounds().ToString()); } -TEST_F(WorkspaceLayoutManager2Test, WindowShouldBeOnScreenWhenAdded) { +TEST_F(WorkspaceLayoutManagerTest, WindowShouldBeOnScreenWhenAdded) { // Normal window bounds shouldn't be changed. gfx::Rect window_bounds(100, 100, 200, 200); scoped_ptr<aura::Window> window(CreateTestWindow(window_bounds)); @@ -137,7 +137,7 @@ TEST_F(WorkspaceLayoutManager2Test, WindowShouldBeOnScreenWhenAdded) { } // Verifies the size of a window is enforced to be smaller than the work area. -TEST_F(WorkspaceLayoutManager2Test, SizeToWorkArea) { +TEST_F(WorkspaceLayoutManagerTest, SizeToWorkArea) { // Normal window bounds shouldn't be changed. gfx::Size work_area( gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size()); diff --git a/ash/wm/workspace/workspace_manager2.cc b/ash/wm/workspace/workspace_manager.cc index d357d75..91a5354 100644 --- a/ash/wm/workspace/workspace_manager2.cc +++ b/ash/wm/workspace/workspace_manager.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/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace_manager.h" #include <algorithm> #include <functional> @@ -20,8 +20,8 @@ #include "ash/wm/workspace/auto_window_management.h" #include "ash/wm/workspace/desktop_background_fade_controller.h" #include "ash/wm/workspace/workspace_animations.h" -#include "ash/wm/workspace/workspace_layout_manager2.h" -#include "ash/wm/workspace/workspace2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" +#include "ash/wm/workspace/workspace.h" #include "base/auto_reset.h" #include "base/command_line.h" #include "base/logging.h" @@ -36,7 +36,7 @@ #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/views/widget/widget.h" -DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::Workspace2*); +DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::Workspace*); DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, ui::WindowShowState); using aura::Window; @@ -44,7 +44,7 @@ using aura::Window; namespace ash { namespace internal { -DEFINE_WINDOW_PROPERTY_KEY(Workspace2*, kWorkspaceKey, NULL); +DEFINE_WINDOW_PROPERTY_KEY(Workspace*, kWorkspaceKey, NULL); namespace { @@ -73,10 +73,10 @@ void ReparentWindow(Window* window, // Workspace ------------------------------------------------------------------- // LayoutManager installed on the parent window of all the Workspace window (eg -// |WorkspaceManager2::contents_view_|). -class WorkspaceManager2::LayoutManagerImpl : public BaseLayoutManager { +// |WorkspaceManager::contents_view_|). +class WorkspaceManager::LayoutManagerImpl : public BaseLayoutManager { public: - explicit LayoutManagerImpl(WorkspaceManager2* workspace_manager) + explicit LayoutManagerImpl(WorkspaceManager* workspace_manager) : BaseLayoutManager(workspace_manager->contents_view_->GetRootWindow()), workspace_manager_(workspace_manager) { } @@ -97,14 +97,14 @@ class WorkspaceManager2::LayoutManagerImpl : public BaseLayoutManager { private: aura::Window* window() { return workspace_manager_->contents_view_; } - WorkspaceManager2* workspace_manager_; + WorkspaceManager* workspace_manager_; DISALLOW_COPY_AND_ASSIGN(LayoutManagerImpl); }; -// WorkspaceManager2 ----------------------------------------------------------- +// WorkspaceManager ----------------------------------------------------------- -WorkspaceManager2::WorkspaceManager2(Window* contents_view) +WorkspaceManager::WorkspaceManager(Window* contents_view) : contents_view_(contents_view), active_workspace_(NULL), shelf_(NULL), @@ -124,39 +124,39 @@ WorkspaceManager2::WorkspaceManager2(Window* contents_view) Shell::GetInstance()->AddShellObserver(this); } -WorkspaceManager2::~WorkspaceManager2() { +WorkspaceManager::~WorkspaceManager() { Shell::GetInstance()->RemoveShellObserver(this); // Release the windows, they'll be destroyed when |contents_view_| is // destroyed. std::for_each(workspaces_.begin(), workspaces_.end(), - std::mem_fun(&Workspace2::ReleaseWindow)); + std::mem_fun(&Workspace::ReleaseWindow)); std::for_each(pending_workspaces_.begin(), pending_workspaces_.end(), - std::mem_fun(&Workspace2::ReleaseWindow)); + std::mem_fun(&Workspace::ReleaseWindow)); std::for_each(to_delete_.begin(), to_delete_.end(), - std::mem_fun(&Workspace2::ReleaseWindow)); + std::mem_fun(&Workspace::ReleaseWindow)); STLDeleteElements(&workspaces_); STLDeleteElements(&pending_workspaces_); STLDeleteElements(&to_delete_); } // static -bool WorkspaceManager2::IsMaximized(Window* window) { +bool WorkspaceManager::IsMaximized(Window* window) { return IsMaximizedState(window->GetProperty(aura::client::kShowStateKey)); } // static -bool WorkspaceManager2::IsMaximizedState(ui::WindowShowState state) { +bool WorkspaceManager::IsMaximizedState(ui::WindowShowState state) { return state == ui::SHOW_STATE_MAXIMIZED || state == ui::SHOW_STATE_FULLSCREEN; } // static -bool WorkspaceManager2::WillRestoreMaximized(Window* window) { +bool WorkspaceManager::WillRestoreMaximized(Window* window) { return wm::IsWindowMinimized(window) && IsMaximizedState(window->GetProperty(internal::kRestoreShowStateKey)); } -WorkspaceWindowState WorkspaceManager2::GetWindowState() const { +WorkspaceWindowState WorkspaceManager::GetWindowState() const { if (!shelf_) return WORKSPACE_WINDOW_STATE_DEFAULT; @@ -196,12 +196,12 @@ WorkspaceWindowState WorkspaceManager2::GetWindowState() const { WORKSPACE_WINDOW_STATE_DEFAULT; } -void WorkspaceManager2::SetShelf(ShelfLayoutManager* shelf) { +void WorkspaceManager::SetShelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } -void WorkspaceManager2::SetActiveWorkspaceByWindow(Window* window) { - Workspace2* workspace = FindBy(window); +void WorkspaceManager::SetActiveWorkspaceByWindow(Window* window) { + Workspace* workspace = FindBy(window); if (!workspace) return; @@ -237,11 +237,11 @@ void WorkspaceManager2::SetActiveWorkspaceByWindow(Window* window) { } } -Window* WorkspaceManager2::GetParentForNewWindow(Window* window) { +Window* WorkspaceManager::GetParentForNewWindow(Window* window) { // Try to put windows with transient parents in the same workspace as their // transient parent. if (window->transient_parent() && !IsMaximized(window)) { - Workspace2* workspace = FindBy(window->transient_parent()); + Workspace* workspace = FindBy(window->transient_parent()); if (workspace) return workspace->window(); // Fall through to normal logic. @@ -252,7 +252,7 @@ Window* WorkspaceManager2::GetParentForNewWindow(Window* window) { if (IsMaximized(window)) { // Wait for the window to be made active before showing the workspace. - Workspace2* workspace = CreateWorkspace(true); + Workspace* workspace = CreateWorkspace(true); pending_workspaces_.insert(workspace); return workspace->window(); } @@ -263,7 +263,7 @@ Window* WorkspaceManager2::GetParentForNewWindow(Window* window) { return desktop_workspace()->window(); } -void WorkspaceManager2::DoInitialAnimation() { +void WorkspaceManager::DoInitialAnimation() { if (active_workspace_->is_maximized()) { RootWindowController* root_controller = GetRootWindowController( contents_view_->GetRootWindow()); @@ -278,18 +278,18 @@ void WorkspaceManager2::DoInitialAnimation() { ShowWorkspace(active_workspace_, active_workspace_, SWITCH_INITIAL); } -void WorkspaceManager2::OnAppTerminating() { +void WorkspaceManager::OnAppTerminating() { app_terminating_ = true; } -void WorkspaceManager2::UpdateShelfVisibility() { +void WorkspaceManager::UpdateShelfVisibility() { if (shelf_) shelf_->UpdateVisibilityState(); } -Workspace2* WorkspaceManager2::FindBy(Window* window) const { +Workspace* WorkspaceManager::FindBy(Window* window) const { while (window) { - Workspace2* workspace = window->GetProperty(kWorkspaceKey); + Workspace* workspace = window->GetProperty(kWorkspaceKey); if (workspace) return workspace; window = window->parent(); @@ -297,9 +297,9 @@ Workspace2* WorkspaceManager2::FindBy(Window* window) const { return NULL; } -void WorkspaceManager2::SetActiveWorkspace(Workspace2* workspace, - SwitchReason reason, - base::TimeDelta duration) { +void WorkspaceManager::SetActiveWorkspace(Workspace* workspace, + SwitchReason reason, + base::TimeDelta duration) { DCHECK(workspace); if (active_workspace_ == workspace) return; @@ -315,7 +315,7 @@ void WorkspaceManager2::SetActiveWorkspace(Workspace2* workspace, workspaces_.push_back(workspace); } - Workspace2* last_active = active_workspace_; + Workspace* last_active = active_workspace_; active_workspace_ = workspace; // The display work-area may have changed while |workspace| was not the active @@ -357,17 +357,17 @@ void WorkspaceManager2::SetActiveWorkspace(Workspace2* workspace, } } -WorkspaceManager2::Workspaces::iterator -WorkspaceManager2::FindWorkspace(Workspace2* workspace) { +WorkspaceManager::Workspaces::iterator +WorkspaceManager::FindWorkspace(Workspace* workspace) { return std::find(workspaces_.begin(), workspaces_.end(), workspace); } -Workspace2* WorkspaceManager2::CreateWorkspace(bool maximized) { - return new Workspace2(this, contents_view_, maximized); +Workspace* WorkspaceManager::CreateWorkspace(bool maximized) { + return new Workspace(this, contents_view_, maximized); } -void WorkspaceManager2::MoveWorkspaceToPendingOrDelete( - Workspace2* workspace, +void WorkspaceManager::MoveWorkspaceToPendingOrDelete( + Workspace* workspace, Window* stack_beneath, SwitchReason reason) { // We're all ready moving windows. @@ -399,8 +399,8 @@ void WorkspaceManager2::MoveWorkspaceToPendingOrDelete( } } -void WorkspaceManager2::MoveChildrenToDesktop(aura::Window* window, - aura::Window* stack_beneath) { +void WorkspaceManager::MoveChildrenToDesktop(aura::Window* window, + aura::Window* stack_beneath) { // Build the list of windows to move. Exclude maximized/fullscreen and windows // with transient parents. Window::Windows to_move; @@ -422,7 +422,7 @@ void WorkspaceManager2::MoveChildrenToDesktop(aura::Window* window, } } -void WorkspaceManager2::SelectNextWorkspace(SwitchReason reason) { +void WorkspaceManager::SelectNextWorkspace(SwitchReason reason) { DCHECK_NE(active_workspace_, desktop_workspace()); Workspaces::const_iterator workspace_i(FindWorkspace(active_workspace_)); @@ -433,14 +433,14 @@ void WorkspaceManager2::SelectNextWorkspace(SwitchReason reason) { SetActiveWorkspace(*(workspace_i - 1), reason, base::TimeDelta()); } -void WorkspaceManager2::ScheduleDelete(Workspace2* workspace) { +void WorkspaceManager::ScheduleDelete(Workspace* workspace) { to_delete_.insert(workspace); delete_timer_.Stop(); delete_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this, - &WorkspaceManager2::ProcessDeletion); + &WorkspaceManager::ProcessDeletion); } -void WorkspaceManager2::SetUnminimizingWorkspace(Workspace2* workspace) { +void WorkspaceManager::SetUnminimizingWorkspace(Workspace* workspace) { // The normal sequence of unminimizing a window is: Show() the window, which // triggers changing the kShowStateKey to NORMAL and lastly the window is made // active. This means at the time the window is unminimized we don't know if @@ -452,14 +452,14 @@ void WorkspaceManager2::SetUnminimizingWorkspace(Workspace2* workspace) { if (unminimizing_workspace_) { MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&WorkspaceManager2::SetUnminimizingWorkspace, + base::Bind(&WorkspaceManager::SetUnminimizingWorkspace, clear_unminimizing_workspace_factory_.GetWeakPtr(), - static_cast<Workspace2*>(NULL))); + static_cast<Workspace*>(NULL))); } } -void WorkspaceManager2::FadeDesktop(aura::Window* window, - base::TimeDelta duration) { +void WorkspaceManager::FadeDesktop(aura::Window* window, + base::TimeDelta duration) { if (CommandLine::ForCurrentProcess()->HasSwitch( ash::switches::kAshWindowAnimationsDisabled) || ui::LayerAnimator::disable_animations_for_test()) @@ -485,7 +485,7 @@ void WorkspaceManager2::FadeDesktop(aura::Window* window, parent, stack_above, duration, direction)); } -void WorkspaceManager2::ShowOrHideDesktopBackground( +void WorkspaceManager::ShowOrHideDesktopBackground( aura::Window* window, SwitchReason reason, base::TimeDelta duration, @@ -503,9 +503,9 @@ void WorkspaceManager2::ShowOrHideDesktopBackground( ash::internal::HideWorkspace(window, details); } -void WorkspaceManager2::ShowWorkspace( - Workspace2* workspace, - Workspace2* last_active, +void WorkspaceManager::ShowWorkspace( + Workspace* workspace, + Workspace* last_active, SwitchReason reason) const { WorkspaceAnimationDetails details; details.direction = @@ -534,8 +534,8 @@ void WorkspaceManager2::ShowWorkspace( ash::internal::ShowWorkspace(workspace->window(), details); } -void WorkspaceManager2::HideWorkspace( - Workspace2* workspace, +void WorkspaceManager::HideWorkspace( + Workspace* workspace, SwitchReason reason, bool is_unminimizing_maximized_window) const { WorkspaceAnimationDetails details; @@ -568,12 +568,12 @@ void WorkspaceManager2::HideWorkspace( ash::internal::HideWorkspace(workspace->window(), details); } -void WorkspaceManager2::ProcessDeletion() { - std::set<Workspace2*> to_delete; +void WorkspaceManager::ProcessDeletion() { + std::set<Workspace*> to_delete; to_delete.swap(to_delete_); - for (std::set<Workspace2*>::iterator i = to_delete.begin(); + for (std::set<Workspace*>::iterator i = to_delete.begin(); i != to_delete.end(); ++i) { - Workspace2* workspace = *i; + Workspace* workspace = *i; if (workspace->window()->layer()->children().empty()) { delete workspace->ReleaseWindow(); delete workspace; @@ -583,12 +583,12 @@ void WorkspaceManager2::ProcessDeletion() { } if (!to_delete_.empty()) { delete_timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this, - &WorkspaceManager2::ProcessDeletion); + &WorkspaceManager::ProcessDeletion); } } -void WorkspaceManager2::OnWindowAddedToWorkspace(Workspace2* workspace, - Window* child) { +void WorkspaceManager::OnWindowAddedToWorkspace(Workspace* workspace, + Window* child) { child->SetProperty(kWorkspaceKey, workspace); // Do nothing (other than updating shelf visibility) as the right parent was // chosen by way of GetParentForNewWindow() or we explicitly moved the window @@ -599,21 +599,21 @@ void WorkspaceManager2::OnWindowAddedToWorkspace(Workspace2* workspace, RearrangeVisibleWindowOnShow(child); } -void WorkspaceManager2::OnWillRemoveWindowFromWorkspace(Workspace2* workspace, - Window* child) { +void WorkspaceManager::OnWillRemoveWindowFromWorkspace(Workspace* workspace, + Window* child) { if (child->TargetVisibility()) RearrangeVisibleWindowOnHideOrRemove(child); child->ClearProperty(kWorkspaceKey); } -void WorkspaceManager2::OnWindowRemovedFromWorkspace(Workspace2* workspace, - Window* child) { +void WorkspaceManager::OnWindowRemovedFromWorkspace(Workspace* workspace, + Window* child) { if (workspace->ShouldMoveToPending()) MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_WINDOW_REMOVED); } -void WorkspaceManager2::OnWorkspaceChildWindowVisibilityChanged( - Workspace2* workspace, +void WorkspaceManager::OnWorkspaceChildWindowVisibilityChanged( + Workspace* workspace, Window* child) { if (workspace->ShouldMoveToPending()) { MoveWorkspaceToPendingOrDelete(workspace, NULL, SWITCH_VISIBILITY_CHANGED); @@ -627,15 +627,15 @@ void WorkspaceManager2::OnWorkspaceChildWindowVisibilityChanged( } } -void WorkspaceManager2::OnWorkspaceWindowChildBoundsChanged( - Workspace2* workspace, +void WorkspaceManager::OnWorkspaceWindowChildBoundsChanged( + Workspace* workspace, Window* child) { if (workspace == active_workspace_) UpdateShelfVisibility(); } -void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( - Workspace2* workspace, +void WorkspaceManager::OnWorkspaceWindowShowStateChanged( + Workspace* workspace, Window* child, ui::WindowShowState last_show_state, ui::Layer* old_layer) { @@ -654,7 +654,7 @@ void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( // . No maximized window and not in desktop: move to desktop and further // any existing windows are stacked beneath |child|. const bool is_active = wm::IsActiveWindow(child); - Workspace2* new_workspace = NULL; + Workspace* new_workspace = NULL; const int max_count = workspace->GetNumMaximizedWindows(); base::TimeDelta duration = old_layer && !IsMaximized(child) ? GetCrossFadeDuration(old_layer->bounds(), child->bounds()) : @@ -682,7 +682,7 @@ void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( } if (is_active && new_workspace) { // |old_layer| may be NULL if as part of processing - // WorkspaceLayoutManager2::OnWindowPropertyChanged() the window is made + // WorkspaceLayoutManager::OnWindowPropertyChanged() the window is made // active. if (old_layer) { SetActiveWorkspace(new_workspace, SWITCH_MAXIMIZED_OR_RESTORED, @@ -705,9 +705,9 @@ void WorkspaceManager2::OnWorkspaceWindowShowStateChanged( UpdateShelfVisibility(); } -void WorkspaceManager2::OnTrackedByWorkspaceChanged(Workspace2* workspace, - aura::Window* window) { - Workspace2* new_workspace = NULL; +void WorkspaceManager::OnTrackedByWorkspaceChanged(Workspace* workspace, + aura::Window* window) { + Workspace* new_workspace = NULL; if (IsMaximized(window)) { new_workspace = CreateWorkspace(true); pending_workspaces_.insert(new_workspace); diff --git a/ash/wm/workspace/workspace_manager2.h b/ash/wm/workspace/workspace_manager.h index fae98f7..e59eada 100644 --- a/ash/wm/workspace/workspace_manager2.h +++ b/ash/wm/workspace/workspace_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ -#define ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ +#ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ +#define ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ #include <set> #include <string> @@ -41,20 +41,20 @@ namespace internal { class DesktopBackgroundFadeController; class ShelfLayoutManager; -class WorkspaceLayoutManager2; +class WorkspaceLayoutManager; class WorkspaceManagerTest2; -class Workspace2; +class Workspace; // WorkspaceManager manages multiple workspaces in the desktop. Workspaces are // implicitly created as windows are maximized (or made fullscreen), and // destroyed when maximized windows are closed or restored. There is always one // workspace for the desktop. -// Internally WorkspaceManager2 creates a Window for each Workspace. As windows +// Internally WorkspaceManager creates a Window for each Workspace. As windows // are maximized and restored they are reparented to the right Window. -class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { +class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { public: - explicit WorkspaceManager2(aura::Window* viewport); - virtual ~WorkspaceManager2(); + explicit WorkspaceManager(aura::Window* viewport); + virtual ~WorkspaceManager(); // Returns true if |window| is considered maximized and should exist in its // own workspace. @@ -85,12 +85,12 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { virtual void OnAppTerminating() OVERRIDE; private: - friend class WorkspaceLayoutManager2; - friend class WorkspaceManager2Test; + friend class WorkspaceLayoutManager; + friend class WorkspaceManagerTest; class LayoutManagerImpl; - typedef std::vector<Workspace2*> Workspaces; + typedef std::vector<Workspace*> Workspaces; // Reason for the workspace switch. Used to determine the characterstics of // the animation. @@ -115,10 +115,10 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { void UpdateShelfVisibility(); // Returns the workspace that contains |window|. - Workspace2* FindBy(aura::Window* window) const; + Workspace* FindBy(aura::Window* window) const; // Sets the active workspace. - void SetActiveWorkspace(Workspace2* workspace, + void SetActiveWorkspace(Workspace* workspace, SwitchReason reason, base::TimeDelta duration); @@ -126,20 +126,20 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { gfx::Rect GetWorkAreaBounds() const; // Returns an iterator into |workspaces_| for |workspace|. - Workspaces::iterator FindWorkspace(Workspace2* workspace); + Workspaces::iterator FindWorkspace(Workspace* workspace); - Workspace2* desktop_workspace() { return workspaces_[0]; } - const Workspace2* desktop_workspace() const { return workspaces_[0]; } + Workspace* desktop_workspace() { return workspaces_[0]; } + const Workspace* desktop_workspace() const { return workspaces_[0]; } // Creates a new workspace. The Workspace is not added to anything and is // owned by the caller. - Workspace2* CreateWorkspace(bool maximized); + Workspace* CreateWorkspace(bool maximized); // Moves all the non-maximized child windows of |workspace| to the desktop // stacked beneath |stack_beneath| (if non-NULL). After moving child windows // if |workspace| contains no children it is deleted, otherwise it it moved to // |pending_workspaces_|. - void MoveWorkspaceToPendingOrDelete(Workspace2* workspace, + void MoveWorkspaceToPendingOrDelete(Workspace* workspace, aura::Window* stack_beneath, SwitchReason reason); @@ -152,14 +152,14 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { // Schedules |workspace| for deletion when it no longer contains any layers. // See comments above |to_delete_| as to why we do this. - void ScheduleDelete(Workspace2* workspace); + void ScheduleDelete(Workspace* workspace); // Deletes any workspaces scheduled via ScheduleDelete() that don't contain // any layers. void ProcessDeletion(); // Sets |unminimizing_workspace_| to |workspace|. - void SetUnminimizingWorkspace(Workspace2* workspace); + void SetUnminimizingWorkspace(Workspace* workspace); // Fades the desktop. This is only used when maximizing or restoring a // window. The actual fade is handled by @@ -175,33 +175,33 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { bool show) const; // Shows/hides |workspace| animating as necessary. - void ShowWorkspace(Workspace2* workspace, - Workspace2* last_active, + void ShowWorkspace(Workspace* workspace, + Workspace* last_active, SwitchReason reason) const; - void HideWorkspace(Workspace2* workspace, + void HideWorkspace(Workspace* workspace, SwitchReason reason, bool is_unminimizing_maximized_window) const; // These methods are forwarded from the LayoutManager installed on the // Workspace's window. - void OnWindowAddedToWorkspace(Workspace2* workspace, aura::Window* child); - void OnWillRemoveWindowFromWorkspace(Workspace2* workspace, + void OnWindowAddedToWorkspace(Workspace* workspace, aura::Window* child); + void OnWillRemoveWindowFromWorkspace(Workspace* workspace, aura::Window* child); - void OnWindowRemovedFromWorkspace(Workspace2* workspace, aura::Window* child); - void OnWorkspaceChildWindowVisibilityChanged(Workspace2* workspace, + void OnWindowRemovedFromWorkspace(Workspace* workspace, aura::Window* child); + void OnWorkspaceChildWindowVisibilityChanged(Workspace* workspace, aura::Window* child); - void OnWorkspaceWindowChildBoundsChanged(Workspace2* workspace, + void OnWorkspaceWindowChildBoundsChanged(Workspace* workspace, aura::Window* child); - void OnWorkspaceWindowShowStateChanged(Workspace2* workspace, + void OnWorkspaceWindowShowStateChanged(Workspace* workspace, aura::Window* child, ui::WindowShowState last_show_state, ui::Layer* old_layer); - void OnTrackedByWorkspaceChanged(Workspace2* workspace, + void OnTrackedByWorkspaceChanged(Workspace* workspace, aura::Window* window); aura::Window* contents_view_; - Workspace2* active_workspace_; + Workspace* active_workspace_; // The set of active workspaces. There is always at least one in this stack, // which identifies the desktop. @@ -214,7 +214,7 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { // . When the maximized window is minimized the workspace is added here. // Once any window in the workspace is activated the workspace is moved to // |workspaces_|. - std::set<Workspace2*> pending_workspaces_; + std::set<Workspace*> pending_workspaces_; // Owned by the Shell. May be NULL. ShelfLayoutManager* shelf_; @@ -229,14 +229,14 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { // would effectively cancel animations. Instead when a workspace is no longer // needed we add it here and start a timer. When the timer fires any windows // no longer contain layers are deleted. - std::set<Workspace2*> to_delete_; - base::OneShotTimer<WorkspaceManager2> delete_timer_; + std::set<Workspace*> to_delete_; + base::OneShotTimer<WorkspaceManager> delete_timer_; // See comments in SetUnminimizingWorkspace() for details. - base::WeakPtrFactory<WorkspaceManager2> clear_unminimizing_workspace_factory_; + base::WeakPtrFactory<WorkspaceManager> clear_unminimizing_workspace_factory_; // See comments in SetUnminimizingWorkspace() for details. - Workspace2* unminimizing_workspace_; + Workspace* unminimizing_workspace_; // Set to true if the app is terminating. If true we don't animate the // background, otherwise it can get stuck in the fading position when chrome @@ -250,10 +250,10 @@ class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { // DesktopBackgroundFadeController. bool creating_fade_; - DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); + DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); }; } // namespace internal } // namespace ash -#endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ +#endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ diff --git a/ash/wm/workspace/workspace_manager2_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc index 29e9232..b9a7dd5 100644 --- a/ash/wm/workspace/workspace_manager2_unittest.cc +++ b/ash/wm/workspace/workspace_manager_unittest.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/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace_manager.h" #include "ash/ash_switches.h" #include "ash/root_window_controller.h" @@ -16,7 +16,7 @@ #include "ash/wm/shelf_layout_manager.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" -#include "ash/wm/workspace/workspace2.h" +#include "ash/wm/workspace/workspace.h" #include "ash/wm/workspace_controller_test_helper.h" #include "base/command_line.h" #include "base/string_number_conversions.h" @@ -36,10 +36,10 @@ using aura::Window; namespace ash { namespace internal { -class WorkspaceManager2Test : public test::AshTestBase { +class WorkspaceManagerTest : public test::AshTestBase { public: - WorkspaceManager2Test() : manager_(NULL) {} - virtual ~WorkspaceManager2Test() {} + WorkspaceManagerTest() : manager_(NULL) {} + virtual ~WorkspaceManagerTest() {} aura::Window* CreateTestWindowUnparented() { aura::Window* window = new aura::Window(NULL); @@ -63,7 +63,7 @@ class WorkspaceManager2Test : public test::AshTestBase { kShellWindowId_DefaultContainer); } - const std::vector<Workspace2*>& workspaces() const { + const std::vector<Workspace*>& workspaces() const { return manager_->workspaces_; } @@ -71,7 +71,7 @@ class WorkspaceManager2Test : public test::AshTestBase { return Shell::GetScreen()->GetDisplayNearestWindow(window).bounds(); } - Workspace2* active_workspace() { + Workspace* active_workspace() { return manager_->active_workspace_; } @@ -83,11 +83,11 @@ class WorkspaceManager2Test : public test::AshTestBase { return shelf_layout_manager()->window_overlaps_shelf(); } - Workspace2* FindBy(aura::Window* window) const { + Workspace* FindBy(aura::Window* window) const { return manager_->FindBy(window); } - std::string WorkspaceStateString(Workspace2* workspace) { + std::string WorkspaceStateString(Workspace* workspace) { return (workspace->is_maximized() ? "M" : "") + base::IntToString(static_cast<int>( workspace->window()->children().size())); @@ -109,7 +109,7 @@ class WorkspaceManager2Test : public test::AshTestBase { if (!manager_->pending_workspaces_.empty()) { result += " P="; - for (std::set<Workspace2*>::const_iterator i = + for (std::set<Workspace*>::const_iterator i = manager_->pending_workspaces_.begin(); i != manager_->pending_workspaces_.end(); ++i) { if (i != manager_->pending_workspaces_.begin()) @@ -127,7 +127,7 @@ class WorkspaceManager2Test : public test::AshTestBase { test::AshTestBase::SetUp(); WorkspaceControllerTestHelper workspace_helper( Shell::TestApi(Shell::GetInstance()).workspace_controller()); - manager_ = workspace_helper.workspace_manager2(); + manager_ = workspace_helper.workspace_manager(); } virtual void TearDown() OVERRIDE { @@ -136,16 +136,16 @@ class WorkspaceManager2Test : public test::AshTestBase { } protected: - WorkspaceManager2* manager_; + WorkspaceManager* manager_; private: scoped_ptr<ActivationController> activation_controller_; - DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2Test); + DISALLOW_COPY_AND_ASSIGN(WorkspaceManagerTest); }; // Assertions around adding a normal window. -TEST_F(WorkspaceManager2Test, AddNormalWindowWhenEmpty) { +TEST_F(WorkspaceManagerTest, AddNormalWindowWhenEmpty) { scoped_ptr<Window> w1(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); @@ -166,7 +166,7 @@ TEST_F(WorkspaceManager2Test, AddNormalWindowWhenEmpty) { } // Assertions around maximizing/unmaximizing. -TEST_F(WorkspaceManager2Test, SingleMaximizeWindow) { +TEST_F(WorkspaceManagerTest, SingleMaximizeWindow) { scoped_ptr<Window> w1(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); @@ -203,7 +203,7 @@ TEST_F(WorkspaceManager2Test, SingleMaximizeWindow) { } // Assertions around closing the last window in a workspace. -TEST_F(WorkspaceManager2Test, CloseLastWindowInWorkspace) { +TEST_F(WorkspaceManagerTest, CloseLastWindowInWorkspace) { scoped_ptr<Window> w1(CreateTestWindow()); scoped_ptr<Window> w2(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); @@ -227,7 +227,7 @@ TEST_F(WorkspaceManager2Test, CloseLastWindowInWorkspace) { } // Assertions around adding a maximized window when empty. -TEST_F(WorkspaceManager2Test, AddMaximizedWindowWhenEmpty) { +TEST_F(WorkspaceManagerTest, AddMaximizedWindowWhenEmpty) { scoped_ptr<Window> w1(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); @@ -247,7 +247,7 @@ TEST_F(WorkspaceManager2Test, AddMaximizedWindowWhenEmpty) { } // Assertions around two windows and toggling one to be maximized. -TEST_F(WorkspaceManager2Test, MaximizeWithNormalWindow) { +TEST_F(WorkspaceManagerTest, MaximizeWithNormalWindow) { scoped_ptr<Window> w1(CreateTestWindow()); scoped_ptr<Window> w2(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); @@ -281,7 +281,7 @@ TEST_F(WorkspaceManager2Test, MaximizeWithNormalWindow) { } // Assertions around two maximized windows. -TEST_F(WorkspaceManager2Test, TwoMaximized) { +TEST_F(WorkspaceManagerTest, TwoMaximized) { scoped_ptr<Window> w1(CreateTestWindow()); scoped_ptr<Window> w2(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); @@ -305,7 +305,7 @@ TEST_F(WorkspaceManager2Test, TwoMaximized) { } // Makes sure requests to change the bounds of a normal window go through. -TEST_F(WorkspaceManager2Test, ChangeBoundsOfNormalWindow) { +TEST_F(WorkspaceManagerTest, ChangeBoundsOfNormalWindow) { scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); @@ -317,7 +317,7 @@ TEST_F(WorkspaceManager2Test, ChangeBoundsOfNormalWindow) { } // Verifies the bounds is not altered when showing and grid is enabled. -TEST_F(WorkspaceManager2Test, SnapToGrid) { +TEST_F(WorkspaceManagerTest, SnapToGrid) { scoped_ptr<Window> w1(CreateTestWindowUnparented()); w1->SetBounds(gfx::Rect(1, 6, 25, 30)); w1->SetParent(NULL); @@ -329,7 +329,7 @@ TEST_F(WorkspaceManager2Test, SnapToGrid) { } // Assertions around a fullscreen window. -TEST_F(WorkspaceManager2Test, SingleFullscreenWindow) { +TEST_F(WorkspaceManagerTest, SingleFullscreenWindow) { scoped_ptr<Window> w1(CreateTestWindow()); w1->SetBounds(gfx::Rect(0, 0, 250, 251)); // Make the window fullscreen. @@ -365,7 +365,7 @@ TEST_F(WorkspaceManager2Test, SingleFullscreenWindow) { } // Makes sure switching workspaces doesn't show transient windows. -TEST_F(WorkspaceManager2Test, DontShowTransientsOnSwitch) { +TEST_F(WorkspaceManagerTest, DontShowTransientsOnSwitch) { scoped_ptr<Window> w1(CreateTestWindow()); scoped_ptr<Window> w2(CreateTestWindow()); @@ -391,7 +391,7 @@ TEST_F(WorkspaceManager2Test, DontShowTransientsOnSwitch) { } // Assertions around minimizing a single window. -TEST_F(WorkspaceManager2Test, MinimizeSingleWindow) { +TEST_F(WorkspaceManagerTest, MinimizeSingleWindow) { scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); @@ -409,7 +409,7 @@ TEST_F(WorkspaceManager2Test, MinimizeSingleWindow) { } // Assertions around minimizing a maximized window. -TEST_F(WorkspaceManager2Test, MinimizeMaximizedWindow) { +TEST_F(WorkspaceManagerTest, MinimizeMaximizedWindow) { // Two windows, w1 normal, w2 maximized. scoped_ptr<Window> w1(CreateTestWindow()); scoped_ptr<Window> w2(CreateTestWindow()); @@ -453,7 +453,7 @@ TEST_F(WorkspaceManager2Test, MinimizeMaximizedWindow) { // Verifies ShelfLayoutManager's visibility/auto-hide state is correctly // updated. -TEST_F(WorkspaceManager2Test, ShelfStateUpdated) { +TEST_F(WorkspaceManagerTest, ShelfStateUpdated) { // Since ShelfLayoutManager queries for mouse location, move the mouse so // it isn't over the shelf. aura::test::EventGenerator generator( @@ -584,7 +584,7 @@ TEST_F(WorkspaceManager2Test, ShelfStateUpdated) { } // Verifies persist across all workspaces. -TEST_F(WorkspaceManager2Test, PersistAcrossAllWorkspaces) { +TEST_F(WorkspaceManagerTest, PersistAcrossAllWorkspaces) { // Create a maximized window. scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); @@ -631,7 +631,7 @@ TEST_F(WorkspaceManager2Test, PersistAcrossAllWorkspaces) { // Verifies that when a window persists across all workpaces is activated that // it moves to the current workspace. -TEST_F(WorkspaceManager2Test, ActivatePersistAcrossAllWorkspacesWhenNotActive) { +TEST_F(WorkspaceManagerTest, ActivatePersistAcrossAllWorkspacesWhenNotActive) { // Create a window that persists across all workspaces. scoped_ptr<Window> w2(CreateTestWindow()); SetPersistsAcrossAllWorkspaces( @@ -660,7 +660,7 @@ TEST_F(WorkspaceManager2Test, ActivatePersistAcrossAllWorkspacesWhenNotActive) { // Verifies Show()ing a minimized window that persists across all workspaces // unminimizes the window. -TEST_F(WorkspaceManager2Test, ShowMinimizedPersistWindow) { +TEST_F(WorkspaceManagerTest, ShowMinimizedPersistWindow) { // Create a window that persists across all workspaces. scoped_ptr<Window> w1(CreateTestWindow()); SetPersistsAcrossAllWorkspaces( @@ -676,7 +676,7 @@ TEST_F(WorkspaceManager2Test, ShowMinimizedPersistWindow) { // Test that we report we're in the fullscreen state even if the fullscreen // window isn't being managed by us (http://crbug.com/123931). -TEST_F(WorkspaceManager2Test, GetWindowStateWithUnmanagedFullscreenWindow) { +TEST_F(WorkspaceManagerTest, GetWindowStateWithUnmanagedFullscreenWindow) { ShelfLayoutManager* shelf = shelf_layout_manager(); // We need to create a regular window first so there's an active workspace. @@ -718,7 +718,7 @@ TEST_F(WorkspaceManager2Test, GetWindowStateWithUnmanagedFullscreenWindow) { // Variant of GetWindowStateWithUnmanagedFullscreenWindow that uses a maximized // window rather than a normal window. -TEST_F(WorkspaceManager2Test, +TEST_F(WorkspaceManagerTest, GetWindowStateWithUnmanagedFullscreenWindowWithMaximized) { ShelfLayoutManager* shelf = shelf_layout_manager(); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); @@ -757,7 +757,7 @@ TEST_F(WorkspaceManager2Test, // Verifies a window marked as persisting across all workspaces ends up in its // own workspace when maximized. -TEST_F(WorkspaceManager2Test, MaximizeDontPersistEndsUpInOwnWorkspace) { +TEST_F(WorkspaceManagerTest, MaximizeDontPersistEndsUpInOwnWorkspace) { scoped_ptr<Window> w1(CreateTestWindow()); SetPersistsAcrossAllWorkspaces( @@ -778,7 +778,7 @@ TEST_F(WorkspaceManager2Test, MaximizeDontPersistEndsUpInOwnWorkspace) { // Verifies going from maximized to minimized sets the right state for painting // the background of the launcher. -TEST_F(WorkspaceManager2Test, MinimizeResetsVisibility) { +TEST_F(WorkspaceManagerTest, MinimizeResetsVisibility) { scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); wm::ActivateWindow(w1.get()); @@ -790,7 +790,7 @@ TEST_F(WorkspaceManager2Test, MinimizeResetsVisibility) { } // Verifies transients are moved when maximizing. -TEST_F(WorkspaceManager2Test, MoveTransientOnMaximize) { +TEST_F(WorkspaceManagerTest, MoveTransientOnMaximize) { scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); scoped_ptr<Window> w2(CreateTestWindow()); @@ -823,7 +823,7 @@ TEST_F(WorkspaceManager2Test, MoveTransientOnMaximize) { } // Verifies window visibility during various workspace changes. -TEST_F(WorkspaceManager2Test, VisibilityTests) { +TEST_F(WorkspaceManagerTest, VisibilityTests) { scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); EXPECT_TRUE(w1->IsVisible()); @@ -880,7 +880,7 @@ TEST_F(WorkspaceManager2Test, VisibilityTests) { } // Verifies windows that are offscreen don't move when switching workspaces. -TEST_F(WorkspaceManager2Test, DontMoveOnSwitch) { +TEST_F(WorkspaceManagerTest, DontMoveOnSwitch) { aura::test::EventGenerator generator( Shell::GetPrimaryRootWindow(), gfx::Point()); generator.MoveMouseTo(0, 0); @@ -908,7 +908,7 @@ TEST_F(WorkspaceManager2Test, DontMoveOnSwitch) { // Verifies that windows that are completely offscreen move when switching // workspaces. -TEST_F(WorkspaceManager2Test, MoveOnSwitch) { +TEST_F(WorkspaceManagerTest, MoveOnSwitch) { aura::test::EventGenerator generator( Shell::GetPrimaryRootWindow(), gfx::Point()); generator.MoveMouseTo(0, 0); @@ -941,7 +941,7 @@ TEST_F(WorkspaceManager2Test, MoveOnSwitch) { } // Verifies Focus() works in a window that isn't in the active workspace. -TEST_F(WorkspaceManager2Test, FocusOnFullscreenInSeparateWorkspace) { +TEST_F(WorkspaceManagerTest, FocusOnFullscreenInSeparateWorkspace) { scoped_ptr<Window> w1(CreateTestWindow()); w1->SetBounds(gfx::Rect(10, 11, 250, 251)); w1->Show(); @@ -992,7 +992,7 @@ class DontCrashOnChangeAndActivateDelegate // . remove the window (which happens when switching displays). // . add the window back. // . show the window and during the bounds change activate it. -TEST_F(WorkspaceManager2Test, DontCrashOnChangeAndActivate) { +TEST_F(WorkspaceManagerTest, DontCrashOnChangeAndActivate) { // Force the shelf ShelfLayoutManager* shelf = shelf_layout_manager(); shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); @@ -1018,7 +1018,7 @@ TEST_F(WorkspaceManager2Test, DontCrashOnChangeAndActivate) { } // Verifies a window with a transient parent not managed by workspace works. -TEST_F(WorkspaceManager2Test, TransientParent) { +TEST_F(WorkspaceManagerTest, TransientParent) { // Normal window with no transient parent. scoped_ptr<Window> w2(CreateTestWindow()); w2->SetBounds(gfx::Rect(10, 11, 250, 251)); @@ -1040,7 +1040,7 @@ TEST_F(WorkspaceManager2Test, TransientParent) { } // Verifies changing TrackedByWorkspace works. -TEST_F(WorkspaceManager2Test, TrackedByWorkspace) { +TEST_F(WorkspaceManagerTest, TrackedByWorkspace) { // Create a window maximized. scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); @@ -1082,7 +1082,7 @@ TEST_F(WorkspaceManager2Test, TrackedByWorkspace) { // Verifies a window marked as persisting across all workspaces ends up in its // own workspace when maximized. -TEST_F(WorkspaceManager2Test, DeactivateDropsToDesktop) { +TEST_F(WorkspaceManagerTest, DeactivateDropsToDesktop) { // Create a window maximized. scoped_ptr<Window> w1(CreateTestWindow()); w1->Show(); @@ -1109,7 +1109,7 @@ TEST_F(WorkspaceManager2Test, DeactivateDropsToDesktop) { // Test the basic auto placement of one and or two windows in a "simulated // session" of sequential window operations. -TEST_F(WorkspaceManager2Test, BasicAutoPlacing) { +TEST_F(WorkspaceManagerTest, BasicAutoPlacing) { // Test 1: In case there is no manageable window, no window should shift. scoped_ptr<aura::Window> window1( @@ -1188,7 +1188,7 @@ TEST_F(WorkspaceManager2Test, BasicAutoPlacing) { } // Test the proper usage of user window movement interaction. -TEST_F(WorkspaceManager2Test, TestUserMovedWindowRepositioning) { +TEST_F(WorkspaceManagerTest, TestUserMovedWindowRepositioning) { scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); window1->SetBounds(gfx::Rect(16, 32, 640, 320)); @@ -1235,7 +1235,7 @@ TEST_F(WorkspaceManager2Test, TestUserMovedWindowRepositioning) { } // Test that a window from normal to minimize will repos the remaining. -TEST_F(WorkspaceManager2Test, ToMinimizeRepositionsRemaining) { +TEST_F(WorkspaceManagerTest, ToMinimizeRepositionsRemaining) { scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); ash::wm::SetWindowPositionManaged(window1.get(), true); @@ -1265,7 +1265,7 @@ TEST_F(WorkspaceManager2Test, ToMinimizeRepositionsRemaining) { } // Test that minimizing an initially maximized window will repos the remaining. -TEST_F(WorkspaceManager2Test, MaxToMinRepositionsRemaining) { +TEST_F(WorkspaceManagerTest, MaxToMinRepositionsRemaining) { scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); ash::wm::SetWindowPositionManaged(window1.get(), true); @@ -1288,7 +1288,7 @@ TEST_F(WorkspaceManager2Test, MaxToMinRepositionsRemaining) { } // Test that nomral, maximize, minimizing will repos the remaining. -TEST_F(WorkspaceManager2Test, NormToMaxToMinRepositionsRemaining) { +TEST_F(WorkspaceManagerTest, NormToMaxToMinRepositionsRemaining) { scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); window1->SetBounds(gfx::Rect(16, 32, 640, 320)); @@ -1322,7 +1322,7 @@ TEST_F(WorkspaceManager2Test, NormToMaxToMinRepositionsRemaining) { } // Test that nomral, maximize, normal will repos the remaining. -TEST_F(WorkspaceManager2Test, NormToMaxToNormRepositionsRemaining) { +TEST_F(WorkspaceManagerTest, NormToMaxToNormRepositionsRemaining) { scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); window1->SetBounds(gfx::Rect(16, 32, 640, 320)); @@ -1355,7 +1355,7 @@ TEST_F(WorkspaceManager2Test, NormToMaxToNormRepositionsRemaining) { } // Test that animations are triggered. -TEST_F(WorkspaceManager2Test, AnimatedNormToMaxToNormRepositionsRemaining) { +TEST_F(WorkspaceManagerTest, AnimatedNormToMaxToNormRepositionsRemaining) { ui::LayerAnimator::set_disable_animations_for_test(false); scoped_ptr<aura::Window> window1( aura::test::CreateTestWindowWithId(0, NULL)); diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 0b1976c..969ad1f 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -18,7 +18,7 @@ #include "ash/wm/workspace_controller.h" #include "ash/wm/workspace/snap_sizer.h" #include "ash/wm/workspace/phantom_window_controller.h" -#include "ash/wm/workspace/workspace_layout_manager2.h" +#include "ash/wm/workspace/workspace_layout_manager.h" #include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "ui/aura/root_window.h" diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc index 97caf1b..0f73984 100644 --- a/ash/wm/workspace_controller.cc +++ b/ash/wm/workspace_controller.cc @@ -6,7 +6,7 @@ #include "ash/ash_switches.h" #include "ash/wm/window_util.h" -#include "ash/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace_manager.h" #include "base/command_line.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/aura_constants.h" @@ -19,7 +19,7 @@ namespace internal { WorkspaceController::WorkspaceController(aura::Window* viewport) : viewport_(viewport) { aura::RootWindow* root_window = viewport->GetRootWindow(); - workspace_manager_.reset(new WorkspaceManager2(viewport)); + workspace_manager_.reset(new WorkspaceManager(viewport)); aura::client::GetActivationClient(root_window)->AddObserver(this); } diff --git a/ash/wm/workspace_controller.h b/ash/wm/workspace_controller.h index 44e0704..aa84592 100644 --- a/ash/wm/workspace_controller.h +++ b/ash/wm/workspace_controller.h @@ -21,7 +21,7 @@ namespace internal { class ShelfLayoutManager; class WorkspaceControllerTestHelper; class WorkspaceEventHandler; -class WorkspaceManager2; +class WorkspaceManager; // WorkspaceController acts as a central place that ties together all the // various workspace pieces. @@ -54,7 +54,7 @@ class ASH_EXPORT WorkspaceController aura::Window* viewport_; - scoped_ptr<WorkspaceManager2> workspace_manager_; + scoped_ptr<WorkspaceManager> workspace_manager_; DISALLOW_COPY_AND_ASSIGN(WorkspaceController); }; diff --git a/ash/wm/workspace_controller_test_helper.h b/ash/wm/workspace_controller_test_helper.h index 3a0ebe1..7c8bc85 100644 --- a/ash/wm/workspace_controller_test_helper.h +++ b/ash/wm/workspace_controller_test_helper.h @@ -6,7 +6,7 @@ #define ASH_WM_WORKSPACE_CONTROLLER_TEST_HELPER_H_ #include "ash/wm/workspace_controller.h" -#include "ash/wm/workspace/workspace_manager2.h" +#include "ash/wm/workspace/workspace_manager.h" namespace ash { namespace internal { @@ -21,7 +21,7 @@ class WorkspaceControllerTestHelper { WorkspaceEventHandler* GetEventHandler(); MultiWindowResizeController* GetMultiWindowResizeController(); - WorkspaceManager2* workspace_manager2() { + WorkspaceManager* workspace_manager() { return controller_->workspace_manager_.get(); } |