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

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

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « ui/gl/gl_context_cgl.cc ('k') | ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_constants.h" 8 #include "ui/message_center/message_center_constants.h"
9 #include "ui/message_center/message_center_util.h" 9 #include "ui/message_center/message_center_util.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 23 matching lines...) Expand all
34 bubble_view_->reset_delegate(); 34 bubble_view_->reset_delegate();
35 } 35 }
36 36
37 void MessageBubbleBase::BubbleViewDestroyed() { 37 void MessageBubbleBase::BubbleViewDestroyed() {
38 bubble_view_ = NULL; 38 bubble_view_ = NULL;
39 OnBubbleViewDestroyed(); 39 OnBubbleViewDestroyed();
40 } 40 }
41 41
42 void MessageBubbleBase::ScheduleUpdate() { 42 void MessageBubbleBase::ScheduleUpdate() {
43 weak_ptr_factory_.InvalidateWeakPtrs(); // Cancel any pending update. 43 weak_ptr_factory_.InvalidateWeakPtrs(); // Cancel any pending update.
44 MessageLoop::current()->PostDelayedTask( 44 base::MessageLoop::current()->PostDelayedTask(
45 FROM_HERE, 45 FROM_HERE,
46 base::Bind(&MessageBubbleBase::UpdateBubbleView, 46 base::Bind(&MessageBubbleBase::UpdateBubbleView,
47 weak_ptr_factory_.GetWeakPtr()), 47 weak_ptr_factory_.GetWeakPtr()),
48 base::TimeDelta::FromMilliseconds(kUpdateDelayMs)); 48 base::TimeDelta::FromMilliseconds(kUpdateDelayMs));
49 } 49 }
50 50
51 bool MessageBubbleBase::IsVisible() const { 51 bool MessageBubbleBase::IsVisible() const {
52 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); 52 return bubble_view() && bubble_view()->GetWidget()->IsVisible();
53 } 53 }
54 54
(...skipping 17 matching lines...) Expand all
72 views::TrayBubbleView::InitParams init_params( 72 views::TrayBubbleView::InitParams init_params(
73 views::TrayBubbleView::ANCHOR_TYPE_TRAY, 73 views::TrayBubbleView::ANCHOR_TYPE_TRAY,
74 anchor_alignment, 74 anchor_alignment,
75 kNotificationWidth, 75 kNotificationWidth,
76 kNotificationWidth); 76 kNotificationWidth);
77 init_params.arrow_color = kBackgroundDarkColor; 77 init_params.arrow_color = kBackgroundDarkColor;
78 return init_params; 78 return init_params;
79 } 79 }
80 80
81 } // namespace message_center 81 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/gl/gl_context_cgl.cc ('k') | ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698