| 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/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_cycle_controller.h" | 10 #include "ash/wm/mru_window_tracker.h" |
| 11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
| 14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 19 #include "base/synchronization/cancellation_flag.h" | 19 #include "base/synchronization/cancellation_flag.h" |
| 20 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 WindowStateManager() {} | 134 WindowStateManager() {} |
| 135 | 135 |
| 136 virtual ~WindowStateManager() { | 136 virtual ~WindowStateManager() { |
| 137 for (std::vector<aura::Window*>::iterator iter = windows_.begin(); | 137 for (std::vector<aura::Window*>::iterator iter = windows_.begin(); |
| 138 iter != windows_.end(); ++iter) { | 138 iter != windows_.end(); ++iter) { |
| 139 (*iter)->RemoveObserver(this); | 139 (*iter)->RemoveObserver(this); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 void BuildWindowListAndMinimizeInactive(aura::Window* active_window) { | 143 void BuildWindowListAndMinimizeInactive(aura::Window* active_window) { |
| 144 windows_ = ash::WindowCycleController::BuildWindowList(NULL, false); | 144 windows_ = ash::MruWindowTracker::BuildWindowList(NULL, false); |
| 145 // Remove active window. | 145 // Remove active window. |
| 146 std::vector<aura::Window*>::iterator last = | 146 std::vector<aura::Window*>::iterator last = |
| 147 std::remove(windows_.begin(), windows_.end(), active_window); | 147 std::remove(windows_.begin(), windows_.end(), active_window); |
| 148 // Removes unfocusable windows. | 148 // Removes unfocusable windows. |
| 149 last = | 149 last = |
| 150 std::remove_if( | 150 std::remove_if( |
| 151 windows_.begin(), | 151 windows_.begin(), |
| 152 last, | 152 last, |
| 153 std::ptr_fun(ash::wm::IsWindowMinimized)); | 153 std::ptr_fun(ash::wm::IsWindowMinimized)); |
| 154 windows_.erase(last, windows_.end()); | 154 windows_.erase(last, windows_.end()); |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 this, file_list)); | 911 this, file_list)); |
| 912 } | 912 } |
| 913 | 913 |
| 914 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( | 914 void WallpaperPrivateGetOfflineWallpaperListFunction::OnComplete( |
| 915 const std::vector<std::string>& file_list) { | 915 const std::vector<std::string>& file_list) { |
| 916 ListValue* results = new ListValue(); | 916 ListValue* results = new ListValue(); |
| 917 results->AppendStrings(file_list); | 917 results->AppendStrings(file_list); |
| 918 SetResult(results); | 918 SetResult(results); |
| 919 SendResponse(true); | 919 SendResponse(true); |
| 920 } | 920 } |
| OLD | NEW |