summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/accelerators/accelerator_controller.cc2
-rw-r--r--ash/focus_cycler.cc2
-rw-r--r--ash/shelf/shelf_layout_manager.cc2
-rw-r--r--ash/wm/maximize_mode/maximize_mode_window_manager.cc3
-rw-r--r--ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc9
-rw-r--r--ash/wm/mru_window_tracker.cc15
-rw-r--r--ash/wm/mru_window_tracker.h7
-rw-r--r--ash/wm/window_positioner.cc4
-rw-r--r--chrome/browser/chromeos/extensions/wallpaper_private_api.cc3
9 files changed, 18 insertions, 29 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 35dc3c7..c112ca9 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -1315,7 +1315,7 @@ AcceleratorController::GetAcceleratorProcessingRestriction(int action) {
// cycling through its window elements.
return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
}
- if (MruWindowTracker::BuildWindowList(false).empty() &&
+ if (MruWindowTracker::BuildWindowList().empty() &&
actions_needing_window_.find(action) != actions_needing_window_.end()) {
Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
ui::A11Y_ALERT_WINDOW_NEEDED);
diff --git a/ash/focus_cycler.cc b/ash/focus_cycler.cc
index b0d6d4d..2ccf256 100644
--- a/ash/focus_cycler.cc
+++ b/ash/focus_cycler.cc
@@ -19,7 +19,7 @@ namespace ash {
namespace {
bool HasFocusableWindow() {
- return !MruWindowTracker::BuildWindowList(false).empty();
+ return !MruWindowTracker::BuildWindowList().empty();
}
} // namespace
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 7f1667c..08831e2 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -1031,7 +1031,7 @@ ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState(
return SHELF_AUTO_HIDE_SHOWN;
const std::vector<aura::Window*> windows =
- ash::MruWindowTracker::BuildWindowList(false);
+ ash::MruWindowTracker::BuildWindowList();
// Process the window list and check if there are any visible windows.
bool visible_window = false;
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager.cc b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
index 6b7fc36..7506bee 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager.cc
@@ -182,8 +182,7 @@ MaximizeModeWindowManager::MaximizeModeWindowManager()
}
void MaximizeModeWindowManager::MaximizeAllWindows() {
- MruWindowTracker::WindowList windows =
- MruWindowTracker::BuildWindowList(false);
+ MruWindowTracker::WindowList windows = MruWindowTracker::BuildWindowList();
// Add all existing Mru windows.
for (MruWindowTracker::WindowList::iterator window = windows.begin();
window != windows.end(); ++window) {
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
index 534108a..d2e06a1 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -679,8 +679,7 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) {
// The windows should be in the reverse order of creation in the MRU list.
{
- MruWindowTracker::WindowList windows =
- MruWindowTracker::BuildWindowList(false);
+ MruWindowTracker::WindowList windows = MruWindowTracker::BuildWindowList();
EXPECT_EQ(w1.get(), windows[4]);
EXPECT_EQ(w2.get(), windows[3]);
EXPECT_EQ(w3.get(), windows[2]);
@@ -693,8 +692,7 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) {
ASSERT_TRUE(manager);
EXPECT_EQ(5, manager->GetNumberOfManagedWindows());
{
- MruWindowTracker::WindowList windows =
- MruWindowTracker::BuildWindowList(false);
+ MruWindowTracker::WindowList windows = MruWindowTracker::BuildWindowList();
// We do not test maximization here again since that was done already.
EXPECT_EQ(w1.get(), windows[4]);
EXPECT_EQ(w2.get(), windows[3]);
@@ -706,8 +704,7 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) {
// Destroying should still keep the order.
DestroyMaximizeModeWindowManager();
{
- MruWindowTracker::WindowList windows =
- MruWindowTracker::BuildWindowList(false);
+ MruWindowTracker::WindowList windows = MruWindowTracker::BuildWindowList();
// We do not test maximization here again since that was done already.
EXPECT_EQ(w1.get(), windows[4]);
EXPECT_EQ(w2.get(), windows[3]);
diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc
index ef00dfc..0952f49 100644
--- a/ash/wm/mru_window_tracker.cc
+++ b/ash/wm/mru_window_tracker.cc
@@ -54,11 +54,8 @@ bool CompareWindowState(aura::Window* w1, aura::Window* w2) {
// Returns a list of windows ordered by their stacking order.
// If |mru_windows| is passed, these windows are moved to the front of the list.
-// If |top_most_at_end|, the list is returned in descending (bottom-most / least
-// recently used) order.
MruWindowTracker::WindowList BuildWindowListInternal(
- const std::list<aura::Window*>* mru_windows,
- bool top_most_at_end) {
+ const std::list<aura::Window*>* mru_windows) {
MruWindowTracker::WindowList windows;
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -115,8 +112,7 @@ MruWindowTracker::WindowList BuildWindowListInternal(
std::stable_sort(windows.begin(), windows.end(), CompareWindowState);
// Window cycling expects the topmost window at the front of the list.
- if (!top_most_at_end)
- std::reverse(windows.begin(), windows.end());
+ std::reverse(windows.begin(), windows.end());
return windows;
}
@@ -143,13 +139,12 @@ MruWindowTracker::~MruWindowTracker() {
}
// static
-MruWindowTracker::WindowList MruWindowTracker::BuildWindowList(
- bool top_most_at_end) {
- return BuildWindowListInternal(NULL, top_most_at_end);
+MruWindowTracker::WindowList MruWindowTracker::BuildWindowList() {
+ return BuildWindowListInternal(NULL);
}
MruWindowTracker::WindowList MruWindowTracker::BuildMruWindowList() {
- return BuildWindowListInternal(&mru_windows_, false);
+ return BuildWindowListInternal(&mru_windows_);
}
void MruWindowTracker::SetIgnoreActivations(bool ignore) {
diff --git a/ash/wm/mru_window_tracker.h b/ash/wm/mru_window_tracker.h
index 6f6dd5f..4ed06a3 100644
--- a/ash/wm/mru_window_tracker.h
+++ b/ash/wm/mru_window_tracker.h
@@ -40,10 +40,9 @@ class ASH_EXPORT MruWindowTracker
// the vector based on the current set of windows across all valid root
// windows. As a result it is not necessarily the same as the set of
// windows being iterated over.
- // If |top_most_at_end| the window list will return in ascending (lowest
- // window in stacking order first) order instead of the default descending
- // (top most window first) order.
- static WindowList BuildWindowList(bool top_most_at_end);
+ // The returned window list will be in descending (top most window first)
+ // order.
+ static WindowList BuildWindowList();
// Returns the set of windows which can be cycled through using the tracked
// list of most recently used windows.
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc
index 73b7d09..880abd1 100644
--- a/ash/wm/window_positioner.cc
+++ b/ash/wm/window_positioner.cc
@@ -192,7 +192,7 @@ aura::Window* GetReferenceWindow(const aura::Window* root_window,
// Get a list of all windows.
const std::vector<aura::Window*> windows =
- ash::MruWindowTracker::BuildWindowList(false);
+ ash::MruWindowTracker::BuildWindowList();
if (windows.empty())
return NULL;
@@ -504,7 +504,7 @@ gfx::Rect WindowPositioner::SmartPopupPosition(
const gfx::Rect& work_area,
int grid) {
const std::vector<aura::Window*> windows =
- MruWindowTracker::BuildWindowList(false);
+ MruWindowTracker::BuildWindowList();
std::vector<const gfx::Rect*> regions;
// Process the window list and check if we can bail immediately.
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index a1dd922..64755a8 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -175,8 +175,7 @@ void WindowStateManager::BuildWindowListAndMinimizeInactiveForUser(
std::set<aura::Window*>* results =
&user_id_hash_window_list_map_[user_id_hash];
- std::vector<aura::Window*> windows =
- ash::MruWindowTracker::BuildWindowList(false);
+ std::vector<aura::Window*> windows = ash::MruWindowTracker::BuildWindowList();
for (std::vector<aura::Window*>::iterator iter = windows.begin();
iter != windows.end(); ++iter) {