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

Side by Side Diff: ash/aura/wm_shell_aura.cc

Issue 2160833002: Adds WmShell::RecordTaskSwitchMetric() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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 | « ash/aura/wm_shell_aura.h ('k') | ash/common/metrics/task_switch_source.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/aura/wm_shell_aura.h" 5 #include "ash/aura/wm_shell_aura.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/shell_delegate.h" 11 #include "ash/common/shell_delegate.h"
12 #include "ash/common/shell_observer.h" 12 #include "ash/common/shell_observer.h"
13 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h" 13 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
14 #include "ash/common/wm/mru_window_tracker.h" 14 #include "ash/common/wm/mru_window_tracker.h"
15 #include "ash/common/wm/overview/window_selector_controller.h" 15 #include "ash/common/wm/overview/window_selector_controller.h"
16 #include "ash/common/wm_activation_observer.h" 16 #include "ash/common/wm_activation_observer.h"
17 #include "ash/common/wm_display_observer.h" 17 #include "ash/common/wm_display_observer.h"
18 #include "ash/display/display_manager.h" 18 #include "ash/display/display_manager.h"
19 #include "ash/display/window_tree_host_manager.h" 19 #include "ash/display/window_tree_host_manager.h"
20 #include "ash/metrics/task_switch_metrics_recorder.h"
20 #include "ash/shell.h" 21 #include "ash/shell.h"
21 #include "ash/wm/drag_window_resizer.h" 22 #include "ash/wm/drag_window_resizer.h"
22 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h" 23 #include "ash/wm/maximize_mode/maximize_mode_event_handler_aura.h"
23 #include "ash/wm/screen_pinning_controller.h" 24 #include "ash/wm/screen_pinning_controller.h"
24 #include "ash/wm/window_cycle_event_filter_aura.h" 25 #include "ash/wm/window_cycle_event_filter_aura.h"
25 #include "ash/wm/window_util.h" 26 #include "ash/wm/window_util.h"
26 #include "base/memory/ptr_util.h" 27 #include "base/memory/ptr_util.h"
27 #include "ui/aura/client/focus_client.h" 28 #include "ui/aura/client/focus_client.h"
28 #include "ui/wm/public/activation_client.h" 29 #include "ui/wm/public/activation_client.h"
29 30
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 std::vector<WmWindow*> WmShellAura::GetAllRootWindows() { 127 std::vector<WmWindow*> WmShellAura::GetAllRootWindows() {
127 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 128 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
128 std::vector<WmWindow*> wm_windows(root_windows.size()); 129 std::vector<WmWindow*> wm_windows(root_windows.size());
129 for (size_t i = 0; i < root_windows.size(); ++i) 130 for (size_t i = 0; i < root_windows.size(); ++i)
130 wm_windows[i] = WmWindowAura::Get(root_windows[i]); 131 wm_windows[i] = WmWindowAura::Get(root_windows[i]);
131 return wm_windows; 132 return wm_windows;
132 } 133 }
133 134
134 void WmShellAura::RecordUserMetricsAction(UserMetricsAction action) { 135 void WmShellAura::RecordUserMetricsAction(UserMetricsAction action) {
135 return Shell::GetInstance()->metrics()->RecordUserMetricsAction(action); 136 Shell::GetInstance()->metrics()->RecordUserMetricsAction(action);
137 }
138
139 void WmShellAura::RecordTaskSwitchMetric(TaskSwitchSource source) {
140 Shell::GetInstance()->metrics()->task_switch_metrics_recorder().OnTaskSwitch(
141 source);
136 } 142 }
137 143
138 std::unique_ptr<WindowResizer> WmShellAura::CreateDragWindowResizer( 144 std::unique_ptr<WindowResizer> WmShellAura::CreateDragWindowResizer(
139 std::unique_ptr<WindowResizer> next_window_resizer, 145 std::unique_ptr<WindowResizer> next_window_resizer,
140 wm::WindowState* window_state) { 146 wm::WindowState* window_state) {
141 return base::WrapUnique( 147 return base::WrapUnique(
142 DragWindowResizer::Create(next_window_resizer.release(), window_state)); 148 DragWindowResizer::Create(next_window_resizer.release(), window_state));
143 } 149 }
144 150
145 std::unique_ptr<WindowCycleEventFilter> 151 std::unique_ptr<WindowCycleEventFilter>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 242 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
237 OnDisplayConfigurationChanging()); 243 OnDisplayConfigurationChanging());
238 } 244 }
239 245
240 void WmShellAura::OnDisplayConfigurationChanged() { 246 void WmShellAura::OnDisplayConfigurationChanged() {
241 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, 247 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_,
242 OnDisplayConfigurationChanged()); 248 OnDisplayConfigurationChanged());
243 } 249 }
244 250
245 } // namespace ash 251 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.h ('k') | ash/common/metrics/task_switch_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698