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 <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 else if (system_bubble_) | 671 else if (system_bubble_) |
672 bubble_view = system_bubble_->bubble_view(); | 672 bubble_view = system_bubble_->bubble_view(); |
673 | 673 |
674 int height = 0; | 674 int height = 0; |
675 if (bubble_view) { | 675 if (bubble_view) { |
676 gfx::Rect work_area = | 676 gfx::Rect work_area = |
677 display::Screen::GetScreen() | 677 display::Screen::GetScreen() |
678 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) | 678 ->GetDisplayNearestWindow(bubble_view->GetWidget()->GetNativeView()) |
679 .work_area(); | 679 .work_area(); |
680 height = | 680 height = |
681 std::max(0, work_area.height() - bubble_view->GetBoundsInScreen().y()); | 681 std::max(0, work_area.bottom() - bubble_view->GetBoundsInScreen().y()); |
Mr4D (OOO till 08-26)
2017/01/10 15:08:26
Just wondering - should there be a minumum height
yhanada
2017/01/11 01:18:55
This height doesn't include a height of tray. I th
| |
682 } | 682 } |
683 if (web_notification_tray_) | 683 if (web_notification_tray_) |
684 web_notification_tray_->SetTrayBubbleHeight(height); | 684 web_notification_tray_->SetTrayBubbleHeight(height); |
685 } | 685 } |
686 | 686 |
687 base::string16 SystemTray::GetAccessibleTimeString( | 687 base::string16 SystemTray::GetAccessibleTimeString( |
688 const base::Time& now) const { | 688 const base::Time& now) const { |
689 base::HourClockType hour_type = | 689 base::HourClockType hour_type = |
690 WmShell::Get()->system_tray_controller()->hour_clock_type(); | 690 WmShell::Get()->system_tray_controller()->hour_clock_type(); |
691 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, | 691 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
895 .work_area() | 895 .work_area() |
896 .height(); | 896 .height(); |
897 if (work_area_height > 0) { | 897 if (work_area_height > 0) { |
898 UMA_HISTOGRAM_CUSTOM_COUNTS( | 898 UMA_HISTOGRAM_CUSTOM_COUNTS( |
899 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 899 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
900 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 900 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 } // namespace ash | 904 } // namespace ash |
OLD | NEW |