| OLD | NEW |
| 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/metrics/user_metrics_recorder.h" | 5 #include "ash/metrics/user_metrics_recorder.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/shelf/shelf_item_types.h" | 8 #include "ash/common/shelf/shelf_item_types.h" |
| 9 #include "ash/common/shelf/shelf_model.h" | 9 #include "ash/common/shelf/shelf_model.h" |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 case UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED: | 580 case UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED: |
| 581 base::RecordAction( | 581 base::RecordAction( |
| 582 base::UserMetricsAction("WindowSelector_ActiveWindowChanged")); | 582 base::UserMetricsAction("WindowSelector_ActiveWindowChanged")); |
| 583 task_switch_metrics_recorder_.OnTaskSwitch( | 583 task_switch_metrics_recorder_.OnTaskSwitch( |
| 584 TaskSwitchMetricsRecorder::OVERVIEW_MODE); | 584 TaskSwitchMetricsRecorder::OVERVIEW_MODE); |
| 585 break; | 585 break; |
| 586 case UMA_WINDOW_OVERVIEW_ENTER_KEY: | 586 case UMA_WINDOW_OVERVIEW_ENTER_KEY: |
| 587 base::RecordAction( | 587 base::RecordAction( |
| 588 base::UserMetricsAction("WindowSelector_OverviewEnterKey")); | 588 base::UserMetricsAction("WindowSelector_OverviewEnterKey")); |
| 589 break; | 589 break; |
| 590 case UMA_WINDOW_OVERVIEW_CLOSE_BUTTON: |
| 591 base::RecordAction( |
| 592 base::UserMetricsAction("WindowSelector_OverviewCloseButton")); |
| 593 break; |
| 594 case UMA_WINDOW_OVERVIEW_CLOSE_KEY: |
| 595 base::RecordAction( |
| 596 base::UserMetricsAction("WindowSelector_OverviewCloseKey")); |
| 597 break; |
| 590 } | 598 } |
| 591 } | 599 } |
| 592 | 600 |
| 593 void UserMetricsRecorder::OnShellInitialized() { | 601 void UserMetricsRecorder::OnShellInitialized() { |
| 594 // Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses | 602 // Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses |
| 595 // Shell::GetInstance() which is not available when |this| is instantiated. | 603 // Shell::GetInstance() which is not available when |this| is instantiated. |
| 596 if (!desktop_task_switch_metric_recorder_) { | 604 if (!desktop_task_switch_metric_recorder_) { |
| 597 desktop_task_switch_metric_recorder_.reset( | 605 desktop_task_switch_metric_recorder_.reset( |
| 598 new DesktopTaskSwitchMetricRecorder()); | 606 new DesktopTaskSwitchMetricRecorder()); |
| 599 } | 607 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 return IsUserActive() && !IsKioskModeActive(); | 644 return IsUserActive() && !IsKioskModeActive(); |
| 637 } | 645 } |
| 638 | 646 |
| 639 void UserMetricsRecorder::StartTimer() { | 647 void UserMetricsRecorder::StartTimer() { |
| 640 timer_.Start(FROM_HERE, | 648 timer_.Start(FROM_HERE, |
| 641 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), | 649 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), |
| 642 this, &UserMetricsRecorder::RecordPeriodicMetrics); | 650 this, &UserMetricsRecorder::RecordPeriodicMetrics); |
| 643 } | 651 } |
| 644 | 652 |
| 645 } // namespace ash | 653 } // namespace ash |
| OLD | NEW |