| 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/key_event_watcher.h" | 7 #include "ash/common/key_event_watcher.h" |
| 8 #include "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| 11 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/shelf/wm_shelf_util.h" | 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 13 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
| 14 #include "ash/common/system/cast/tray_cast.h" | 14 #include "ash/common/system/cast/tray_cast.h" |
| 15 #include "ash/common/system/date/tray_date.h" | 15 #include "ash/common/system/date/tray_date.h" |
| 16 #include "ash/common/system/tray/system_tray_controller.h" |
| 16 #include "ash/common/system/tray/system_tray_delegate.h" | 17 #include "ash/common/system/tray/system_tray_delegate.h" |
| 17 #include "ash/common/system/tray/system_tray_item.h" | 18 #include "ash/common/system/tray/system_tray_item.h" |
| 18 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 19 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 19 #include "ash/common/system/tray/tray_constants.h" | 20 #include "ash/common/system/tray/tray_constants.h" |
| 20 #include "ash/common/system/tray_accessibility.h" | 21 #include "ash/common/system/tray_accessibility.h" |
| 21 #include "ash/common/system/update/tray_update.h" | 22 #include "ash/common/system/update/tray_update.h" |
| 22 #include "ash/common/system/user/tray_user.h" | 23 #include "ash/common/system/user/tray_user.h" |
| 23 #include "ash/common/system/user/tray_user_separator.h" | 24 #include "ash/common/system/user/tray_user_separator.h" |
| 24 #include "ash/common/system/web_notification/web_notification_tray.h" | 25 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 25 #include "ash/common/wm/container_finder.h" | 26 #include "ash/common/wm/container_finder.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 height = | 661 height = |
| 661 std::max(0, work_area.height() - bubble_view->GetBoundsInScreen().y()); | 662 std::max(0, work_area.height() - bubble_view->GetBoundsInScreen().y()); |
| 662 } | 663 } |
| 663 if (web_notification_tray_) | 664 if (web_notification_tray_) |
| 664 web_notification_tray_->SetTrayBubbleHeight(height); | 665 web_notification_tray_->SetTrayBubbleHeight(height); |
| 665 } | 666 } |
| 666 | 667 |
| 667 base::string16 SystemTray::GetAccessibleTimeString( | 668 base::string16 SystemTray::GetAccessibleTimeString( |
| 668 const base::Time& now) const { | 669 const base::Time& now) const { |
| 669 base::HourClockType hour_type = | 670 base::HourClockType hour_type = |
| 670 WmShell::Get()->system_tray_delegate()->GetHourClockType(); | 671 WmShell::Get()->system_tray_controller()->GetHourClockType(); |
| 671 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, | 672 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, |
| 672 base::kKeepAmPm); | 673 base::kKeepAmPm); |
| 673 } | 674 } |
| 674 | 675 |
| 675 void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { | 676 void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 676 if (alignment == shelf_alignment()) | 677 if (alignment == shelf_alignment()) |
| 677 return; | 678 return; |
| 678 TrayBackgroundView::SetShelfAlignment(alignment); | 679 TrayBackgroundView::SetShelfAlignment(alignment); |
| 679 UpdateAfterShelfAlignmentChange(alignment); | 680 UpdateAfterShelfAlignmentChange(alignment); |
| 680 // Destroy any existing bubble so that it is rebuilt correctly. | 681 // Destroy any existing bubble so that it is rebuilt correctly. |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 .work_area() | 878 .work_area() |
| 878 .height(); | 879 .height(); |
| 879 if (work_area_height > 0) { | 880 if (work_area_height > 0) { |
| 880 UMA_HISTOGRAM_CUSTOM_COUNTS( | 881 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 881 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 882 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 882 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 883 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 883 } | 884 } |
| 884 } | 885 } |
| 885 | 886 |
| 886 } // namespace ash | 887 } // namespace ash |
| OLD | NEW |