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

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

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ways to calculate x position for separator + fix comments 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
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/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"
yoshiki 2016/08/19 03:45:31 nit: is this change necessary?
yiyix 2016/08/19 19:07:56 Done.
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
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
yoshiki 2016/08/19 03:45:31 nit: I think we shouldn't have this clean up in th
yiyix 2016/08/19 19:07:56 Done.
630 UpdateAfterShelfAlignmentChange(alignment); 632 UpdateAfterShelfAlignmentChange(alignment);
631 // Destroy any existing bubble so that it is rebuilt correctly. 633 // Destroy any existing bubble so that it is rebuilt correctly.
632 CloseSystemBubbleAndDeactivateSystemTray(); 634 CloseSystemBubbleAndDeactivateSystemTray();
633 // Rebuild any notification bubble. 635 // Rebuild any notification bubble.
634 if (notification_bubble_) { 636 if (notification_bubble_) {
635 notification_bubble_.reset(); 637 notification_bubble_.reset();
636 UpdateNotificationBubble(); 638 UpdateNotificationBubble();
637 // UpdateWebNotifications() should be called in UpdateNotificationBubble(). 639 // UpdateWebNotifications() should be called in UpdateNotificationBubble().
638 } else if (!hide_notifications_) { 640 } else if (!hide_notifications_) {
639 UpdateWebNotifications(); 641 UpdateWebNotifications();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 .work_area() 790 .work_area()
789 .height(); 791 .height();
790 if (work_area_height > 0) { 792 if (work_area_height > 0) {
791 UMA_HISTOGRAM_CUSTOM_COUNTS( 793 UMA_HISTOGRAM_CUSTOM_COUNTS(
792 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 794 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
793 100 * bubble_view->height() / work_area_height, 1, 300, 100); 795 100 * bubble_view->height() / work_area_height, 1, 300, 100);
794 } 796 }
795 } 797 }
796 798
797 } // namespace ash 799 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698