| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "ui/base/accelerators/accelerator.h" | 57 #include "ui/base/accelerators/accelerator.h" |
| 58 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
| 59 #include "ui/compositor/layer.h" | 59 #include "ui/compositor/layer.h" |
| 60 #include "ui/display/display.h" | 60 #include "ui/display/display.h" |
| 61 #include "ui/display/screen.h" | 61 #include "ui/display/screen.h" |
| 62 #include "ui/events/event_constants.h" | 62 #include "ui/events/event_constants.h" |
| 63 #include "ui/gfx/canvas.h" | 63 #include "ui/gfx/canvas.h" |
| 64 #include "ui/gfx/skia_util.h" | 64 #include "ui/gfx/skia_util.h" |
| 65 #include "ui/message_center/message_center.h" | 65 #include "ui/message_center/message_center.h" |
| 66 #include "ui/message_center/message_center_style.h" | 66 #include "ui/message_center/message_center_style.h" |
| 67 #include "ui/native_theme/native_theme.h" | |
| 68 #include "ui/views/border.h" | 67 #include "ui/views/border.h" |
| 69 #include "ui/views/controls/label.h" | 68 #include "ui/views/controls/label.h" |
| 70 #include "ui/views/view.h" | 69 #include "ui/views/view.h" |
| 71 #include "ui/views/widget/widget.h" | 70 #include "ui/views/widget/widget.h" |
| 72 #include "ui/wm/core/window_util.h" | 71 #include "ui/wm/core/window_util.h" |
| 73 #include "ui/wm/public/activation_change_observer.h" | 72 #include "ui/wm/public/activation_change_observer.h" |
| 74 #include "ui/wm/public/activation_client.h" | 73 #include "ui/wm/public/activation_client.h" |
| 75 | 74 |
| 76 using views::TrayBubbleView; | 75 using views::TrayBubbleView; |
| 77 | 76 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 full_system_tray_menu_ = items.size() > 1; | 465 full_system_tray_menu_ = items.size() > 1; |
| 467 | 466 |
| 468 TrayBubbleView::InitParams init_params( | 467 TrayBubbleView::InitParams init_params( |
| 469 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); | 468 GetAnchorAlignment(), kTrayMenuMinimumWidth, kTrayPopupMaxWidth); |
| 470 // TODO(oshima): Change TrayBubbleView itself. | 469 // TODO(oshima): Change TrayBubbleView itself. |
| 471 init_params.can_activate = false; | 470 init_params.can_activate = false; |
| 472 if (detailed) { | 471 if (detailed) { |
| 473 // 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 |
| 474 // is created. | 473 // is created. |
| 475 init_params.max_height = default_bubble_height_; | 474 init_params.max_height = default_bubble_height_; |
| 475 init_params.bg_color = kBackgroundColor; |
| 476 } else { | 476 } else { |
| 477 init_params.bg_color = kHeaderBackgroundColor; | 477 init_params.bg_color = kHeaderBackgroundColor; |
| 478 } | 478 } |
| 479 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) | 479 if (bubble_type == SystemTrayBubble::BUBBLE_TYPE_DEFAULT) |
| 480 init_params.close_on_deactivate = !persistent; | 480 init_params.close_on_deactivate = !persistent; |
| 481 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); | 481 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); |
| 482 | 482 |
| 483 system_bubble_.reset(new SystemBubbleWrapper(bubble)); | 483 system_bubble_.reset(new SystemBubbleWrapper(bubble)); |
| 484 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), | 484 system_bubble_->InitView(this, GetBubbleAnchor(), GetBubbleAnchorInsets(), |
| 485 &init_params, persistent); | 485 &init_params, persistent); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 .work_area() | 717 .work_area() |
| 718 .height(); | 718 .height(); |
| 719 if (work_area_height > 0) { | 719 if (work_area_height > 0) { |
| 720 UMA_HISTOGRAM_CUSTOM_COUNTS( | 720 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 721 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 721 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 722 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 722 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 } // namespace ash | 726 } // namespace ash |
| OLD | NEW |