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

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

Issue 2816193002: Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: . Created 3 years, 8 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/system/tray/system_tray.h" 5 #include "ash/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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 full_system_tray_menu_ = items.size() > 1; 489 full_system_tray_menu_ = items.size() > 1;
490 490
491 TrayBubbleView::InitParams init_params( 491 TrayBubbleView::InitParams init_params(
492 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); 492 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth);
493 // TODO(oshima): Change TrayBubbleView itself. 493 // TODO(oshima): Change TrayBubbleView itself.
494 init_params.can_activate = false; 494 init_params.can_activate = false;
495 if (detailed) { 495 if (detailed) {
496 // This is the case where a volume control or brightness control bubble 496 // This is the case where a volume control or brightness control bubble
497 // is created. 497 // is created.
498 init_params.max_height = default_bubble_height_; 498 init_params.max_height = default_bubble_height_;
499 init_params.bg_color = kBackgroundColor;
500 } else { 499 } else {
501 init_params.bg_color = kHeaderBackgroundColor; 500 init_params.bg_color = kHeaderBackgroundColor;
502 } 501 }
503 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) 502 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT)
504 init_params.close_on_deactivate = !persistent; 503 init_params.close_on_deactivate = !persistent;
505 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); 504 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type);
506 505
507 system_bubble_.reset(new SystemBubbleWrapper(bubble)); 506 system_bubble_.reset(new SystemBubbleWrapper(bubble));
508 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), 507 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(),
509 &init_params, persistent); 508 &init_params, persistent);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 .work_area() 742 .work_area()
744 .height(); 743 .height();
745 if (work_area_height > 0) { 744 if (work_area_height > 0) {
746 UMA_HISTOGRAM_CUSTOM_COUNTS( 745 UMA_HISTOGRAM_CUSTOM_COUNTS(
747 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", 746 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu",
748 100 * bubble_view->height() / work_area_height, 1, 300, 100); 747 100 * bubble_view->height() / work_area_height, 1, 300, 100);
749 } 748 }
750 } 749 }
751 750
752 } // namespace ash 751 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698