Chromium Code Reviews| 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/material_design/material_design_controller.h" | |
| 9 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 11 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/shelf/wm_shelf_util.h" | 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 12 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
| 13 #include "ash/common/system/cast/tray_cast.h" | 14 #include "ash/common/system/cast/tray_cast.h" |
| 14 #include "ash/common/system/date/tray_date.h" | 15 #include "ash/common/system/date/tray_date.h" |
| 15 #include "ash/common/system/tray/system_tray_delegate.h" | 16 #include "ash/common/system/tray/system_tray_delegate.h" |
| 16 #include "ash/common/system/tray/system_tray_item.h" | 17 #include "ash/common/system/tray/system_tray_item.h" |
| 17 #include "ash/common/system/tray/tray_bubble_wrapper.h" | 18 #include "ash/common/system/tray/tray_bubble_wrapper.h" |
| 18 #include "ash/common/system/tray/tray_constants.h" | 19 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 base::HourClockType hour_type = | 621 base::HourClockType hour_type = |
| 621 WmShell::Get()->system_tray_delegate()->GetHourClockType(); | 622 WmShell::Get()->system_tray_delegate()->GetHourClockType(); |
| 622 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, | 623 return base::TimeFormatTimeOfDayWithHourClockType(now, hour_type, |
| 623 base::kKeepAmPm); | 624 base::kKeepAmPm); |
| 624 } | 625 } |
| 625 | 626 |
| 626 void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { | 627 void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { |
| 627 if (alignment == shelf_alignment()) | 628 if (alignment == shelf_alignment()) |
| 628 return; | 629 return; |
| 629 TrayBackgroundView::SetShelfAlignment(alignment); | 630 TrayBackgroundView::SetShelfAlignment(alignment); |
| 631 // if (!ash::MaterialDesignController::IsShelfMaterial()) | |
| 632 // AdjustStatusTrayBackground(); | |
|
yoshiki
2016/08/18 08:39:08
nit: Please remove the unnecessary code.
yiyix
2016/08/18 20:01:43
sorry, I forget to remove these dead codes from my
| |
| 633 | |
| 630 UpdateAfterShelfAlignmentChange(alignment); | 634 UpdateAfterShelfAlignmentChange(alignment); |
| 631 // Destroy any existing bubble so that it is rebuilt correctly. | 635 // Destroy any existing bubble so that it is rebuilt correctly. |
| 632 CloseSystemBubbleAndDeactivateSystemTray(); | 636 CloseSystemBubbleAndDeactivateSystemTray(); |
| 633 // Rebuild any notification bubble. | 637 // Rebuild any notification bubble. |
| 634 if (notification_bubble_) { | 638 if (notification_bubble_) { |
| 635 notification_bubble_.reset(); | 639 notification_bubble_.reset(); |
| 636 UpdateNotificationBubble(); | 640 UpdateNotificationBubble(); |
| 637 // UpdateWebNotifications() should be called in UpdateNotificationBubble(). | 641 // UpdateWebNotifications() should be called in UpdateNotificationBubble(). |
| 638 } else if (!hide_notifications_) { | 642 } else if (!hide_notifications_) { |
| 639 UpdateWebNotifications(); | 643 UpdateWebNotifications(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 .work_area() | 792 .work_area() |
| 789 .height(); | 793 .height(); |
| 790 if (work_area_height > 0) { | 794 if (work_area_height > 0) { |
| 791 UMA_HISTOGRAM_CUSTOM_COUNTS( | 795 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 792 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 796 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 793 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 797 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 794 } | 798 } |
| 795 } | 799 } |
| 796 | 800 |
| 797 } // namespace ash | 801 } // namespace ash |
| OLD | NEW |