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

Side by Side Diff: ash/system/cast/tray_cast.cc

Issue 1169833006: Add metrics for when a cast is started or stopped from the system tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Address nit Created 5 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.cc ('k') | tools/metrics/actions/actions.xml » ('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/system/cast/tray_cast.h" 5 #include "ash/system/cast/tray_cast.h"
6 6
7 #include "ash/session/session_state_delegate.h" 7 #include "ash/session/session_state_delegate.h"
8 #include "ash/shelf/shelf_types.h" 8 #include "ash/shelf/shelf_types.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/chromeos/screen_security/screen_tray_item.h" 10 #include "ash/system/chromeos/screen_security/screen_tray_item.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 Layout(); 219 Layout();
220 break; 220 break;
221 } 221 }
222 } 222 }
223 } 223 }
224 224
225 void CastCastView::ButtonPressed(views::Button* sender, 225 void CastCastView::ButtonPressed(views::Button* sender,
226 const ui::Event& event) { 226 const ui::Event& event) {
227 DCHECK(sender == stop_button_); 227 DCHECK(sender == stop_button_);
228 cast_config_delegate_->StopCasting(); 228 cast_config_delegate_->StopCasting();
229 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
230 ash::UMA_STATUS_AREA_CAST_STOP_CAST);
229 } 231 }
230 232
231 // This view by itself does very little. It acts as a front-end for managing 233 // This view by itself does very little. It acts as a front-end for managing
232 // which of the two child views (|CastSelectDefaultView| and |CastCastView|) 234 // which of the two child views (|CastSelectDefaultView| and |CastCastView|)
233 // is active. 235 // is active.
234 class CastDuplexView : public views::View { 236 class CastDuplexView : public views::View {
235 public: 237 public:
236 CastDuplexView(SystemTrayItem* owner, 238 CastDuplexView(SystemTrayItem* owner,
237 CastConfigDelegate* config_delegate, 239 CastConfigDelegate* config_delegate,
238 bool show_more); 240 bool show_more);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 void CastDetailedView::OnViewClicked(views::View* sender) { 493 void CastDetailedView::OnViewClicked(views::View* sender) {
492 if (sender == footer()->content()) { 494 if (sender == footer()->content()) {
493 TransitionToDefaultView(); 495 TransitionToDefaultView();
494 } else if (sender == options_) { 496 } else if (sender == options_) {
495 cast_config_delegate_->LaunchCastOptions(); 497 cast_config_delegate_->LaunchCastOptions();
496 } else { 498 } else {
497 // Find the receiver we are going to cast to 499 // Find the receiver we are going to cast to
498 auto it = receiver_activity_map_.find(sender); 500 auto it = receiver_activity_map_.find(sender);
499 if (it != receiver_activity_map_.end()) { 501 if (it != receiver_activity_map_.end()) {
500 cast_config_delegate_->CastToReceiver(it->second); 502 cast_config_delegate_->CastToReceiver(it->second);
503 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
504 ash::UMA_STATUS_AREA_DETAILED_CAST_VIEW_LAUNCH_CAST);
501 } 505 }
502 } 506 }
503 } 507 }
504 508
505 } // namespace tray 509 } // namespace tray
506 510
507 TrayCast::TrayCast(SystemTray* system_tray) 511 TrayCast::TrayCast(SystemTray* system_tray)
508 : SystemTrayItem(system_tray), 512 : SystemTrayItem(system_tray),
509 cast_config_delegate_(ash::Shell::GetInstance() 513 cast_config_delegate_(ash::Shell::GetInstance()
510 ->system_tray_delegate() 514 ->system_tray_delegate()
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 is_casting_ = started; 594 is_casting_ = started;
591 UpdatePrimaryView(); 595 UpdatePrimaryView();
592 } 596 }
593 597
594 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 598 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
595 if (tray_) 599 if (tray_)
596 tray_->UpdateAlignment(alignment); 600 tray_->UpdateAlignment(alignment);
597 } 601 }
598 602
599 } // namespace ash 603 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698