Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: ui/message_center/views/message_bubble_base.cc

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, rebase, and rebase again! Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/message_bubble_base.h ('k') | ui/message_center/views/message_center_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698