| 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 |
| 24 MessageBubbleBase::MessageBubbleBase(MessageCenter* message_center, | 27 MessageBubbleBase::MessageBubbleBase(MessageCenter* message_center, |
| 25 MessageCenterTray* tray) | 28 MessageCenterTray* tray) |
| 26 : message_center_(message_center), | 29 : message_center_(message_center), |
| 27 tray_(tray), | 30 tray_(tray), |
| 28 bubble_view_(NULL), | 31 bubble_view_(NULL), |
| 29 max_height_(kMessageBubbleBaseDefaultMaxHeight), | 32 max_height_(kMessageBubbleBaseDefaultMaxHeight), |
| 30 weak_ptr_factory_(this) { | 33 weak_ptr_factory_(this) { |
| 31 } | 34 } |
| 32 | 35 |
| 33 MessageBubbleBase::~MessageBubbleBase() { | 36 MessageBubbleBase::~MessageBubbleBase() { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 views::TrayBubbleView::AnchorAlignment anchor_alignment) { | 71 views::TrayBubbleView::AnchorAlignment anchor_alignment) { |
| 69 views::TrayBubbleView::InitParams init_params( | 72 views::TrayBubbleView::InitParams init_params( |
| 70 anchor_alignment, | 73 anchor_alignment, |
| 71 kNotificationWidth, | 74 kNotificationWidth, |
| 72 kNotificationWidth); | 75 kNotificationWidth); |
| 73 init_params.bg_color = kBackgroundDarkColor; | 76 init_params.bg_color = kBackgroundDarkColor; |
| 74 return init_params; | 77 return init_params; |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace message_center | 80 } // namespace message_center |
| OLD | NEW |