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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 16092013: Use base::MessageLoop in more files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again, sigh Created 7 years, 6 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 | « apps/shell_window_geometry_cache_unittest.cc ('k') | ash/test/ash_test_helper.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 "ash/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 const ui::Event& event) { 457 const ui::Event& event) {
458 DCHECK_EQ(button_, sender); 458 DCHECK_EQ(button_, sender);
459 PerformAction(event); 459 PerformAction(event);
460 } 460 }
461 461
462 void WebNotificationTray::OnMessageCenterTrayChanged() { 462 void WebNotificationTray::OnMessageCenterTrayChanged() {
463 // Do not update the tray contents directly. Multiple change events can happen 463 // Do not update the tray contents directly. Multiple change events can happen
464 // consecutively, and calling Update in the middle of those events will show 464 // consecutively, and calling Update in the middle of those events will show
465 // intermediate unread counts for a moment. 465 // intermediate unread counts for a moment.
466 should_update_tray_content_ = true; 466 should_update_tray_content_ = true;
467 MessageLoop::current()->PostTask( 467 base::MessageLoop::current()->PostTask(
468 FROM_HERE, 468 FROM_HERE,
469 base::Bind(&WebNotificationTray::UpdateTrayContent, AsWeakPtr())); 469 base::Bind(&WebNotificationTray::UpdateTrayContent, AsWeakPtr()));
470 } 470 }
471 471
472 void WebNotificationTray::UpdateTrayContent() { 472 void WebNotificationTray::UpdateTrayContent() {
473 if (!should_update_tray_content_) 473 if (!should_update_tray_content_)
474 return; 474 return;
475 should_update_tray_content_ = false; 475 should_update_tray_content_ = false;
476 476
477 message_center::MessageCenter* message_center = 477 message_center::MessageCenter* message_center =
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 message_center::MessagePopupBubble* 517 message_center::MessagePopupBubble*
518 WebNotificationTray::GetPopupBubbleForTest() { 518 WebNotificationTray::GetPopupBubbleForTest() {
519 if (!popup_bubble()) 519 if (!popup_bubble())
520 return NULL; 520 return NULL;
521 return static_cast<message_center::MessagePopupBubble*>( 521 return static_cast<message_center::MessagePopupBubble*>(
522 popup_bubble()->bubble()); 522 popup_bubble()->bubble());
523 } 523 }
524 524
525 } // namespace ash 525 } // namespace ash
OLDNEW
« no previous file with comments | « apps/shell_window_geometry_cache_unittest.cc ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698