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

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: . 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..af7ddcd856ea3836fbef242189972a6a543ede73 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 {
@@ -30,6 +31,8 @@ struct WindowOverviewState {
// 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.
float progress;
+
+ scoped_ptr<wm::Shadow> shadow;
};
} // namespace
@@ -149,6 +152,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
state->top = top_transform;
state->bottom = bottom_transform;
state->progress = 0.f;
+ state->shadow = CreateShadowForWindow(window);
window->SetProperty(kWindowOverviewState, state);
}
}
@@ -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) {
CHECK_EQ(container_, event->target());
// Find the old targeter to find the target of the event.
« 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