diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 20:37:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 20:37:00 +0000 |
commit | 86f2b5e1870debcf167d3a9c8901541db279406b (patch) | |
tree | 4f828329ad8b07293370402e7d76457af7a714c4 /ash/wm/shadow_controller.h | |
parent | 31882ba1222e0f89e2712d174879dacd4525e64c (diff) | |
download | chromium_src-86f2b5e1870debcf167d3a9c8901541db279406b.zip chromium_src-86f2b5e1870debcf167d3a9c8901541db279406b.tar.gz chromium_src-86f2b5e1870debcf167d3a9c8901541db279406b.tar.bz2 |
Move shadow code to views\corewm
http://crbug.com/158115
R=derat@chromium.org
Review URL: https://codereview.chromium.org/11275296
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/shadow_controller.h')
-rw-r--r-- | ash/wm/shadow_controller.h | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/ash/wm/shadow_controller.h b/ash/wm/shadow_controller.h deleted file mode 100644 index c3c3702..0000000 --- a/ash/wm/shadow_controller.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_SHADOW_CONTROLLER_H_ -#define ASH_WM_SHADOW_CONTROLLER_H_ - -#include <map> - -#include "ash/ash_export.h" -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/linked_ptr.h" -#include "base/scoped_observer.h" -#include "ui/aura/client/activation_change_observer.h" -#include "ui/aura/env_observer.h" -#include "ui/aura/window_observer.h" - -namespace aura { -class Window; -} -namespace gfx { -class Rect; -} - -namespace ash { -namespace internal { - -class Shadow; - -// ShadowController observes changes to windows and creates and updates drop -// shadows as needed. -class ASH_EXPORT ShadowController : - public aura::EnvObserver, - public aura::WindowObserver, - public aura::client::ActivationChangeObserver { - public: - class TestApi { - public: - explicit TestApi(ShadowController* controller) : controller_(controller) {} - ~TestApi() {} - - Shadow* GetShadowForWindow(aura::Window* window) { - return controller_->GetShadowForWindow(window); - } - - private: - ShadowController* controller_; // not owned - - DISALLOW_COPY_AND_ASSIGN(TestApi); - }; - - explicit ShadowController(); - virtual ~ShadowController(); - - // aura::EnvObserver override: - virtual void OnWindowInitialized(aura::Window* window) OVERRIDE; - - // aura::WindowObserver overrides: - virtual void OnWindowPropertyChanged( - aura::Window* window, const void* key, intptr_t old) OVERRIDE; - virtual void OnWindowBoundsChanged( - aura::Window* window, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) OVERRIDE; - virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; - - // aura::client::ActivationChangeObserver overrides: - virtual void OnWindowActivated(aura::Window* active, - aura::Window* old_active) OVERRIDE; - - private: - typedef std::map<aura::Window*, linked_ptr<Shadow> > WindowShadowMap; - - // Checks if |window| is visible and contains a property requesting a shadow. - bool ShouldShowShadowForWindow(aura::Window* window) const; - - // Returns |window|'s shadow from |window_shadows_|, or NULL if no shadow - // exists. - Shadow* GetShadowForWindow(aura::Window* window); - - // Updates the shadow styles for windows when activation changes. - void HandleWindowActivationChange(aura::Window* gaining_active, - aura::Window* losing_active); - - // Shows or hides |window|'s shadow as needed (creating the shadow if - // necessary). - void HandlePossibleShadowVisibilityChange(aura::Window* window); - - // Creates a new shadow for |window| and stores it in |window_shadows_|. The - // shadow's bounds are initialized and it is added to the window's layer. - void CreateShadowForWindow(aura::Window* window); - - WindowShadowMap window_shadows_; - - ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; - - DISALLOW_COPY_AND_ASSIGN(ShadowController); -}; - -} // namespace internal -} // namespace ash - -#endif // ASH_WM_SHADOW_CONTROLLER_H_ |