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

Side by Side Diff: ash/wm/window_cycle_controller.cc

Issue 2096063002: [ash-md] Adds UMA items count and selection depth for Alt+Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Adds UMA items count and selection depth for Alt+Tab (rebased) Created 4 years, 6 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
« no previous file with comments | « no previous file | ash/wm/window_cycle_list.h » ('j') | ash/wm/window_cycle_list.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/window_cycle_controller.h" 5 #include "ash/wm/window_cycle_controller.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/wm/mru_window_tracker.h" 8 #include "ash/common/wm/mru_window_tracker.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void WindowCycleController::StartCycling() { 89 void WindowCycleController::StartCycling() {
90 MruWindowTracker::WindowList window_list = 90 MruWindowTracker::WindowList window_list =
91 Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList(); 91 Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList();
92 92
93 active_window_before_window_cycle_ = GetActiveWindow(window_list); 93 active_window_before_window_cycle_ = GetActiveWindow(window_list);
94 94
95 window_cycle_list_.reset(new WindowCycleList(window_list)); 95 window_cycle_list_.reset(new WindowCycleList(window_list));
96 event_handler_.reset(new WindowCycleEventFilter()); 96 event_handler_.reset(new WindowCycleEventFilter());
97 cycle_start_time_ = base::Time::Now(); 97 cycle_start_time_ = base::Time::Now();
98 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_CYCLE); 98 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_CYCLE);
99 UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.Items",
100 window_list.size());
99 } 101 }
100 102
101 ////////////////////////////////////////////////////////////////////////////// 103 //////////////////////////////////////////////////////////////////////////////
102 // WindowCycleController, private: 104 // WindowCycleController, private:
103 105
104 void WindowCycleController::Step(Direction direction) { 106 void WindowCycleController::Step(Direction direction) {
105 DCHECK(window_cycle_list_.get()); 107 DCHECK(window_cycle_list_.get());
106 window_cycle_list_->Step(direction); 108 window_cycle_list_->Step(direction);
107 } 109 }
108 110
109 void WindowCycleController::StopCycling() { 111 void WindowCycleController::StopCycling() {
112 int depth = window_cycle_list_->current_index();
tdanderson 2016/06/24 19:25:56 nit: no need for a local variable, just inline on
varkha 2016/06/24 19:59:46 |window_cycle_list_| goes away in the next line bu
110 window_cycle_list_.reset(); 113 window_cycle_list_.reset();
111 114
112 WmWindow* active_window_after_window_cycle = GetActiveWindow( 115 WmWindow* active_window_after_window_cycle = GetActiveWindow(
113 Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList()); 116 Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList());
114 117
115 // Remove our key event filter. 118 // Remove our key event filter.
116 event_handler_.reset(); 119 event_handler_.reset();
117 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime", 120 UMA_HISTOGRAM_MEDIUM_TIMES("Ash.WindowCycleController.CycleTime",
118 base::Time::Now() - cycle_start_time_); 121 base::Time::Now() - cycle_start_time_);
122 UMA_HISTOGRAM_COUNTS_100("Ash.WindowCycleController.SelectionDepth",
123 depth + 1);
119 124
120 if (active_window_after_window_cycle != nullptr && 125 if (active_window_after_window_cycle != nullptr &&
121 active_window_before_window_cycle_ != active_window_after_window_cycle) { 126 active_window_before_window_cycle_ != active_window_after_window_cycle) {
122 Shell::GetInstance() 127 Shell::GetInstance()
123 ->metrics() 128 ->metrics()
124 ->task_switch_metrics_recorder() 129 ->task_switch_metrics_recorder()
125 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); 130 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER);
126 } 131 }
127 active_window_before_window_cycle_ = nullptr; 132 active_window_before_window_cycle_ = nullptr;
128 } 133 }
129 134
130 } // namespace ash 135 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_cycle_list.h » ('j') | ash/wm/window_cycle_list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698