[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / ui / wm / core / shadow_controller.h
blobb307c02e77697407ee7ac25cb4952b7ae16529b3
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_WM_CORE_SHADOW_CONTROLLER_H_
6 #define UI_WM_CORE_SHADOW_CONTROLLER_H_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h"
13 #include "ui/wm/public/activation_change_observer.h"
14 #include "ui/wm/wm_export.h"
16 namespace aura {
17 class Window;
18 namespace client {
19 class ActivationClient;
22 namespace gfx {
23 class Rect;
26 namespace wm {
28 class Shadow;
30 // ShadowController observes changes to windows and creates and updates drop
31 // shadows as needed. ShadowController itself is light weight and per
32 // ActivationClient. ShadowController delegates to its implementation class,
33 // which observes all window creation.
34 class WM_EXPORT ShadowController :
35 public aura::client::ActivationChangeObserver {
36 public:
37 class WM_EXPORT TestApi {
38 public:
39 explicit TestApi(ShadowController* controller) : controller_(controller) {}
40 ~TestApi() {}
42 Shadow* GetShadowForWindow(aura::Window* window);
44 private:
45 ShadowController* controller_; // not owned
47 DISALLOW_COPY_AND_ASSIGN(TestApi);
50 explicit ShadowController(aura::client::ActivationClient* activation_client);
51 ~ShadowController() override;
53 // aura::client::ActivationChangeObserver overrides:
54 void OnWindowActivated(
55 aura::client::ActivationChangeObserver::ActivationReason reason,
56 aura::Window* gained_active,
57 aura::Window* lost_active) override;
59 private:
60 class Impl;
62 aura::client::ActivationClient* activation_client_;
64 scoped_refptr<Impl> impl_;
66 DISALLOW_COPY_AND_ASSIGN(ShadowController);
69 } // namespace wm
71 #endif // UI_WM_CORE_SHADOW_CONTROLLER_H_