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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 2042913002: Converts MruWindowTracker to work with common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not equal Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ash/wm/window_util.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/aura/wm_window_aura.h"
14 #include "ash/common/wm/window_state.h" 15 #include "ash/common/wm/window_state.h"
15 #include "ash/desktop_background/desktop_background_controller.h" 16 #include "ash/desktop_background/desktop_background_controller.h"
16 #include "ash/shell.h" 17 #include "ash/shell.h"
17 #include "ash/wm/mru_window_tracker.h" 18 #include "ash/wm/mru_window_tracker.h"
18 #include "ash/wm/window_state_aura.h" 19 #include "ash/wm/window_state_aura.h"
19 #include "ash/wm/window_util.h" 20 #include "ash/wm/window_util.h"
20 #include "base/command_line.h" 21 #include "base/command_line.h"
21 #include "base/files/file_enumerator.h" 22 #include "base/files/file_enumerator.h"
22 #include "base/files/file_util.h" 23 #include "base/files/file_util.h"
23 #include "base/macros.h" 24 #include "base/macros.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 209
209 void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser( 210 void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser(
210 const std::string& user_id_hash, aura::Window* active_window) { 211 const std::string& user_id_hash, aura::Window* active_window) {
211 if (user_id_hash_window_list_map_.find(user_id_hash) == 212 if (user_id_hash_window_list_map_.find(user_id_hash) ==
212 user_id_hash_window_list_map_.end()) { 213 user_id_hash_window_list_map_.end()) {
213 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>(); 214 user_id_hash_window_list_map_[user_id_hash] = std::set<aura::Window*>();
214 } 215 }
215 std::set<aura::Window*>* results = 216 std::set<aura::Window*>* results =
216 &user_id_hash_window_list_map_[user_id_hash]; 217 &user_id_hash_window_list_map_[user_id_hash];
217 218
218 std::vector<aura::Window*> windows = ash::Shell::GetInstance()-> 219 std::vector<aura::Window*> windows =
219 mru_window_tracker()->BuildWindowListIgnoreModal(); 220 ash::WmWindowAura::ToAuraWindows(ash::Shell::GetInstance()
221 ->mru_window_tracker()
222 ->BuildWindowListIgnoreModal());
220 223
221 for (std::vector<aura::Window*>::iterator iter = windows.begin(); 224 for (std::vector<aura::Window*>::iterator iter = windows.begin();
222 iter != windows.end(); ++iter) { 225 iter != windows.end(); ++iter) {
223 // Ignore active window and minimized windows. 226 // Ignore active window and minimized windows.
224 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized()) 227 if (*iter == active_window || ash::wm::GetWindowState(*iter)->IsMinimized())
225 continue; 228 continue;
226 229
227 if (!(*iter)->HasObserver(this)) 230 if (!(*iter)->HasObserver(this))
228 (*iter)->AddObserver(this); 231 (*iter)->AddObserver(this);
229 232
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 bool WallpaperPrivateRecordWallpaperUMAFunction::RunSync() { 979 bool WallpaperPrivateRecordWallpaperUMAFunction::RunSync() {
977 std::unique_ptr<record_wallpaper_uma::Params> params( 980 std::unique_ptr<record_wallpaper_uma::Params> params(
978 record_wallpaper_uma::Params::Create(*args_)); 981 record_wallpaper_uma::Params::Create(*args_));
979 EXTENSION_FUNCTION_VALIDATE(params); 982 EXTENSION_FUNCTION_VALIDATE(params);
980 983
981 user_manager::User::WallpaperType source = getWallpaperType(params->source); 984 user_manager::User::WallpaperType source = getWallpaperType(params->source);
982 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source, 985 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source,
983 user_manager::User::WALLPAPER_TYPE_COUNT); 986 user_manager::User::WALLPAPER_TYPE_COUNT);
984 return true; 987 return true;
985 } 988 }
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698