OLD | NEW |
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/common/system/tray/system_tray.h" | 5 #include "ash/common/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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // turn off the active tinting of the shelf. | 744 // turn off the active tinting of the shelf. |
745 if (full_system_tray_menu_) { | 745 if (full_system_tray_menu_) { |
746 SetDrawBackgroundAsActive(false); | 746 SetDrawBackgroundAsActive(false); |
747 full_system_tray_menu_ = false; | 747 full_system_tray_menu_ = false; |
748 } | 748 } |
749 } | 749 } |
750 | 750 |
751 void SystemTray::RecordSystemMenuMetrics() { | 751 void SystemTray::RecordSystemMenuMetrics() { |
752 DCHECK(system_bubble_); | 752 DCHECK(system_bubble_); |
753 | 753 |
| 754 system_bubble_->bubble()->RecordVisibleRowMetrics(); |
| 755 |
754 TrayBubbleView* bubble_view = system_bubble_->bubble_view(); | 756 TrayBubbleView* bubble_view = system_bubble_->bubble_view(); |
755 int num_rows = 0; | 757 int num_rows = 0; |
756 for (int i = 0; i < bubble_view->child_count(); i++) { | 758 for (int i = 0; i < bubble_view->child_count(); i++) { |
757 // Certain menu rows are attached by default but can set themselves as | 759 // Certain menu rows are attached by default but can set themselves as |
758 // invisible (IME is one such example). Count only user-visible rows. | 760 // invisible (IME is one such example). Count only user-visible rows. |
759 if (bubble_view->child_at(i)->visible()) | 761 if (bubble_view->child_at(i)->visible()) |
760 num_rows++; | 762 num_rows++; |
761 } | 763 } |
762 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows); | 764 UMA_HISTOGRAM_COUNTS_100("Ash.SystemMenu.Rows", num_rows); |
763 | 765 |
764 int work_area_height = | 766 int work_area_height = |
765 display::Screen::GetScreen() | 767 display::Screen::GetScreen() |
766 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) | 768 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) |
767 .work_area() | 769 .work_area() |
768 .height(); | 770 .height(); |
769 if (work_area_height > 0) { | 771 if (work_area_height > 0) { |
770 UMA_HISTOGRAM_CUSTOM_COUNTS( | 772 UMA_HISTOGRAM_CUSTOM_COUNTS( |
771 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 773 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
772 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 774 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
773 } | 775 } |
774 } | 776 } |
775 | 777 |
776 } // namespace ash | 778 } // namespace ash |
OLD | NEW |