Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: ash/wm/screen_dimmer.h

Issue 2320273002: Refactors DimWindow and moves to ash/common (Closed)
Patch Set: git add wm_window Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ash/common/shell_observer.h" 9 #include "ash/common/shell_observer.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.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 class DimWindow; 19 class DimWindow;
20 20
21 // ScreenDimmer displays a partially-opaque layer above everything 21 // ScreenDimmer displays a partially-opaque layer above everything
22 // else in the given container window to darken the display. It shouldn't be 22 // else in the given container window to darken the display. It shouldn't be
23 // used for long-term brightness adjustments due to performance 23 // used for long-term brightness adjustments due to performance
24 // considerations -- it's only intended for cases where we want to 24 // 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 25 // 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 26 // about to suspend a machine that lacks an internal backlight that
27 // can be adjusted). 27 // can be adjusted).
28 class ASH_EXPORT ScreenDimmer : ShellObserver { 28 class ASH_EXPORT ScreenDimmer : public ShellObserver {
29 public: 29 public:
30 // Creates a screen dimmer for the containers given by |container_id|. 30 // Creates a screen dimmer for the containers given by |container_id|.
31 // It's owned by the container in the primary root window and will be 31 // It's owned by the container in the primary root window and will be
32 // destroyed when the container is destroyed. 32 // destroyed when the container is destroyed.
33 static ScreenDimmer* GetForContainer(int container_id); 33 static ScreenDimmer* GetForContainer(int container_id);
34 34
35 // Creates a dimmer a root window level. This is used for suspend animation. 35 // Creates a dimmer a root window level. This is used for suspend animation.
36 static ScreenDimmer* GetForRoot(); 36 static ScreenDimmer* GetForRoot();
37 37
38 ~ScreenDimmer() override; 38 ~ScreenDimmer() override;
(...skipping 26 matching lines...) Expand all
65 // Are we currently dimming the screen? 65 // Are we currently dimming the screen?
66 bool is_dimming_; 66 bool is_dimming_;
67 bool at_bottom_; 67 bool at_bottom_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer); 69 DISALLOW_COPY_AND_ASSIGN(ScreenDimmer);
70 }; 70 };
71 71
72 } // namespace ash 72 } // namespace ash
73 73
74 #endif // ASH_WM_SCREEN_DIMMER_H_ 74 #endif // ASH_WM_SCREEN_DIMMER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698