| 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 <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(WindowStateManager); | 167 DISALLOW_COPY_AND_ASSIGN(WindowStateManager); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 // static | 170 // static |
| 171 WindowStateManager* g_window_state_manager = NULL; | 171 WindowStateManager* g_window_state_manager = NULL; |
| 172 | 172 |
| 173 // static | 173 // static |
| 174 void WindowStateManager::MinimizeInactiveWindows( | 174 void WindowStateManager::MinimizeInactiveWindows( |
| 175 const std::string& user_id_hash) { | 175 const std::string& user_id_hash) { |
| 176 if (chrome::IsRunningInMash()) { | 176 if (ash_util::IsRunningInMash()) { |
| 177 NOTIMPLEMENTED(); | 177 NOTIMPLEMENTED(); |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 | 180 |
| 181 if (!g_window_state_manager) | 181 if (!g_window_state_manager) |
| 182 g_window_state_manager = new WindowStateManager(); | 182 g_window_state_manager = new WindowStateManager(); |
| 183 g_window_state_manager->BuildWindowListAndMinimizeInactiveForUser( | 183 g_window_state_manager->BuildWindowListAndMinimizeInactiveForUser( |
| 184 user_id_hash, ash::wm::GetActiveWindow()); | 184 user_id_hash, ash::wm::GetActiveWindow()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // static | 187 // static |
| 188 void WindowStateManager::RestoreWindows(const std::string& user_id_hash) { | 188 void WindowStateManager::RestoreWindows(const std::string& user_id_hash) { |
| 189 if (chrome::IsRunningInMash()) { | 189 if (ash_util::IsRunningInMash()) { |
| 190 NOTIMPLEMENTED(); | 190 NOTIMPLEMENTED(); |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 | 193 |
| 194 if (!g_window_state_manager) { | 194 if (!g_window_state_manager) { |
| 195 DCHECK(false) << "This should only be called after calling " | 195 DCHECK(false) << "This should only be called after calling " |
| 196 << "MinimizeInactiveWindows."; | 196 << "MinimizeInactiveWindows."; |
| 197 return; | 197 return; |
| 198 } | 198 } |
| 199 | 199 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 WallpaperPrivateRecordWallpaperUMAFunction::Run() { | 969 WallpaperPrivateRecordWallpaperUMAFunction::Run() { |
| 970 std::unique_ptr<record_wallpaper_uma::Params> params( | 970 std::unique_ptr<record_wallpaper_uma::Params> params( |
| 971 record_wallpaper_uma::Params::Create(*args_)); | 971 record_wallpaper_uma::Params::Create(*args_)); |
| 972 EXTENSION_FUNCTION_VALIDATE(params); | 972 EXTENSION_FUNCTION_VALIDATE(params); |
| 973 | 973 |
| 974 user_manager::User::WallpaperType source = getWallpaperType(params->source); | 974 user_manager::User::WallpaperType source = getWallpaperType(params->source); |
| 975 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source, | 975 UMA_HISTOGRAM_ENUMERATION("Ash.Wallpaper.Source", source, |
| 976 user_manager::User::WALLPAPER_TYPE_COUNT); | 976 user_manager::User::WALLPAPER_TYPE_COUNT); |
| 977 return RespondNow(NoArguments()); | 977 return RespondNow(NoArguments()); |
| 978 } | 978 } |
| OLD | NEW |