Chromium Code Reviews| 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..800cdf6c04253dd48e4266702e4fb40beaa38aa9 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,18 @@ void WindowStateManager::OnWindowDestroyed(aura::Window* window) { |
| } |
| } |
| +void WindowStateManager::OnWindowStackingChanged(aura::Window* window) { |
|
bshe
2015/03/24 17:21:42
I am not familiar with this function and when will
|
| + // If user interacted with the |window| while wallpaper picker is opening, |
| + // removes the |window| from observed list. |
| + for (UserIDHashWindowListMap::iterator iter = |
|
bshe
2015/03/24 17:21:41
you can probably use auto here since it is allowed
|
| + user_id_hash_window_list_map_.begin(); |
| + iter != user_id_hash_window_list_map_.end(); ++iter) { |
| + if (iter->second.find(window) != iter->second.end()) |
|
bshe
2015/03/24 17:21:41
you can directly call erase here. If it's not foun
|
| + iter->second.erase(window); |
| + } |
| + window->RemoveObserver(this); |
| +} |
| + |
| } // namespace |
| bool WallpaperPrivateGetStringsFunction::RunSync() { |