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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class Layer; | 15 class Layer; |
16 } | 16 } |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace internal { | |
20 | 19 |
21 // ScreenDimmer displays a partially-opaque layer above everything | 20 // ScreenDimmer displays a partially-opaque layer above everything |
22 // else in the root window to darken the display. It shouldn't be used | 21 // else in the root window to darken the display. It shouldn't be used |
23 // for long-term brightness adjustments due to performance | 22 // for long-term brightness adjustments due to performance |
24 // considerations -- it's only intended for cases where we want to | 23 // considerations -- it's only intended for cases where we want to |
25 // briefly dim the screen (e.g. to indicate to the user that we're | 24 // briefly dim the screen (e.g. to indicate to the user that we're |
26 // about to suspend a machine that lacks an internal backlight that | 25 // about to suspend a machine that lacks an internal backlight that |
27 // can be adjusted). | 26 // can be adjusted). |
28 class ASH_EXPORT ScreenDimmer : public aura::WindowObserver { | 27 class ASH_EXPORT ScreenDimmer : public aura::WindowObserver { |
29 public: | 28 public: |
(...skipping 28 matching lines...) Expand all Loading... |
58 // 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 |
59 // 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. |
60 scoped_ptr<ui::Layer> dimming_layer_; | 59 scoped_ptr<ui::Layer> dimming_layer_; |
61 | 60 |
62 // Are we currently dimming the screen? | 61 // Are we currently dimming the screen? |
63 bool currently_dimming_; | 62 bool currently_dimming_; |
64 | 63 |
65 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); | 64 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); |
66 }; | 65 }; |
67 | 66 |
68 } // namespace internal | |
69 } // namespace ash | 67 } // namespace ash |
70 | 68 |
71 #endif // ASH_WM_SCREEN_DIMMER_H_ | 69 #endif // ASH_WM_SCREEN_DIMMER_H_ |
OLD | NEW |