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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 full_system_tray_menu_ = items.size() > 1; | 465 full_system_tray_menu_ = items.size() > 1; |
465 | 466 |
466 TrayBubbleView::InitParams init_params( | 467 TrayBubbleView::InitParams init_params( |
467 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); | 468 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); |
468 // TODO(oshima): Change TrayBubbleView itself. | 469 // TODO(oshima): Change TrayBubbleView itself. |
469 init_params.can_activate = false; | 470 init_params.can_activate = false; |
470 if (detailed) { | 471 if (detailed) { |
471 // This is the case where a volume control or brightness control bubble | 472 // This is the case where a volume control or brightness control bubble |
472 // is created. | 473 // is created. |
473 init_params.max_height = default_bubble_height_; | 474 init_params.max_height = default_bubble_height_; |
474 init_params.bg_color = kBackgroundColor; | |
475 } else { | 475 } else { |
476 init_params.bg_color = kHeaderBackgroundColor; | 476 init_params.bg_color = kHeaderBackgroundColor; |
477 } | 477 } |
478 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) | 478 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) |
479 init_params.close_on_deactivate = !persistent; | 479 init_params.close_on_deactivate = !persistent; |
480 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); | 480 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); |
481 | 481 |
482 system_bubble_.reset(new SystemBubbleWrapper(bubble)); | 482 system_bubble_.reset(new SystemBubbleWrapper(bubble)); |
483 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), | 483 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), |
484 &init_params, persistent); | 484 &init_params, persistent); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 .work_area() | 720 .work_area() |
721 .height(); | 721 .height(); |
722 if (work_area_height > 0) { | 722 if (work_area_height > 0) { |
723 UMA_HISTOGRAM_CUSTOM_COUNTS( | 723 UMA_HISTOGRAM_CUSTOM_COUNTS( |
724 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 724 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
725 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 725 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
726 } | 726 } |
727 } | 727 } |
728 | 728 |
729 } // namespace ash | 729 } // namespace ash |
OLD | NEW |