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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 12210082: content: convert accessibility notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots 2 Created 7 years, 10 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 "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 for (unsigned i = 0; i < params.size(); i++) { 1885 for (unsigned i = 0; i < params.size(); i++) {
1886 const AccessibilityHostMsg_NotificationParams& param = params[i]; 1886 const AccessibilityHostMsg_NotificationParams& param = params[i];
1887 AccessibilityNotification src_type = param.notification_type; 1887 AccessibilityNotification src_type = param.notification_type;
1888 1888
1889 if ((src_type == AccessibilityNotificationLayoutComplete || 1889 if ((src_type == AccessibilityNotificationLayoutComplete ||
1890 src_type == AccessibilityNotificationLoadComplete) && 1890 src_type == AccessibilityNotificationLoadComplete) &&
1891 save_accessibility_tree_for_testing_) { 1891 save_accessibility_tree_for_testing_) {
1892 accessibility_tree_ = param.acc_tree; 1892 accessibility_tree_ = param.acc_tree;
1893 } 1893 }
1894 1894
1895 NotificationType dst_type; 1895 if (src_type == AccessibilityNotificationLayoutComplete) {
1896 if (src_type == AccessibilityNotificationLoadComplete) 1896 FOR_EACH_OBSERVER(RenderViewHostObserver, observers_,
1897 dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE; 1897 AccessibilityLayoutComplete());
1898 else if (src_type == AccessibilityNotificationLayoutComplete) 1898 } else if (src_type == AccessibilityNotificationLoadComplete) {
1899 dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE; 1899 FOR_EACH_OBSERVER(RenderViewHostObserver, observers_,
1900 else 1900 AccessibilityLoadComplete());
1901 dst_type = NOTIFICATION_ACCESSIBILITY_OTHER; 1901 }
1902 NotificationService::current()->Notify(
1903 dst_type,
1904 Source<RenderViewHost>(this),
1905 NotificationService::NoDetails());
1906 } 1902 }
1907 1903
1908 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); 1904 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID()));
1909 } 1905 }
1910 1906
1911 void RenderViewHostImpl::OnScriptEvalResponse(int id, 1907 void RenderViewHostImpl::OnScriptEvalResponse(int id,
1912 const base::ListValue& result) { 1908 const base::ListValue& result) {
1913 const base::Value* result_value; 1909 const base::Value* result_value;
1914 if (!result.Get(0, &result_value)) { 1910 if (!result.Get(0, &result_value)) {
1915 // Programming error or rogue renderer. 1911 // Programming error or rogue renderer.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 GetRoutingID(), snapshot_id, snapshot_size, png)); 2067 GetRoutingID(), snapshot_id, snapshot_size, png));
2072 return; 2068 return;
2073 } 2069 }
2074 } 2070 }
2075 2071
2076 Send(new ViewMsg_WindowSnapshotCompleted( 2072 Send(new ViewMsg_WindowSnapshotCompleted(
2077 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2073 GetRoutingID(), snapshot_id, gfx::Size(), png));
2078 } 2074 }
2079 2075
2080 } // namespace content 2076 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698