| 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_;
|
|
|