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

Unified Diff: ash/common/shelf/shelf_window_watcher.h

Issue 2462753002: Use Ash's ShelfWindowWatcher for app panel windows. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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/common/shelf/shelf_model.cc ('k') | ash/common/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_window_watcher.h
diff --git a/ash/common/shelf/shelf_window_watcher.h b/ash/common/shelf/shelf_window_watcher.h
index 45565e8f4b67f375d0109445f62bf5a321277683..9eb3cd2aed1d61bbcd389da46ddc128d6f3571b1 100644
--- a/ash/common/shelf/shelf_window_watcher.h
+++ b/ash/common/shelf/shelf_window_watcher.h
@@ -5,6 +5,8 @@
#ifndef ASH_COMMON_SHELF_SHELF_WINDOW_WATCHER_H_
#define ASH_COMMON_SHELF_SHELF_WINDOW_WATCHER_H_
+#include <set>
+
#include "ash/common/wm_activation_observer.h"
#include "ash/common/wm_window_observer.h"
#include "base/macros.h"
@@ -17,10 +19,11 @@ class ShelfModel;
class WmWindow;
// ShelfWindowWatcher creates and handles a ShelfItem for windows in the default
-// container that have a valid ShelfItemType property (e.g. the task manager
-// dialog or the OS settings window). It adds the ShelfItem when the window is
-// added to the default container and maintains it until the window is closed,
-// even if the window is transiently reparented (e.g. during a drag).
+// container and panels in the panel container that have a valid ShelfItemType
+// property (e.g. the task manager dialog or the OS settings window). It adds
+// the ShelfItem when the window is added to the default container and maintains
+// it until the window is closed, even if the window is transiently reparented
+// (e.g. during a drag).
class ShelfWindowWatcher : public WmActivationObserver,
public display::DisplayObserver {
public:
@@ -69,10 +72,7 @@ class ShelfWindowWatcher : public WmActivationObserver,
// Removes a ShelfItem for |window|.
void RemoveShelfItem(WmWindow* window);
- // Updates the status of ShelfItem for |window|.
- void UpdateShelfItemStatus(WmWindow* window, bool is_active);
-
- // Returns the index of ShelfItem associated with |window|.
+ // Returns the index of ShelfItem associated with |window|, or -1 if none.
int GetShelfItemIndexForWindow(WmWindow* window) const;
// Cleans up observers on |container|.
@@ -106,6 +106,9 @@ class ShelfWindowWatcher : public WmActivationObserver,
ScopedObserver<WmWindow, ContainerWindowObserver> observed_container_windows_;
ScopedObserver<WmWindow, UserWindowObserver> observed_user_windows_;
+ // The set of windows with shelf items managed by this ShelfWindowWatcher.
+ std::set<WmWindow*> user_windows_with_items_;
+
DISALLOW_COPY_AND_ASSIGN(ShelfWindowWatcher);
};
« no previous file with comments | « ash/common/shelf/shelf_model.cc ('k') | ash/common/shelf/shelf_window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698