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

Side by Side Diff: ash/wm/overview/window_selector_controller.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: Merge with master. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/mru_window_tracker.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/session_state_delegate.h" 9 #include "ash/session_state_delegate.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 OnSelectionStarted(); 64 OnSelectionStarted();
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 wm::ActivateWindow(window);
74 window_selector_.reset(); 75 window_selector_.reset();
75 wm::ActivateWindow(window);
76 last_selection_time_ = base::Time::Now(); 76 last_selection_time_ = base::Time::Now();
77 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false); 77 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false);
78 } 78 }
79 79
80 void WindowSelectorController::OnSelectionCanceled() { 80 void WindowSelectorController::OnSelectionCanceled() {
81 window_selector_.reset(); 81 window_selector_.reset();
82 last_selection_time_ = base::Time::Now(); 82 last_selection_time_ = base::Time::Now();
83 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false); 83 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(false);
84 } 84 }
85 85
86 void WindowSelectorController::OnSelectionStarted() { 86 void WindowSelectorController::OnSelectionStarted() {
87 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(true); 87 Shell::GetInstance()->mru_window_tracker()->SetIgnoreActivations(true);
88 Shell* shell = Shell::GetInstance(); 88 Shell* shell = Shell::GetInstance();
89 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_SELECTION); 89 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_SELECTION);
90 if (!last_selection_time_.is_null()) { 90 if (!last_selection_time_.is_null()) {
91 UMA_HISTOGRAM_LONG_TIMES( 91 UMA_HISTOGRAM_LONG_TIMES(
92 "Ash.WindowSelector.TimeBetweenUse", 92 "Ash.WindowSelector.TimeBetweenUse",
93 base::Time::Now() - last_selection_time_); 93 base::Time::Now() - last_selection_time_);
94 } 94 }
95 } 95 }
96 96
97 } // namespace ash 97 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/mru_window_tracker.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698