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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility_complete.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | « content/public/test/test_utils.cc ('k') | content/renderer/browser_plugin/browser_plugin.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 "content/renderer/accessibility/renderer_accessibility_complete.h" 5 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/renderer/accessibility/accessibility_node_serializer.h" 9 #include "content/renderer/accessibility/accessibility_node_serializer.h"
10 #include "content/renderer/render_view_impl.h" 10 #include "content/renderer/render_view_impl.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 acc_notification.notification_type) { 220 acc_notification.notification_type) {
221 return; 221 return;
222 } 222 }
223 } 223 }
224 pending_notifications_.push_back(acc_notification); 224 pending_notifications_.push_back(acc_notification);
225 225
226 if (!ack_pending_ && !weak_factory_.HasWeakPtrs()) { 226 if (!ack_pending_ && !weak_factory_.HasWeakPtrs()) {
227 // When no accessibility notifications are in-flight post a task to send 227 // When no accessibility notifications are in-flight post a task to send
228 // the notifications to the browser. We use PostTask so that we can queue 228 // the notifications to the browser. We use PostTask so that we can queue
229 // up additional notifications. 229 // up additional notifications.
230 MessageLoop::current()->PostTask( 230 base::MessageLoop::current()->PostTask(
231 FROM_HERE, 231 FROM_HERE,
232 base::Bind( 232 base::Bind(&RendererAccessibilityComplete::
233 &RendererAccessibilityComplete:: 233 SendPendingAccessibilityNotifications,
234 SendPendingAccessibilityNotifications, 234 weak_factory_.GetWeakPtr()));
235 weak_factory_.GetWeakPtr()));
236 } 235 }
237 } 236 }
238 237
239 RendererAccessibilityComplete::BrowserTreeNode::BrowserTreeNode() : id(0) {} 238 RendererAccessibilityComplete::BrowserTreeNode::BrowserTreeNode() : id(0) {}
240 239
241 RendererAccessibilityComplete::BrowserTreeNode::~BrowserTreeNode() {} 240 RendererAccessibilityComplete::BrowserTreeNode::~BrowserTreeNode() {}
242 241
243 void RendererAccessibilityComplete::SendPendingAccessibilityNotifications() { 242 void RendererAccessibilityComplete::SendPendingAccessibilityNotifications() {
244 const WebDocument& document = GetMainDocument(); 243 const WebDocument& document = GetMainDocument();
245 if (document.isNull()) 244 if (document.isNull())
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 render_view()->GetWebView()->clearFocusedNode(); 650 render_view()->GetWebView()->clearFocusedNode();
652 else 651 else
653 obj.setFocused(true); 652 obj.setFocused(true);
654 } 653 }
655 654
656 void RendererAccessibilityComplete::OnFatalError() { 655 void RendererAccessibilityComplete::OnFatalError() {
657 CHECK(false) << "Invalid accessibility tree."; 656 CHECK(false) << "Invalid accessibility tree.";
658 } 657 }
659 658
660 } // namespace content 659 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_utils.cc ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698