Commit 912d3900 authored by sadrul@chromium.org's avatar sadrul@chromium.org

athena: Add shadows to the windows in overview mode.

Add shadows to the windows in overview mode. The shadows are destroyed when
going out of overview mode.

BUG=376353
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/335673003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276807 0039d316-1c4b-4281-b951-d872f2087c98
parent 88c8a27d
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/events/event_handler.h" #include "ui/events/event_handler.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
#include "ui/wm/core/shadow.h"
namespace { namespace {
...@@ -30,6 +31,8 @@ struct WindowOverviewState { ...@@ -30,6 +31,8 @@ struct WindowOverviewState {
// The current overview state of the window. 0.f means the window is at the // The current overview state of the window. 0.f means the window is at the
// topmost position. 1.f means the window is at the bottom-most position. // topmost position. 1.f means the window is at the bottom-most position.
float progress; float progress;
scoped_ptr<wm::Shadow> shadow;
}; };
} // namespace } // namespace
...@@ -149,6 +152,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode, ...@@ -149,6 +152,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
state->top = top_transform; state->top = top_transform;
state->bottom = bottom_transform; state->bottom = bottom_transform;
state->progress = 0.f; state->progress = 0.f;
state->shadow = CreateShadowForWindow(window);
window->SetProperty(kWindowOverviewState, state); window->SetProperty(kWindowOverviewState, state);
} }
} }
...@@ -187,6 +191,15 @@ class WindowOverviewModeImpl : public WindowOverviewMode, ...@@ -187,6 +191,15 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
} }
} }
scoped_ptr<wm::Shadow> CreateShadowForWindow(aura::Window* window) {
scoped_ptr<wm::Shadow> shadow(new wm::Shadow());
shadow->Init(wm::Shadow::STYLE_ACTIVE);
shadow->SetContentBounds(gfx::Rect(window->bounds().size()));
shadow->layer()->SetVisible(true);
window->layer()->Add(shadow->layer());
return shadow.Pass();
}
aura::Window* SelectWindowAt(ui::LocatedEvent* event) { aura::Window* SelectWindowAt(ui::LocatedEvent* event) {
CHECK_EQ(container_, event->target()); CHECK_EQ(container_, event->target());
// Find the old targeter to find the target of the event. // Find the old targeter to find the target of the event.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment