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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 2193913002: Added Ash.SystemMenu.DefaultView.VisibleRows histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Merge remote-tracking branch 'refs/remotes/branch-heads/2785' into drover_2785 Created 4 years, 4 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/system/chromeos/tray_display.cc ('k') | ash/system/tray/system_tray_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/login_status.h" 8 #include "ash/common/login_status.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 // turn off the active tinting of the shelf. 740 // turn off the active tinting of the shelf.
741 if (full_system_tray_menu_) { 741 if (full_system_tray_menu_) {
742 SetDrawBackgroundAsActive(false); 742 SetDrawBackgroundAsActive(false);
743 full_system_tray_menu_ = false; 743 full_system_tray_menu_ = false;
744 } 744 }
745 } 745 }
746 746
747 void SystemTray::RecordSystemMenuMetrics() { 747 void SystemTray::RecordSystemMenuMetrics() {
748 DCHECK(system_bubble_); 748 DCHECK(system_bubble_);
749 749
750 system_bubble_->bubble()->RecordVisibleRowMetrics();
751
750 TrayBubbleView* bubble_view = system_bubble_->bubble_view(); 752 TrayBubbleView* bubble_view = system_bubble_->bubble_view();
751 int num_rows = 0; 753 int num_rows = 0;
752 for (int i = 0; i < bubble_view->child_count(); i++) { 754 for (int i = 0; i < bubble_view->child_count(); i++) {
753 // Certain menu rows are attached by default but can set themselves as 755 // Certain menu rows are attached by default but can set themselves as
754 // invisible (IME is one such example). Count only user-visible rows. 756 // invisible (IME is one such example). Count only user-visible rows.
755 if (bubble_view->child_at(i)->visible()) 757 if (bubble_view->child_at(i)->visible())
756 num_rows++; 758 num_rows++;
757 } 759 }
758 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows); 760 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows);
759 761
760 int work_area_height = 762 int work_area_height =
761 display::Screen::GetScreen() 763 display::Screen::GetScreen()
762 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) 764 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView())
763 .work_area() 765 .work_area()
764 .height(); 766 .height();
765 if (work_area_height > 0) { 767 if (work_area_height > 0) {
766 UMA_HISTOGRAM_CUSTOM_COUNTS( 768 UMA_HISTOGRAM_CUSTOM_COUNTS(
767 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 769 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
768 100 * bubble_view->height() / work_area_height, 1, 300, 100); 770 100 * bubble_view->height() / work_area_height, 1, 300, 100);
769 } 771 }
770 } 772 }
771 773
772 } // namespace ash 774 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/tray_display.cc ('k') | ash/system/tray/system_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698