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

Side by Side Diff: ash/metrics/desktop_task_switch_metric_recorder.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 9 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/media_controller.cc ('k') | ash/metrics/desktop_task_switch_metric_recorder_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/metrics/desktop_task_switch_metric_recorder.h" 5 #include "ash/metrics/desktop_task_switch_metric_recorder.h"
6 6
7 #include "ash/common/wm_shell.h"
8 #include "ash/shell.h" 7 #include "ash/shell.h"
9 #include "ash/wm/window_util.h" 8 #include "ash/wm/window_util.h"
9 #include "ash/wm_shell.h"
10 #include "ui/wm/public/activation_client.h" 10 #include "ui/wm/public/activation_client.h"
11 11
12 namespace ash { 12 namespace ash {
13 13
14 DesktopTaskSwitchMetricRecorder::DesktopTaskSwitchMetricRecorder() 14 DesktopTaskSwitchMetricRecorder::DesktopTaskSwitchMetricRecorder()
15 : last_active_task_window_(nullptr) { 15 : last_active_task_window_(nullptr) {
16 Shell::GetInstance()->activation_client()->AddObserver(this); 16 Shell::GetInstance()->activation_client()->AddObserver(this);
17 } 17 }
18 18
19 DesktopTaskSwitchMetricRecorder::~DesktopTaskSwitchMetricRecorder() { 19 DesktopTaskSwitchMetricRecorder::~DesktopTaskSwitchMetricRecorder() {
20 Shell::GetInstance()->activation_client()->RemoveObserver(this); 20 Shell::GetInstance()->activation_client()->RemoveObserver(this);
21 } 21 }
22 22
23 void DesktopTaskSwitchMetricRecorder::OnWindowActivated( 23 void DesktopTaskSwitchMetricRecorder::OnWindowActivated(
24 aura::client::ActivationChangeObserver::ActivationReason reason, 24 aura::client::ActivationChangeObserver::ActivationReason reason,
25 aura::Window* gained_active, 25 aura::Window* gained_active,
26 aura::Window* lost_active) { 26 aura::Window* lost_active) {
27 if (gained_active && wm::IsWindowUserPositionable(gained_active)) { 27 if (gained_active && wm::IsWindowUserPositionable(gained_active)) {
28 if (last_active_task_window_ != gained_active && 28 if (last_active_task_window_ != gained_active &&
29 reason == aura::client::ActivationChangeObserver::ActivationReason:: 29 reason == aura::client::ActivationChangeObserver::ActivationReason::
30 INPUT_EVENT) { 30 INPUT_EVENT) {
31 WmShell::Get()->RecordUserMetricsAction(UMA_DESKTOP_SWITCH_TASK); 31 WmShell::Get()->RecordUserMetricsAction(UMA_DESKTOP_SWITCH_TASK);
32 } 32 }
33 last_active_task_window_ = gained_active; 33 last_active_task_window_ = gained_active;
34 } 34 }
35 } 35 }
36 36
37 } // namespace ash 37 } // namespace ash
OLDNEW
« no previous file with comments | « ash/media_controller.cc ('k') | ash/metrics/desktop_task_switch_metric_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698