Index: ash/wm/workspace/workspace_manager2.cc |
diff --git a/ash/wm/workspace/workspace_manager2.cc b/ash/wm/workspace/workspace_manager2.cc |
index e57150eae99643487fb59e6400cee40e4d9278ef..897ce6c4bbe5d6eaeb5dfeede1a8fe0385602a74 100644 |
--- a/ash/wm/workspace/workspace_manager2.cc |
+++ b/ash/wm/workspace/workspace_manager2.cc |
@@ -18,6 +18,7 @@ |
#include "ash/wm/window_animations.h" |
#include "ash/wm/window_properties.h" |
#include "ash/wm/window_util.h" |
+#include "ash/wm/workspace/system_background_controller.h" |
#include "ash/wm/workspace/workspace_layout_manager2.h" |
#include "ash/wm/workspace/workspace2.h" |
#include "base/auto_reset.h" |
@@ -265,6 +266,16 @@ void WorkspaceManager2::SetActiveWorkspace(Workspace2* workspace, |
Workspace2* last_active = active_workspace_; |
active_workspace_ = workspace; |
+ destroy_background_timer_.Stop(); |
+ if (active_workspace_ == desktop_workspace()) { |
+ destroy_background_timer_.Start( |
+ FROM_HERE, GetSystemBackgroundDestroyDuration(), |
+ this, &WorkspaceManager2::DestroySystemBackground); |
+ } else if (!background_controller_.get()) { |
+ background_controller_.reset(new SystemBackgroundController( |
+ contents_view_->GetRootWindow())); |
+ } |
+ |
UpdateShelfVisibility(); |
if (animate_type != ANIMATE_NONE) { |
@@ -368,6 +379,10 @@ void WorkspaceManager2::ScheduleDelete(Workspace2* workspace) { |
&WorkspaceManager2::ProcessDeletion); |
} |
+void WorkspaceManager2::DestroySystemBackground() { |
+ background_controller_.reset(); |
+} |
+ |
void WorkspaceManager2::ProcessDeletion() { |
std::set<Workspace2*> to_delete; |
to_delete.swap(to_delete_); |