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

Unified Diff: ash/wm/screen_dimmer.h

Issue 2320273002: Refactors DimWindow and moves to ash/common (Closed)
Patch Set: feedback and member initializer ordering 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/dim_window.cc ('k') | ash/wm/screen_dimmer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/screen_dimmer.h
diff --git a/ash/wm/screen_dimmer.h b/ash/wm/screen_dimmer.h
index 40c1c4ca200ed39b4cf9c211c4802f3501b01e2e..d752e92ce48ac7de2d2252e902bcfcfc77f16cf1 100644
--- a/ash/wm/screen_dimmer.h
+++ b/ash/wm/screen_dimmer.h
@@ -5,6 +5,8 @@
#ifndef ASH_WM_SCREEN_DIMMER_H_
#define ASH_WM_SCREEN_DIMMER_H_
+#include <memory>
+
#include "ash/ash_export.h"
#include "ash/common/shell_observer.h"
#include "base/compiler_specific.h"
@@ -16,7 +18,14 @@ class Layer;
}
namespace ash {
-class DimWindow;
+namespace test {
+class ScreenDimmerTest;
+}
+
+class WindowDimmer;
+
+template <typename UserData>
+class WmWindowUserData;
// ScreenDimmer displays a partially-opaque layer above everything
// else in the given container window to darken the display. It shouldn't be
@@ -25,7 +34,7 @@ class DimWindow;
// briefly dim the screen (e.g. to indicate to the user that we're
// about to suspend a machine that lacks an internal backlight that
// can be adjusted).
-class ASH_EXPORT ScreenDimmer : ShellObserver {
+class ASH_EXPORT ScreenDimmer : public ShellObserver {
public:
// Creates a screen dimmer for the containers given by |container_id|.
// It's owned by the container in the primary root window and will be
@@ -48,10 +57,12 @@ class ASH_EXPORT ScreenDimmer : ShellObserver {
static ScreenDimmer* FindForTest(int container_id);
private:
- static aura::Window* FindContainer(int container_id);
+ friend class test::ScreenDimmerTest;
explicit ScreenDimmer(int container_id);
+ static aura::Window* FindContainer(int container_id);
+
// ShellObserver:
void OnRootWindowAdded(WmWindow* root_window) override;
@@ -66,6 +77,9 @@ class ASH_EXPORT ScreenDimmer : ShellObserver {
bool is_dimming_;
bool at_bottom_;
+ // Owns the WindowDimmers.
+ std::unique_ptr<WmWindowUserData<WindowDimmer>> window_dimmers_;
+
DISALLOW_COPY_AND_ASSIGN(ScreenDimmer);
};
« no previous file with comments | « ash/wm/dim_window.cc ('k') | ash/wm/screen_dimmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698