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 "ui/message_center/message_center_util.h" | 8 #include "ui/message_center/message_center_util.h" |
9 #include "ui/message_center/views/message_view.h" | 9 #include "ui/message_center/views/message_view.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
11 #include "ui/views/widget/widget_observer.h" | 11 #include "ui/views/widget/widget_observer.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 // Delay laying out the MessageBubbleBase until all notifications have been | 14 // Delay laying out the MessageBubbleBase until all notifications have been |
15 // added and icons have had a chance to load. | 15 // added and icons have had a chance to load. |
16 const int kUpdateDelayMs = 50; | 16 const int kUpdateDelayMs = 50; |
17 const int kMessageBubbleBaseDefaultMaxHeight = 400; | 17 const int kMessageBubbleBaseDefaultMaxHeight = 400; |
18 } | 18 } |
19 | 19 |
20 namespace message_center { | 20 namespace message_center { |
21 | 21 |
22 const SkColor MessageBubbleBase::kBackgroundColor = | 22 const SkColor MessageBubbleBase::kBackgroundColor = |
23 SkColorSetRGB(0xfe, 0xfe, 0xfe); | 23 SkColorSetRGB(0xfe, 0xfe, 0xfe); |
24 const SkColor MessageBubbleBase::kHeaderBackgroundColorLight = | 24 const SkColor MessageBubbleBase::kHeaderBackgroundColorLight = |
25 SkColorSetRGB(0xf1, 0xf1, 0xf1); | 25 SkColorSetRGB(0xf1, 0xf1, 0xf1); |
26 const SkColor MessageBubbleBase::kHeaderBackgroundColorDark = | 26 const SkColor MessageBubbleBase::kHeaderBackgroundColorDark = |
27 SkColorSetRGB(0xe7, 0xe7, 0xe7); | 27 SkColorSetRGB(0xe7, 0xe7, 0xe7); |
28 | 28 |
29 MessageBubbleBase::MessageBubbleBase(NotificationList::Delegate* list_delegate) | 29 MessageBubbleBase::MessageBubbleBase(MessageCenter* message_center) |
30 : list_delegate_(list_delegate), | 30 : message_center_(message_center), |
31 bubble_view_(NULL), | 31 bubble_view_(NULL), |
32 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), | 32 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
33 max_height_(kMessageBubbleBaseDefaultMaxHeight) { | 33 max_height_(kMessageBubbleBaseDefaultMaxHeight) { |
34 } | 34 } |
35 | 35 |
36 MessageBubbleBase::~MessageBubbleBase() { | 36 MessageBubbleBase::~MessageBubbleBase() { |
37 if (bubble_view_) | 37 if (bubble_view_) |
38 bubble_view_->reset_delegate(); | 38 bubble_view_->reset_delegate(); |
39 } | 39 } |
40 | 40 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 views::TrayBubbleView::InitParams init_params( | 76 views::TrayBubbleView::InitParams init_params( |
77 views::TrayBubbleView::ANCHOR_TYPE_TRAY, | 77 views::TrayBubbleView::ANCHOR_TYPE_TRAY, |
78 anchor_alignment, | 78 anchor_alignment, |
79 kWebNotificationWidth, | 79 kWebNotificationWidth, |
80 kWebNotificationWidth); | 80 kWebNotificationWidth); |
81 init_params.arrow_color = kHeaderBackgroundColorDark; | 81 init_params.arrow_color = kHeaderBackgroundColorDark; |
82 return init_params; | 82 return init_params; |
83 } | 83 } |
84 | 84 |
85 } // namespace message_center | 85 } // namespace message_center |
OLD | NEW |