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

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

Issue 2012343002: Converts overview to use common ash types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback 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 | « ash/metrics/user_metrics_recorder.h ('k') | ash/shell.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 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/metrics/desktop_task_switch_metric_recorder.h" 7 #include "ash/metrics/desktop_task_switch_metric_recorder.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_delegate.h" 10 #include "ash/shelf/shelf_delegate.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 break; 575 break;
576 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE: 576 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE:
577 base::RecordAction(base::UserMetricsAction("MinButton_Clk")); 577 base::RecordAction(base::UserMetricsAction("MinButton_Clk"));
578 break; 578 break;
579 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: 579 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT:
580 base::RecordAction(base::UserMetricsAction("MaxButton_MaxLeft")); 580 base::RecordAction(base::UserMetricsAction("MaxButton_MaxLeft"));
581 break; 581 break;
582 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: 582 case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT:
583 base::RecordAction(base::UserMetricsAction("MaxButton_MaxRight")); 583 base::RecordAction(base::UserMetricsAction("MaxButton_MaxRight"));
584 break; 584 break;
585 case ash::UMA_WINDOW_OVERVIEW:
586 base::RecordAction(
587 base::UserMetricsAction("WindowSelector_Overview"));
588 break;
589 case ash::UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED:
590 base::RecordAction(
591 base::UserMetricsAction("WindowSelector_ActiveWindowChanged"));
592 task_switch_metrics_recorder_.OnTaskSwitch(
593 TaskSwitchMetricsRecorder::OVERVIEW_MODE);
594 break;
595 case ash::UMA_WINDOW_OVERVIEW_ENTER_KEY:
596 base::RecordAction(
597 base::UserMetricsAction("WindowSelector_OverviewEnterKey"));
598 break;
599 case ash::UMA_WINDOW_CYCLE: 585 case ash::UMA_WINDOW_CYCLE:
600 base::RecordAction( 586 base::RecordAction(
601 base::UserMetricsAction("WindowCycleController_Cycle")); 587 base::UserMetricsAction("WindowCycleController_Cycle"));
602 break; 588 break;
603 } 589 }
604 } 590 }
605 591
606 void UserMetricsRecorder::RecordUserMetricsAction( 592 void UserMetricsRecorder::RecordUserMetricsAction(
607 wm::WmUserMetricsAction action) { 593 wm::WmUserMetricsAction action) {
608 switch (action) { 594 switch (action) {
609 case wm::WmUserMetricsAction::DRAG_MAXIMIZE_LEFT: 595 case wm::WmUserMetricsAction::DRAG_MAXIMIZE_LEFT:
610 base::RecordAction(base::UserMetricsAction("WindowDrag_MaximizeLeft")); 596 base::RecordAction(base::UserMetricsAction("WindowDrag_MaximizeLeft"));
611 break; 597 break;
612 case wm::WmUserMetricsAction::DRAG_MAXIMIZE_RIGHT: 598 case wm::WmUserMetricsAction::DRAG_MAXIMIZE_RIGHT:
613 base::RecordAction(base::UserMetricsAction("WindowDrag_MaximizeRight")); 599 base::RecordAction(base::UserMetricsAction("WindowDrag_MaximizeRight"));
614 break; 600 break;
601 case wm::WmUserMetricsAction::WINDOW_OVERVIEW:
602 base::RecordAction(base::UserMetricsAction("WindowSelector_Overview"));
603 break;
604 case wm::WmUserMetricsAction::WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED:
605 base::RecordAction(
606 base::UserMetricsAction("WindowSelector_ActiveWindowChanged"));
607 task_switch_metrics_recorder_.OnTaskSwitch(
608 TaskSwitchMetricsRecorder::OVERVIEW_MODE);
609 break;
610 case wm::WmUserMetricsAction::WINDOW_OVERVIEW_ENTER_KEY:
611 base::RecordAction(
612 base::UserMetricsAction("WindowSelector_OverviewEnterKey"));
613 break;
615 } 614 }
616 } 615 }
617 616
618 void UserMetricsRecorder::OnShellInitialized() { 617 void UserMetricsRecorder::OnShellInitialized() {
619 // Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses 618 // Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses
620 // Shell::GetInstance() which is not available when |this| is instantiated. 619 // Shell::GetInstance() which is not available when |this| is instantiated.
621 if (!desktop_task_switch_metric_recorder_) { 620 if (!desktop_task_switch_metric_recorder_) {
622 desktop_task_switch_metric_recorder_.reset( 621 desktop_task_switch_metric_recorder_.reset(
623 new DesktopTaskSwitchMetricRecorder()); 622 new DesktopTaskSwitchMetricRecorder());
624 } 623 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 return IsUserActive() && !IsKioskModeActive(); 660 return IsUserActive() && !IsKioskModeActive();
662 } 661 }
663 662
664 void UserMetricsRecorder::StartTimer() { 663 void UserMetricsRecorder::StartTimer() {
665 timer_.Start(FROM_HERE, 664 timer_.Start(FROM_HERE,
666 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds), 665 base::TimeDelta::FromSeconds(kAshPeriodicMetricsTimeInSeconds),
667 this, &UserMetricsRecorder::RecordPeriodicMetrics); 666 this, &UserMetricsRecorder::RecordPeriodicMetrics);
668 } 667 }
669 668
670 } // namespace ash 669 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698