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

Unified Diff: ash/shelf/shelf_window_watcher.h

Issue 108313006: [ash] Don't remove an item when associated window is dragged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « no previous file | ash/shelf/shelf_window_watcher.cc » ('j') | ash/shelf/shelf_window_watcher.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_window_watcher.h
diff --git a/ash/shelf/shelf_window_watcher.h b/ash/shelf/shelf_window_watcher.h
index 43ac4f0150ee7a328cd008108a13da08310883b8..c201b9a640b8472a8669952608aa9b9aa7b8bb87 100644
--- a/ash/shelf/shelf_window_watcher.h
+++ b/ash/shelf/shelf_window_watcher.h
@@ -56,6 +56,24 @@ class ShelfWindowWatcher : public aura::client::ActivationChangeObserver,
DISALLOW_COPY_AND_ASSIGN(RootWindowObserver);
};
+ // Observer of removed Window that has an item from default container.
+ class RemovedWindowObserver : public aura::WindowObserver {
+ public:
+ explicit RemovedWindowObserver(ShelfWindowWatcher* window_watcher);
+ virtual ~RemovedWindowObserver();
+
+ private:
+ // aura::WindowObserver overrides:
+ virtual void OnWindowParentChanged(aura::Window* window,
+ aura::Window* parent) OVERRIDE;
+ virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+
+ // Owned by Shell.
+ ShelfWindowWatcher* window_watcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(RemovedWindowObserver);
+ };
+
// Creates a LauncherItem for |window| that has LauncherItemDetails.
void AddLauncherItem(aura::Window* window);
@@ -74,6 +92,9 @@ class ShelfWindowWatcher : public aura::client::ActivationChangeObserver,
// Returns the index of LauncherItem associated with |window|.
int GetLauncherItemIndexForWindow(aura::Window* window) const;
+ // Remove an item associated with |window| and its observer.
+ void FinalizeItemOfRemovedWindow(aura::Window* window);
+
// aura::client::ActivationChangeObserver overrides:
virtual void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) OVERRIDE;
@@ -97,12 +118,17 @@ class ShelfWindowWatcher : public aura::client::ActivationChangeObserver,
RootWindowObserver root_window_observer_;
+ RemovedWindowObserver removed_window_observer_;
+
// Holds all observed windows.
ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_;
// Holds all observed root windows.
ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_;
+ // Holds removed windows that has an item from default container.
+ ScopedObserver<aura::Window, aura::WindowObserver> observed_removed_windows_;
+
// Holds all observed activation clients.
ScopedObserverWithDuplicatedSources<aura::client::ActivationClient,
aura::client::ActivationChangeObserver> observed_activation_clients_;
« no previous file with comments | « no previous file | ash/shelf/shelf_window_watcher.cc » ('j') | ash/shelf/shelf_window_watcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698