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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 1023863003: Don't track windows that were interacted (restored/minimized) by user while wallpaper picker applic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. Created 5 years, 9 months 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 | chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698