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

Unified Diff: ash/wm/window_cycle_controller.cc

Issue 2893643003: [mus+ash] Removes WmWindow from ash/wm/window_cycle_* (Closed)
Patch Set: [mus+ash] Removes WmWindow from ash/wm/window_cycle_* Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/window_cycle_controller.cc
diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc
index f7f18c4594048c430a36c9d63d0684653934c672..39c6c6dc47794765f4de070b201153ebe421c09f 100644
--- a/ash/wm/window_cycle_controller.cc
+++ b/ash/wm/window_cycle_controller.cc
@@ -14,6 +14,7 @@
#include "ash/wm/window_cycle_event_filter.h"
#include "ash/wm/window_cycle_list.h"
#include "ash/wm/window_state.h"
+#include "ash/wm/window_state_aura.h"
#include "ash/wm_window.h"
#include "base/metrics/histogram_macros.h"
@@ -23,7 +24,7 @@ namespace {
// Returns the most recently active window from the |window_list| or nullptr
// if the list is empty.
-WmWindow* GetActiveWindow(const MruWindowTracker::WindowList& window_list) {
+aura::Window* GetActiveWindow(const WindowCycleList::WindowList& window_list) {
return window_list.empty() ? nullptr : window_list[0];
}
@@ -55,8 +56,8 @@ void WindowCycleController::HandleCycleWindow(Direction direction) {
}
void WindowCycleController::StartCycling() {
- MruWindowTracker::WindowList window_list =
- Shell::Get()->mru_window_tracker()->BuildMruWindowList();
+ WindowCycleList::WindowList window_list = WmWindow::ToAuraWindows(
+ Shell::Get()->mru_window_tracker()->BuildMruWindowList());
// Exclude windows:
// - non user positionable windows, such as extension popups.
// - windows being dragged
@@ -66,11 +67,11 @@ void WindowCycleController::StartCycling() {
// don't manually remove it, the window cycling UI won't crash or misbehave,
// but there will be a flicker as the target window changes. Also exclude
// unselectable windows such as extension popups.
- auto window_is_ineligible = [](WmWindow* window) {
- wm::WindowState* state = window->GetWindowState();
+ auto window_is_ineligible = [](aura::Window* window) {
+ wm::WindowState* state = wm::GetWindowState(window);
return !state->IsUserPositionable() || state->is_dragged() ||
window->GetRootWindow()
- ->GetChildByShellWindowId(kShellWindowId_AppListContainer)
+ ->GetChildById(kShellWindowId_AppListContainer)
->Contains(window);
};
window_list.erase(std::remove_if(window_list.begin(), window_list.end(),
@@ -109,8 +110,9 @@ void WindowCycleController::StopCycling() {
window_cycle_list_->current_index() + 1);
window_cycle_list_.reset();
- WmWindow* active_window_after_window_cycle =
- GetActiveWindow(Shell::Get()->mru_window_tracker()->BuildMruWindowList());
+ auto* active_window_after_window_cycle =
James Cook 2017/05/17 23:18:25 nit: I think aura::Window* would be a little clear
varkha 2017/05/18 00:18:29 Done.
+ GetActiveWindow(WmWindow::ToAuraWindows(
+ Shell::Get()->mru_window_tracker()->BuildMruWindowList()));
// Remove our key event filter.
event_filter_.reset();

Powered by Google App Engine
This is Rietveld 408576698