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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 private: | 41 private: |
42 ScreenDimmer* dimmer_; // not owned | 42 ScreenDimmer* dimmer_; // not owned |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(TestApi); | 44 DISALLOW_COPY_AND_ASSIGN(TestApi); |
45 }; | 45 }; |
46 | 46 |
47 explicit ScreenDimmer(aura::RootWindow* root_window); | 47 explicit ScreenDimmer(aura::RootWindow* root_window); |
48 virtual ~ScreenDimmer(); | 48 virtual ~ScreenDimmer(); |
49 | 49 |
50 // Dim or undim the screen. | 50 // Dim or undim the root window. |
51 void SetDimming(bool should_dim); | 51 void SetDimming(bool should_dim); |
52 | 52 |
53 // aura::RootWindowObserver overrides: | 53 // aura::RootWindowObserver overrides: |
54 virtual void OnRootWindowResized(const aura::RootWindow* root, | 54 virtual void OnRootWindowResized(const aura::RootWindow* root, |
55 const gfx::Size& old_size) OVERRIDE; | 55 const gfx::Size& old_size) OVERRIDE; |
56 | 56 |
57 private: | 57 private: |
58 friend class TestApi; | 58 friend class TestApi; |
59 | 59 |
60 aura::RootWindow* root_window_; | 60 aura::RootWindow* root_window_; |
61 | 61 |
62 // Partially-opaque layer that's stacked above all of the root window's | 62 // Partially-opaque layer that's stacked above all of the root window's |
63 // children and used to dim the screen. NULL until the first time we dim. | 63 // children and used to dim the screen. NULL until the first time we dim. |
64 scoped_ptr<ui::Layer> dimming_layer_; | 64 scoped_ptr<ui::Layer> dimming_layer_; |
65 | 65 |
66 // Are we currently dimming the screen? | 66 // Are we currently dimming the screen? |
67 bool currently_dimming_; | 67 bool currently_dimming_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); | 69 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace internal | 72 } // namespace internal |
73 } // namespace ash | 73 } // namespace ash |
74 | 74 |
75 #endif // ASH_WM_SCREEN_DIMMER_H_ | 75 #endif // ASH_WM_SCREEN_DIMMER_H_ |
OLD | NEW |