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

Side by Side Diff: ash/common/system/chromeos/screen_security/screen_capture_tray_item.cc

Issue 2132773002: Added UMA metrics for screen capture UI in the status area. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into uma_screen_capture 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
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/common/system/chromeos/screen_security/screen_capture_tray_item.h" 5 #include "ash/common/system/chromeos/screen_security/screen_capture_tray_item.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/metrics/user_metrics_action.h"
9 #include "ash/common/system/system_notifier.h" 10 #include "ash/common/system/system_notifier.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 11 #include "ash/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
12 #include "grit/ash_resources.h" 13 #include "grit/ash_resources.h"
13 #include "grit/ash_strings.h" 14 #include "grit/ash_strings.h"
14 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
16 #include "ui/message_center/message_center.h" 17 #include "ui/message_center/message_center.h"
17 #include "ui/message_center/notification.h" 18 #include "ui/message_center/notification.h"
18 19
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 data, new tray::ScreenNotificationDelegate(this))); 64 data, new tray::ScreenNotificationDelegate(this)));
64 notification->SetSystemPriority(); 65 notification->SetSystemPriority();
65 message_center::MessageCenter::Get()->AddNotification( 66 message_center::MessageCenter::Get()->AddNotification(
66 std::move(notification)); 67 std::move(notification));
67 } 68 }
68 69
69 std::string ScreenCaptureTrayItem::GetNotificationId() { 70 std::string ScreenCaptureTrayItem::GetNotificationId() {
70 return kScreenCaptureNotificationId; 71 return kScreenCaptureNotificationId;
71 } 72 }
72 73
74 void ScreenCaptureTrayItem::RecordStoppedFromDefaultViewMetric() {
75 WmShell::Get()->RecordUserMetricsAction(
76 UMA_STATUS_AREA_SCREEN_CAPTURE_DEFAULT_STOP);
77 }
78
79 void ScreenCaptureTrayItem::RecordStoppedFromNotificationViewMetric() {
80 WmShell::Get()->RecordUserMetricsAction(
81 UMA_STATUS_AREA_SCREEN_CAPTURE_NOTIFICATION_STOP);
82 }
83
73 void ScreenCaptureTrayItem::OnScreenCaptureStart( 84 void ScreenCaptureTrayItem::OnScreenCaptureStart(
74 const base::Closure& stop_callback, 85 const base::Closure& stop_callback,
75 const base::string16& screen_capture_status) { 86 const base::string16& screen_capture_status) {
76 screen_capture_status_ = screen_capture_status; 87 screen_capture_status_ = screen_capture_status;
77 88
78 // We do not want to show the screen capture tray item and the chromecast 89 // We do not want to show the screen capture tray item and the chromecast
79 // casting tray item at the same time. We will hide this tray item. 90 // casting tray item at the same time. We will hide this tray item.
80 // 91 //
81 // This suppression technique is currently dependent on the order 92 // This suppression technique is currently dependent on the order
82 // that OnScreenCaptureStart and OnCastingSessionStartedOrStopped 93 // that OnScreenCaptureStart and OnCastingSessionStartedOrStopped
(...skipping 10 matching lines...) Expand all
93 // screen capture is stopped externally. 104 // screen capture is stopped externally.
94 set_is_started(false); 105 set_is_started(false);
95 Update(); 106 Update();
96 } 107 }
97 108
98 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { 109 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) {
99 is_casting_ = started; 110 is_casting_ = started;
100 } 111 }
101 112
102 } // namespace ash 113 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698