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

Unified Diff: ash/wm/screen_pinning_controller.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/screen_dimmer_unittest.cc ('k') | ash/wm/screen_pinning_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/screen_pinning_controller.h
diff --git a/ash/wm/screen_pinning_controller.h b/ash/wm/screen_pinning_controller.h
index 202565a370de719d5c3baaf7c7a9d869acf2817d..3245c60977d3230ec72eb13a33b39b4c18c81b53 100644
--- a/ash/wm/screen_pinning_controller.h
+++ b/ash/wm/screen_pinning_controller.h
@@ -13,9 +13,13 @@
namespace ash {
+class WindowDimmer;
class WindowTreeHostManager;
class WmWindow;
+template <typename UserData>
+class WmWindowUserData;
+
// Handles pinned state.
class ScreenPinningController : public WindowTreeHostManager::Observer {
public:
@@ -54,15 +58,11 @@ class ScreenPinningController : public WindowTreeHostManager::Observer {
// Called when a window stacking is changed in a system modal container.
void OnSystemModalContainerWindowStackingChanged(WmWindow* window);
- // Called when a dim window in the system modal container is destroying.
- void OnDimWindowDestroying(WmWindow* window);
-
private:
class PinnedContainerWindowObserver;
class PinnedContainerChildWindowObserver;
class SystemModalContainerWindowObserver;
class SystemModalContainerChildWindowObserver;
- class DimWindowObserver;
// Keeps the pinned window on top of the siblings.
void KeepPinnedWindowOnTop();
@@ -70,19 +70,20 @@ class ScreenPinningController : public WindowTreeHostManager::Observer {
// Keeps the dim window at bottom of the container.
void KeepDimWindowAtBottom(WmWindow* container);
+ // Creates a WindowDimmer for |container| and places it in |window_dimmers_|.
+ // Returns the window from WindowDimmer.
+ WmWindow* CreateWindowDimmer(WmWindow* container);
+
// WindowTreeHostManager::Observer:
void OnDisplayConfigurationChanged() override;
// Pinned window should be on top in the parent window.
WmWindow* pinned_window_ = nullptr;
- // Dim background window just behind of the pinned window.
- // Not owned. The parent has its ownership.
- WmWindow* background_window_ = nullptr;
-
- // In pinned mode, all displays other than the one where pinned_window_ is.
- // Similar to background_window_, not owned.
- std::vector<WmWindow*> dim_windows_;
+ // Owns the WindowDimmers. There is one WindowDimmer for the parent of
+ // |pinned_window_| and one for each display other than the display
+ // |pinned_window_| is on.
+ std::unique_ptr<WmWindowUserData<WindowDimmer>> window_dimmers_;
// Set true only when restacking done by this controller.
bool in_restacking_ = false;
@@ -101,7 +102,6 @@ class ScreenPinningController : public WindowTreeHostManager::Observer {
system_modal_container_window_observer_;
std::unique_ptr<SystemModalContainerChildWindowObserver>
system_modal_container_child_window_observer_;
- std::unique_ptr<DimWindowObserver> dim_window_observer_;
DISALLOW_COPY_AND_ASSIGN(ScreenPinningController);
};
« no previous file with comments | « ash/wm/screen_dimmer_unittest.cc ('k') | ash/wm/screen_pinning_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698