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

Unified Diff: athena/wm/window_overview_mode.cc

Issue 335673003: athena: Add shadows to the windows in overview mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/window_overview_mode.cc
diff --git a/athena/wm/window_overview_mode.cc b/athena/wm/window_overview_mode.cc
index 8c98bcb0190a31cb37947aec481a894f7fadda2d..dc984ec4b2ba3af6e2d88cd9405d0db77323ce34 100644
--- a/athena/wm/window_overview_mode.cc
+++ b/athena/wm/window_overview_mode.cc
@@ -17,6 +17,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/transform.h"
+#include "ui/wm/core/shadow.h"
namespace {
@@ -102,6 +103,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
// state on the windows.
ComputeTerminalStatesForAllWindows();
SetInitialWindowStates();
+ AddShadowsForWindows();
}
virtual ~WindowOverviewModeImpl() {
@@ -187,6 +189,26 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
}
}
+ void AddShadowsForWindows() {
+ aura::Window::Windows windows = container_->children();
+ if (windows.empty())
+ return;
+ std::for_each(
+ windows.begin(),
+ windows.end(),
+ std::bind1st(std::mem_fun(&WindowOverviewModeImpl::AddShadowForWindow),
+ this));
+ }
+
+ void AddShadowForWindow(aura::Window* window) {
+ wm::Shadow* shadow = new wm::Shadow();
+ shadows_.push_back(shadow);
+ shadow->Init(wm::Shadow::STYLE_ACTIVE);
+ shadow->SetContentBounds(gfx::Rect(window->bounds().size()));
+ shadow->layer()->SetVisible(true);
+ window->layer()->Add(shadow->layer());
+ }
+
aura::Window* SelectWindowAt(ui::LocatedEvent* event) {
CHECK_EQ(container_, event->target());
// Find the old targeter to find the target of the event.
@@ -229,6 +251,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
aura::Window* container_;
WindowOverviewModeDelegate* delegate_;
scoped_ptr<aura::ScopedWindowTargeter> scoped_targeter_;
+ ScopedVector<wm::Shadow> shadows_;
oshima 2014/06/12 19:15:24 can't you store the shadow in the state object?
sadrul 2014/06/12 19:37:51 Good idea! done.
DISALLOW_COPY_AND_ASSIGN(WindowOverviewModeImpl);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698