OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_WM_SCREEN_DIMMER_H_ | 5 #ifndef ASH_WM_SCREEN_DIMMER_H_ |
6 #define ASH_WM_SCREEN_DIMMER_H_ | 6 #define ASH_WM_SCREEN_DIMMER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 explicit ScreenDimmer(aura::Window* root_window); | 41 explicit ScreenDimmer(aura::Window* root_window); |
42 virtual ~ScreenDimmer(); | 42 virtual ~ScreenDimmer(); |
43 | 43 |
44 // Dim or undim the root window. | 44 // Dim or undim the root window. |
45 void SetDimming(bool should_dim); | 45 void SetDimming(bool should_dim); |
46 | 46 |
47 // aura::WindowObserver overrides: | 47 // aura::WindowObserver overrides: |
48 virtual void OnWindowBoundsChanged(aura::Window* root_window, | 48 virtual void OnWindowBoundsChanged(aura::Window* root_window, |
49 const gfx::Rect& old_bounds, | 49 const gfx::Rect& old_bounds, |
50 const gfx::Rect& new_bounds) OVERRIDE; | 50 const gfx::Rect& new_bounds) override; |
51 | 51 |
52 private: | 52 private: |
53 friend class TestApi; | 53 friend class TestApi; |
54 | 54 |
55 aura::Window* root_window_; | 55 aura::Window* root_window_; |
56 | 56 |
57 // Partially-opaque layer that's stacked above all of the root window's | 57 // Partially-opaque layer that's stacked above all of the root window's |
58 // children and used to dim the screen. NULL until the first time we dim. | 58 // children and used to dim the screen. NULL until the first time we dim. |
59 scoped_ptr<ui::Layer> dimming_layer_; | 59 scoped_ptr<ui::Layer> dimming_layer_; |
60 | 60 |
61 // Are we currently dimming the screen? | 61 // Are we currently dimming the screen? |
62 bool currently_dimming_; | 62 bool currently_dimming_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); | 64 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace ash | 67 } // namespace ash |
68 | 68 |
69 #endif // ASH_WM_SCREEN_DIMMER_H_ | 69 #endif // ASH_WM_SCREEN_DIMMER_H_ |
OLD | NEW |