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

Unified Diff: ash/common/wm/window_cycle_controller.cc

Issue 2234233002: Enable ash window cycle UI by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky review Created 4 years, 4 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
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/common/wm/window_cycle_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/window_cycle_controller.cc
diff --git a/ash/common/wm/window_cycle_controller.cc b/ash/common/wm/window_cycle_controller.cc
index 6135f600aa34ceb59e4e0db89ed6bcd3abe0e9b7..4808148c4e36e336ba03fa853b1e7276b49d3a23 100644
--- a/ash/common/wm/window_cycle_controller.cc
+++ b/ash/common/wm/window_cycle_controller.cc
@@ -6,10 +6,12 @@
#include "ash/common/metrics/task_switch_source.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shell_window_ids.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/window_cycle_event_filter.h"
#include "ash/common/wm/window_cycle_list.h"
#include "ash/common/wm_shell.h"
+#include "ash/common/wm_window.h"
#include "base/metrics/histogram.h"
namespace ash {
@@ -52,6 +54,19 @@ void WindowCycleController::HandleCycleWindow(Direction direction) {
void WindowCycleController::StartCycling() {
MruWindowTracker::WindowList window_list =
WmShell::Get()->mru_window_tracker()->BuildMruWindowList();
+ // Exclude the AppList window, which will hide as soon as cycling starts
+ // anyway. It doesn't make sense to count it as a "switchable" window, yet
+ // a lot of code relies on the MRU list returning the app window. If we
+ // 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.
+ window_list.erase(std::remove_if(window_list.begin(), window_list.end(),
+ [](WmWindow* window) {
+ return window->GetRootWindow()
+ ->GetChildByShellWindowId(
+ kShellWindowId_AppListContainer)
+ ->Contains(window);
+ }),
+ window_list.end());
active_window_before_window_cycle_ = GetActiveWindow(window_list);
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/common/wm/window_cycle_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698