Chromium Code Reviews| 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); |
| }; |