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

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

Issue 2448373002: chromeos: Move ownership of system tray width from chrome to ash (Closed)
Patch Set: Created 4 years, 1 month 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/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"
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 // destruction, leading to subtle errors/crashes such as crbug.com/545166. 532 // destruction, leading to subtle errors/crashes such as crbug.com/545166.
533 DestroySystemBubble(); 533 DestroySystemBubble();
534 534
535 // Remember if the menu is a single property (like e.g. volume) or the 535 // Remember if the menu is a single property (like e.g. volume) or the
536 // full tray menu. Note that in case of the |BUBBLE_USE_EXISTING| case 536 // full tray menu. Note that in case of the |BUBBLE_USE_EXISTING| case
537 // above, |full_system_tray_menu_| does not get changed since the fact that 537 // above, |full_system_tray_menu_| does not get changed since the fact that
538 // the menu is full (or not) doesn't change even if a "single property" 538 // the menu is full (or not) doesn't change even if a "single property"
539 // (like network) replaces most of the menu. 539 // (like network) replaces most of the menu.
540 full_system_tray_menu_ = items.size() > 1; 540 full_system_tray_menu_ = items.size() > 1;
541 // The menu width is fixed, and it is a per language setting. 541 // The menu width is fixed, and it is a per language setting.
542 int menu_width = std::max( 542 int menu_width =
543 MaterialDesignController::IsSystemTrayMenuMaterial() 543 std::max(MaterialDesignController::IsSystemTrayMenuMaterial()
544 ? kMinimumSystemTrayMenuWidthMd 544 ? kMinimumSystemTrayMenuWidthMd
James Cook 2016/10/26 00:03:29 I have email out to tdanderson@ (who is working on
545 : kMinimumSystemTrayMenuWidth, 545 : kMinimumSystemTrayMenuWidth,
546 WmShell::Get()->system_tray_delegate()->GetSystemTrayMenuWidth()); 546 l10n_util::GetLocalizedContentsWidthInPixels(
547 IDS_SYSTEM_TRAY_MENU_BUBBLE_WIDTH_PIXELS));
547 548
548 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, 549 TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY,
549 GetAnchorAlignment(), menu_width, 550 GetAnchorAlignment(), menu_width,
550 kTrayPopupMaxWidth); 551 kTrayPopupMaxWidth);
551 // TODO(oshima): Change TrayBubbleView itself. 552 // TODO(oshima): Change TrayBubbleView itself.
552 init_params.can_activate = false; 553 init_params.can_activate = false;
553 init_params.first_item_has_no_margin = true; 554 init_params.first_item_has_no_margin = true;
554 if (detailed) { 555 if (detailed) {
555 // This is the case where a volume control or brightness control bubble 556 // This is the case where a volume control or brightness control bubble
556 // is created. 557 // is created.
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 .work_area() 889 .work_area()
889 .height(); 890 .height();
890 if (work_area_height > 0) { 891 if (work_area_height > 0) {
891 UMA_HISTOGRAM_CUSTOM_COUNTS( 892 UMA_HISTOGRAM_CUSTOM_COUNTS(
892 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 893 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
893 100 * bubble_view->height() / work_area_height, 1, 300, 100); 894 100 * bubble_view->height() / work_area_height, 1, 300, 100);
894 } 895 }
895 } 896 }
896 897
897 } // namespace ash 898 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698