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 "ui/message_center/views/message_bubble_base.h" | 5 #include "ui/message_center/views/message_bubble_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "ui/message_center/message_center_style.h" | 11 #include "ui/message_center/message_center_style.h" |
12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
13 #include "ui/views/widget/widget_observer.h" | 13 #include "ui/views/widget/widget_observer.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 // Delay laying out the MessageBubbleBase until all notifications have been | 16 // Delay laying out the MessageBubbleBase until all notifications have been |
17 // added and icons have had a chance to load. | 17 // added and icons have had a chance to load. |
18 const int kUpdateDelayMs = 50; | 18 const int kUpdateDelayMs = 50; |
19 const int kMessageBubbleBaseDefaultMaxHeight = 400; | 19 const int kMessageBubbleBaseDefaultMaxHeight = 400; |
20 } | 20 } |
21 | 21 |
22 namespace message_center { | 22 namespace message_center { |
23 | 23 |
24 const SkColor MessageBubbleBase::kBackgroundColor = | |
25 SkColorSetRGB(0xfe, 0xfe, 0xfe); | |
26 | |
27 MessageBubbleBase::MessageBubbleBase(MessageCenter* message_center, | 24 MessageBubbleBase::MessageBubbleBase(MessageCenter* message_center, |
28 MessageCenterTray* tray) | 25 MessageCenterTray* tray) |
29 : message_center_(message_center), | 26 : message_center_(message_center), |
30 tray_(tray), | 27 tray_(tray), |
31 bubble_view_(NULL), | 28 bubble_view_(NULL), |
32 max_height_(kMessageBubbleBaseDefaultMaxHeight), | 29 max_height_(kMessageBubbleBaseDefaultMaxHeight), |
33 weak_ptr_factory_(this) { | 30 weak_ptr_factory_(this) { |
34 } | 31 } |
35 | 32 |
36 MessageBubbleBase::~MessageBubbleBase() { | 33 MessageBubbleBase::~MessageBubbleBase() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 views::TrayBubbleView::AnchorAlignment anchor_alignment) { | 68 views::TrayBubbleView::AnchorAlignment anchor_alignment) { |
72 views::TrayBubbleView::InitParams init_params( | 69 views::TrayBubbleView::InitParams init_params( |
73 anchor_alignment, | 70 anchor_alignment, |
74 kNotificationWidth, | 71 kNotificationWidth, |
75 kNotificationWidth); | 72 kNotificationWidth); |
76 init_params.bg_color = kBackgroundDarkColor; | 73 init_params.bg_color = kBackgroundDarkColor; |
77 return init_params; | 74 return init_params; |
78 } | 75 } |
79 | 76 |
80 } // namespace message_center | 77 } // namespace message_center |
OLD | NEW |