OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_window_state_m
anager.h" | 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_window_state_m
anager.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/mru_window_tracker.h" | 8 #include "ash/wm/mru_window_tracker.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void WallpaperWindowStateManager::BuildWindowListAndMinimizeInactiveForUser( | 59 void WallpaperWindowStateManager::BuildWindowListAndMinimizeInactiveForUser( |
60 const std::string& user_id_hash, | 60 const std::string& user_id_hash, |
61 aura::Window* active_window) { | 61 aura::Window* active_window) { |
62 if (user_id_hash_window_list_map_.find(user_id_hash) == | 62 if (user_id_hash_window_list_map_.find(user_id_hash) == |
63 user_id_hash_window_list_map_.end()) { | 63 user_id_hash_window_list_map_.end()) { |
64 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>(); | 64 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>(); |
65 } | 65 } |
66 std::set<aura::Window*>* results = | 66 std::set<aura::Window*>* results = |
67 &user_id_hash_window_list_map_[user_id_hash]; | 67 &user_id_hash_window_list_map_[user_id_hash]; |
68 | 68 |
69 std::vector<aura::Window*> windows = ash::WmWindow::ToAuraWindows( | 69 aura::Window::Windows windows = |
70 ash::Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal()); | 70 ash::Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); |
71 | 71 |
72 for (std::vector<aura::Window*>::iterator iter = windows.begin(); | 72 for (aura::Window::Windows::iterator iter = windows.begin(); |
73 iter != windows.end(); ++iter) { | 73 iter != windows.end(); ++iter) { |
74 // Ignore active window and minimized windows. | 74 // Ignore active window and minimized windows. |
75 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized()) | 75 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized()) |
76 continue; | 76 continue; |
77 | 77 |
78 if (!(*iter)->HasObserver(this)) | 78 if (!(*iter)->HasObserver(this)) |
79 (*iter)->AddObserver(this); | 79 (*iter)->AddObserver(this); |
80 | 80 |
81 results->insert(*iter); | 81 results->insert(*iter); |
82 ash::wm::GetWindowState(*iter)->Minimize(); | 82 ash::wm::GetWindowState(*iter)->Minimize(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // If user interacted with the |window| while wallpaper picker is opening, | 129 // If user interacted with the |window| while wallpaper picker is opening, |
130 // removes the |window| from observed list. | 130 // removes the |window| from observed list. |
131 for (auto iter = user_id_hash_window_list_map_.begin(); | 131 for (auto iter = user_id_hash_window_list_map_.begin(); |
132 iter != user_id_hash_window_list_map_.end(); ++iter) { | 132 iter != user_id_hash_window_list_map_.end(); ++iter) { |
133 iter->second.erase(window); | 133 iter->second.erase(window); |
134 } | 134 } |
135 window->RemoveObserver(this); | 135 window->RemoveObserver(this); |
136 } | 136 } |
137 | 137 |
138 } // namespace chromeos | 138 } // namespace chromeos |
OLD | NEW |