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

Unified Diff: ash/wm/workspace/workspace_manager2.cc

Issue 10875070: Makes workspace 2 show an alternate background (system background) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/workspace_manager2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « ash/wm/workspace/workspace_manager2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698