| 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/message_bubble_base.h" | 5 #include "ui/message_center/message_bubble_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/message_center/message_view.h" | 8 #include "ui/message_center/message_view.h" |
| 9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
| 10 #include "ui/views/widget/widget_observer.h" | 10 #include "ui/views/widget/widget_observer.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 // Delay laying out the MessageBubbleBase until all notifications have been | 13 // Delay laying out the MessageBubbleBase until all notifications have been |
| 14 // added and icons have had a chance to load. | 14 // added and icons have had a chance to load. |
| 15 const int kUpdateDelayMs = 50; | 15 const int kUpdateDelayMs = 50; |
| 16 const int kNotificationBubbleWidth = 300; | |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace message_center { | 18 namespace message_center { |
| 20 | 19 |
| 21 const SkColor MessageBubbleBase::kBackgroundColor = | 20 const SkColor MessageBubbleBase::kBackgroundColor = |
| 22 SkColorSetRGB(0xfe, 0xfe, 0xfe); | 21 SkColorSetRGB(0xfe, 0xfe, 0xfe); |
| 23 const SkColor MessageBubbleBase::kHeaderBackgroundColorLight = | 22 const SkColor MessageBubbleBase::kHeaderBackgroundColorLight = |
| 24 SkColorSetRGB(0xf1, 0xf1, 0xf1); | 23 SkColorSetRGB(0xf1, 0xf1, 0xf1); |
| 25 const SkColor MessageBubbleBase::kHeaderBackgroundColorDark = | 24 const SkColor MessageBubbleBase::kHeaderBackgroundColorDark = |
| 26 SkColorSetRGB(0xe7, 0xe7, 0xe7); | 25 SkColorSetRGB(0xe7, 0xe7, 0xe7); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 | 51 |
| 53 bool MessageBubbleBase::IsVisible() const { | 52 bool MessageBubbleBase::IsVisible() const { |
| 54 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); | 53 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); |
| 55 } | 54 } |
| 56 | 55 |
| 57 views::TrayBubbleView::InitParams MessageBubbleBase::GetDefaultInitParams( | 56 views::TrayBubbleView::InitParams MessageBubbleBase::GetDefaultInitParams( |
| 58 views::TrayBubbleView::AnchorAlignment anchor_alignment) { | 57 views::TrayBubbleView::AnchorAlignment anchor_alignment) { |
| 59 views::TrayBubbleView::InitParams init_params( | 58 views::TrayBubbleView::InitParams init_params( |
| 60 views::TrayBubbleView::ANCHOR_TYPE_TRAY, | 59 views::TrayBubbleView::ANCHOR_TYPE_TRAY, |
| 61 anchor_alignment, | 60 anchor_alignment, |
| 62 kNotificationBubbleWidth); | 61 kWebNotificationWidth, |
| 62 kWebNotificationWidth); |
| 63 init_params.arrow_color = kHeaderBackgroundColorDark; | 63 init_params.arrow_color = kHeaderBackgroundColorDark; |
| 64 init_params.bubble_width = kWebNotificationWidth; | |
| 65 return init_params; | 64 return init_params; |
| 66 } | 65 } |
| 67 | 66 |
| 68 } // namespace message_center | 67 } // namespace message_center |
| OLD | NEW |