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/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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "ui/base/accelerators/accelerator.h" | 56 #include "ui/base/accelerators/accelerator.h" |
57 #include "ui/base/l10n/l10n_util.h" | 57 #include "ui/base/l10n/l10n_util.h" |
58 #include "ui/compositor/layer.h" | 58 #include "ui/compositor/layer.h" |
59 #include "ui/display/display.h" | 59 #include "ui/display/display.h" |
60 #include "ui/display/screen.h" | 60 #include "ui/display/screen.h" |
61 #include "ui/events/event_constants.h" | 61 #include "ui/events/event_constants.h" |
62 #include "ui/gfx/canvas.h" | 62 #include "ui/gfx/canvas.h" |
63 #include "ui/gfx/skia_util.h" | 63 #include "ui/gfx/skia_util.h" |
64 #include "ui/message_center/message_center.h" | 64 #include "ui/message_center/message_center.h" |
65 #include "ui/message_center/message_center_style.h" | 65 #include "ui/message_center/message_center_style.h" |
| 66 #include "ui/native_theme/native_theme.h" |
66 #include "ui/views/border.h" | 67 #include "ui/views/border.h" |
67 #include "ui/views/controls/label.h" | 68 #include "ui/views/controls/label.h" |
68 #include "ui/views/view.h" | 69 #include "ui/views/view.h" |
69 #include "ui/views/widget/widget.h" | 70 #include "ui/views/widget/widget.h" |
70 #include "ui/wm/core/window_util.h" | 71 #include "ui/wm/core/window_util.h" |
71 #include "ui/wm/public/activation_change_observer.h" | 72 #include "ui/wm/public/activation_change_observer.h" |
72 #include "ui/wm/public/activation_client.h" | 73 #include "ui/wm/public/activation_client.h" |
73 | 74 |
74 using views::TrayBubbleView; | 75 using views::TrayBubbleView; |
75 | 76 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 full_system_tray_menu_ = items.size() > 1; | 488 full_system_tray_menu_ = items.size() > 1; |
488 | 489 |
489 TrayBubbleView::InitParams init_params( | 490 TrayBubbleView::InitParams init_params( |
490 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); | 491 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); |
491 // TODO(oshima): Change TrayBubbleView itself. | 492 // TODO(oshima): Change TrayBubbleView itself. |
492 init_params.can_activate = false; | 493 init_params.can_activate = false; |
493 if (detailed) { | 494 if (detailed) { |
494 // This is the case where a volume control or brightness control bubble | 495 // This is the case where a volume control or brightness control bubble |
495 // is created. | 496 // is created. |
496 init_params.max_height = default_bubble_height_; | 497 init_params.max_height = default_bubble_height_; |
497 init_params.bg_color = kBackgroundColor; | |
498 } else { | 498 } else { |
499 init_params.bg_color = kHeaderBackgroundColor; | 499 init_params.bg_color = kHeaderBackgroundColor; |
500 } | 500 } |
501 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) | 501 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) |
502 init_params.close_on_deactivate = !persistent; | 502 init_params.close_on_deactivate = !persistent; |
503 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); | 503 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); |
504 | 504 |
505 system_bubble_.reset(new SystemBubbleWrapper(bubble)); | 505 system_bubble_.reset(new SystemBubbleWrapper(bubble)); |
506 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), | 506 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), |
507 &init_params, persistent); | 507 &init_params, persistent); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 .work_area() | 741 .work_area() |
742 .height(); | 742 .height(); |
743 if (work_area_height > 0) { | 743 if (work_area_height > 0) { |
744 UMA_HISTOGRAM_CUSTOM_COUNTS( | 744 UMA_HISTOGRAM_CUSTOM_COUNTS( |
745 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 745 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
746 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 746 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
747 } | 747 } |
748 } | 748 } |
749 | 749 |
750 } // namespace ash | 750 } // namespace ash |
OLD | NEW |