summaryrefslogtreecommitdiffstats
path: root/ash/wm/shadow_controller.cc
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-17 19:15:58 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-17 19:15:58 +0000
commit67961f6f418b4adc346855258ee09c774a0ea273 (patch)
tree85cc48122431d15ab8e36c0d363ec2b677303a67 /ash/wm/shadow_controller.cc
parentcc36c27b16091fdb2dcb14de222f50d5c9db7ffd (diff)
downloadchromium_src-67961f6f418b4adc346855258ee09c774a0ea273.zip
chromium_src-67961f6f418b4adc346855258ee09c774a0ea273.tar.gz
chromium_src-67961f6f418b4adc346855258ee09c774a0ea273.tar.bz2
Revert 122547 - Aura: New window shadows, desktop background debug toggle
+ Shadows support different appearances for active and inactive states. + Shadow opacity animates on activation change. + ImageGrid supports changing its images, allowing us to maintain our use of a single set of shadow layers per window. + Press control-alt-B in a debug build to reset the desktop background to a solid color, useful with a white background for testing shadows. + Window shadow art assets were added in an earlier revision. After this change lands I will delete the previous art assets, ui/resources/aura/shadow_rect_* BUG=113075 TEST=aura_shell_unittests, added to ShadowControllerTest and ImageGridTest Review URL: https://chromiumcodereview.appspot.com/9414028 TBR=jamescook@chromium.org Review URL: https://chromiumcodereview.appspot.com/9355013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/shadow_controller.cc')
-rw-r--r--ash/wm/shadow_controller.cc28
1 files changed, 4 insertions, 24 deletions
diff --git a/ash/wm/shadow_controller.cc b/ash/wm/shadow_controller.cc
index ed7af82..2f75453 100644
--- a/ash/wm/shadow_controller.cc
+++ b/ash/wm/shadow_controller.cc
@@ -12,7 +12,6 @@
#include "ash/wm/window_properties.h"
#include "base/command_line.h"
#include "base/logging.h"
-#include "ui/aura/client/activation_client.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -32,6 +31,9 @@ ShadowType GetShadowTypeFromWindow(aura::Window* window) {
switch (window->type()) {
case aura::client::WINDOW_TYPE_NORMAL:
case aura::client::WINDOW_TYPE_PANEL:
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAuraTranslucentFrames) ?
+ SHADOW_TYPE_NONE : SHADOW_TYPE_RECTANGULAR;
case aura::client::WINDOW_TYPE_MENU:
case aura::client::WINDOW_TYPE_TOOLTIP:
return SHADOW_TYPE_RECTANGULAR;
@@ -45,8 +47,6 @@ ShadowType GetShadowTypeFromWindow(aura::Window* window) {
ShadowController::ShadowController() {
aura::Env::GetInstance()->AddObserver(this);
- // Watch for window activation changes.
- aura::RootWindow::GetInstance()->AddObserver(this);
}
ShadowController::~ShadowController() {
@@ -54,7 +54,6 @@ ShadowController::~ShadowController() {
it != window_shadows_.end(); ++it) {
it->first->RemoveObserver(this);
}
- aura::RootWindow::GetInstance()->RemoveObserver(this);
aura::Env::GetInstance()->RemoveObserver(this);
}
@@ -67,20 +66,8 @@ void ShadowController::OnWindowInitialized(aura::Window* window) {
void ShadowController::OnWindowPropertyChanged(aura::Window* window,
const void* key,
intptr_t old) {
- if (key == kShadowTypeKey) {
+ if (key == kShadowTypeKey)
HandlePossibleShadowVisibilityChange(window);
- return;
- }
- if (key == aura::client::kRootWindowActiveWindowKey) {
- aura::Window* inactive = reinterpret_cast<aura::Window*>(old);
- if (inactive)
- HandleWindowActivationChange(inactive, false);
- aura::Window* active =
- window->GetProperty(aura::client::kRootWindowActiveWindowKey);
- if (active)
- HandleWindowActivationChange(active, true);
- return;
- }
}
void ShadowController::OnWindowBoundsChanged(aura::Window* window,
@@ -112,13 +99,6 @@ Shadow* ShadowController::GetShadowForWindow(aura::Window* window) {
return it != window_shadows_.end() ? it->second.get() : NULL;
}
-void ShadowController::HandleWindowActivationChange(aura::Window* window,
- bool active) {
- Shadow* shadow = GetShadowForWindow(window);
- if (shadow)
- shadow->SetStyle(active ? Shadow::STYLE_ACTIVE : Shadow::STYLE_INACTIVE);
-}
-
void ShadowController::HandlePossibleShadowVisibilityChange(
aura::Window* window) {
const bool should_show = ShouldShowShadowForWindow(window);