OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/wallpaper_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser( | 167 void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser( |
168 const std::string& user_id_hash, aura::Window* active_window) { | 168 const std::string& user_id_hash, aura::Window* active_window) { |
169 if (user_id_hash_window_list_map_.find(user_id_hash) == | 169 if (user_id_hash_window_list_map_.find(user_id_hash) == |
170 user_id_hash_window_list_map_.end()) { | 170 user_id_hash_window_list_map_.end()) { |
171 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>(); | 171 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>(); |
172 } | 172 } |
173 std::set<aura::Window*>* results = | 173 std::set<aura::Window*>* results = |
174 &user_id_hash_window_list_map_[user_id_hash]; | 174 &user_id_hash_window_list_map_[user_id_hash]; |
175 | 175 |
176 std::vector<aura::Window*> windows = | 176 std::vector<aura::Window*> windows = ash::MruWindowTracker::BuildWindowList(); |
177 ash::MruWindowTracker::BuildWindowList(false); | |
178 | 177 |
179 for (std::vector<aura::Window*>::iterator iter = windows.begin(); | 178 for (std::vector<aura::Window*>::iterator iter = windows.begin(); |
180 iter != windows.end(); ++iter) { | 179 iter != windows.end(); ++iter) { |
181 // Ignore active window and minimized windows. | 180 // Ignore active window and minimized windows. |
182 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized()) | 181 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized()) |
183 continue; | 182 continue; |
184 | 183 |
185 // TODO(bshe): Add WindowStateObserver too. http://crbug.com/323252 | 184 // TODO(bshe): Add WindowStateObserver too. http://crbug.com/323252 |
186 if (!(*iter)->HasObserver(this)) | 185 if (!(*iter)->HasObserver(this)) |
187 (*iter)->AddObserver(this); | 186 (*iter)->AddObserver(this); |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 this, file_list)); | 895 this, file_list)); |
897 } | 896 } |
898 | 897 |
899 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( | 898 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( |
900 const std::vector<std::string>& file_list) { | 899 const std::vector<std::string>& file_list) { |
901 base::ListValue* results = new base::ListValue(); | 900 base::ListValue* results = new base::ListValue(); |
902 results->AppendStrings(file_list); | 901 results->AppendStrings(file_list); |
903 SetResult(results); | 902 SetResult(results); |
904 SendResponse(true); | 903 SendResponse(true); |
905 } | 904 } |
OLD | NEW |