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

Unified Diff: ash/wm/mru_window_tracker.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update fullscreen state tracking in workspace and only consider switchable containers for active no… Created 6 years, 10 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/mru_window_tracker.cc
diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc
index 0a63e32a47a26c84c13269cf34344ba895f2d643..a5769ec05a1fcf741f00646787fa375cc2848f49 100644
--- a/ash/wm/mru_window_tracker.cc
+++ b/ash/wm/mru_window_tracker.cc
@@ -181,6 +181,29 @@ void MruWindowTracker::SetIgnoreActivations(bool ignore) {
SetActiveWindow(wm::GetActiveWindow());
}
+const aura::Window* MruWindowTracker::GetMruWindowInRoot(
+ const aura::Window* root_window) {
+ if (ignore_window_activations_) {
+ // While cycling windows, the activated windows list will not track window
+ // activations so as to correctly maintain the most recently used window
+ // order. Despite this, we should still treat the currently active window as
+ // most recently used for the purpose of window management.
+ aura::Window* active_window = wm::GetActiveWindow();
+ if (active_window && active_window->GetRootWindow() == root_window &&
+ IsSwitchableContainer(active_window->parent())) {
+ return active_window;
+ }
+ }
+
+ for (std::list<aura::Window*>::const_iterator iter = mru_windows_.begin();
+ iter != mru_windows_.end(); ++iter) {
+ if ((*iter)->GetRootWindow() == root_window &&
+ IsSwitchableContainer((*iter)->parent()))
+ return *iter;
+ }
+ return NULL;
+}
+
//////////////////////////////////////////////////////////////////////////////
// MruWindowTracker, private:

Powered by Google App Engine
This is Rietveld 408576698