| Index: chrome/browser/chromeos/extensions/wallpaper_private_api.cc
|
| diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
|
| index d4983fe60acf9ca1dc046618d3bc2e7c6c96df5e..206f13763229fe189911684e1cfa5cf0e2c673e4 100644
|
| --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
|
| +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
|
| @@ -148,6 +148,9 @@ class WindowStateManager : public aura::WindowObserver {
|
| // aura::WindowObserver overrides.
|
| void OnWindowDestroyed(aura::Window* window) override;
|
|
|
| + // aura::WindowObserver overrides.
|
| + void OnWindowStackingChanged(aura::Window* window) override;
|
| +
|
| // Map of user id hash and associated list of minimized windows.
|
| UserIDHashWindowListMap user_id_hash_window_list_map_;
|
|
|
| @@ -203,7 +206,6 @@ void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser(
|
| if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized())
|
| continue;
|
|
|
| - // TODO(bshe): Add WindowStateObserver too. http://crbug.com/323252
|
| if (!(*iter)->HasObserver(this))
|
| (*iter)->AddObserver(this);
|
|
|
| @@ -254,6 +256,16 @@ void WindowStateManager::OnWindowDestroyed(aura::Window* window) {
|
| }
|
| }
|
|
|
| +void WindowStateManager::OnWindowStackingChanged(aura::Window* window) {
|
| + // If user interacted with the |window| while wallpaper picker is opening,
|
| + // removes the |window| from observed list.
|
| + for (auto iter = user_id_hash_window_list_map_.begin();
|
| + iter != user_id_hash_window_list_map_.end(); ++iter) {
|
| + iter->second.erase(window);
|
| + }
|
| + window->RemoveObserver(this);
|
| +}
|
| +
|
| } // namespace
|
|
|
| bool WallpaperPrivateGetStringsFunction::RunSync() {
|
|
|