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

Side by Side Diff: ash/wm/overview/window_selector_controller.cc

Issue 100903002: Ignore fullscreen windows which are behind other windows for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test that WorkspaceLayoutManager correctly notifies on fullscreen changes. Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/wm/overview/window_selector_controller.h" 5 #include "ash/wm/overview/window_selector_controller.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/session_state_delegate.h" 8 #include "ash/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 window_selector_->Step(direction); 66 window_selector_->Step(direction);
67 } 67 }
68 68
69 bool WindowSelectorController::IsSelecting() { 69 bool WindowSelectorController::IsSelecting() {
70 return window_selector_.get() != NULL; 70 return window_selector_.get() != NULL;
71 } 71 }
72 72
73 void WindowSelectorController::OnWindowSelected(aura::Window* window) { 73 void WindowSelectorController::OnWindowSelected(aura::Window* window) {
74 window_selector_.reset(); 74 window_selector_.reset();
75
76 // If there is a fullscreen window on this display and it was not selected
77 // it should exit fullscreen mode.
78 internal::RootWindowController* controller =
79 internal::GetRootWindowController(window->GetRootWindow());
80 aura::Window* fullscreen_window = NULL;
81 if (controller)
82 fullscreen_window = controller->GetTopmostFullscreenWindow();
83 if (fullscreen_window && fullscreen_window != window) {
84 wm::GetWindowState(fullscreen_window)->ToggleFullscreen();
85 }
86
87 wm::ActivateWindow(window); 75 wm::ActivateWindow(window);
88 last_selection_time_ = base::Time::Now(); 76 last_selection_time_ = base::Time::Now();
89 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false); 77 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false);
90 } 78 }
91 79
92 void WindowSelectorController::OnSelectionCanceled() { 80 void WindowSelectorController::OnSelectionCanceled() {
93 window_selector_.reset(); 81 window_selector_.reset();
94 last_selection_time_ = base::Time::Now(); 82 last_selection_time_ = base::Time::Now();
95 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false); 83 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false);
96 } 84 }
97 85
98 void WindowSelectorController::OnSelectionStarted() { 86 void WindowSelectorController::OnSelectionStarted() {
99 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(true); 87 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(true);
100 Shell* shell = Shell::GetInstance(); 88 Shell* shell = Shell::GetInstance();
101 shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_SELECTION); 89 shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_SELECTION);
102 if (!last_selection_time_.is_null()) { 90 if (!last_selection_time_.is_null()) {
103 UMA_HISTOGRAM_LONG_TIMES( 91 UMA_HISTOGRAM_LONG_TIMES(
104 "Ash.WindowSelector.TimeBetweenUse", 92 "Ash.WindowSelector.TimeBetweenUse",
105 base::Time::Now() - last_selection_time_); 93 base::Time::Now() - last_selection_time_);
106 } 94 }
107 } 95 }
108 96
109 } // namespace ash 97 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698