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

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

Issue 12212188: Revert "content: convert accessibility notifications to callbacks" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 // This should only be called when swapped out. 1779 // This should only be called when swapped out.
1780 DCHECK(is_swapped_out_); 1780 DCHECK(is_swapped_out_);
1781 1781
1782 frame_tree_ = frame_tree; 1782 frame_tree_ = frame_tree;
1783 Send(new ViewMsg_UpdateFrameTree(GetRoutingID(), 1783 Send(new ViewMsg_UpdateFrameTree(GetRoutingID(),
1784 process_id, 1784 process_id,
1785 route_id, 1785 route_id,
1786 frame_tree_)); 1786 frame_tree_));
1787 } 1787 }
1788 1788
1789 void RenderViewHostImpl::SetAccessibilityLayoutCompleteCallbackForTesting(
1790 const base::Closure& callback) {
1791 accessibility_layout_callback_ = callback;
1792 }
1793
1794 void RenderViewHostImpl::SetAccessibilityLoadCompleteCallbackForTesting(
1795 const base::Closure& callback) {
1796 accessibility_load_callback_ = callback;
1797 }
1798
1799 void RenderViewHostImpl::UpdateWebkitPreferences( 1789 void RenderViewHostImpl::UpdateWebkitPreferences(
1800 const webkit_glue::WebPreferences& prefs) { 1790 const webkit_glue::WebPreferences& prefs) {
1801 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); 1791 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs));
1802 } 1792 }
1803 1793
1804 void RenderViewHostImpl::NotifyTimezoneChange() { 1794 void RenderViewHostImpl::NotifyTimezoneChange() {
1805 Send(new ViewMsg_TimezoneChange(GetRoutingID())); 1795 Send(new ViewMsg_TimezoneChange(GetRoutingID()));
1806 } 1796 }
1807 1797
1808 void RenderViewHostImpl::ClearFocusedNode() { 1798 void RenderViewHostImpl::ClearFocusedNode() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 for (unsigned i = 0; i < params.size(); i++) { 1885 for (unsigned i = 0; i < params.size(); i++) {
1896 const AccessibilityHostMsg_NotificationParams& param = params[i]; 1886 const AccessibilityHostMsg_NotificationParams& param = params[i];
1897 AccessibilityNotification src_type = param.notification_type; 1887 AccessibilityNotification src_type = param.notification_type;
1898 1888
1899 if ((src_type == AccessibilityNotificationLayoutComplete || 1889 if ((src_type == AccessibilityNotificationLayoutComplete ||
1900 src_type == AccessibilityNotificationLoadComplete) && 1890 src_type == AccessibilityNotificationLoadComplete) &&
1901 save_accessibility_tree_for_testing_) { 1891 save_accessibility_tree_for_testing_) {
1902 accessibility_tree_ = param.acc_tree; 1892 accessibility_tree_ = param.acc_tree;
1903 } 1893 }
1904 1894
1905 if (src_type == AccessibilityNotificationLayoutComplete) { 1895 NotificationType dst_type;
1906 accessibility_layout_callback_.Run(); 1896 if (src_type == AccessibilityNotificationLoadComplete)
1907 } else if (src_type == AccessibilityNotificationLoadComplete) { 1897 dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE;
1908 accessibility_load_callback_.Run(); 1898 else if (src_type == AccessibilityNotificationLayoutComplete)
1909 } 1899 dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE;
1900 else
1901 dst_type = NOTIFICATION_ACCESSIBILITY_OTHER;
1902 NotificationService::current()->Notify(
1903 dst_type,
1904 Source<RenderViewHost>(this),
1905 NotificationService::NoDetails());
1910 } 1906 }
1911 1907
1912 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); 1908 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID()));
1913 } 1909 }
1914 1910
1915 void RenderViewHostImpl::OnScriptEvalResponse(int id, 1911 void RenderViewHostImpl::OnScriptEvalResponse(int id,
1916 const base::ListValue& result) { 1912 const base::ListValue& result) {
1917 const base::Value* result_value; 1913 const base::Value* result_value;
1918 if (!result.Get(0, &result_value)) { 1914 if (!result.Get(0, &result_value)) {
1919 // Programming error or rogue renderer. 1915 // Programming error or rogue renderer.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 GetRoutingID(), snapshot_id, snapshot_size, png)); 2071 GetRoutingID(), snapshot_id, snapshot_size, png));
2076 return; 2072 return;
2077 } 2073 }
2078 } 2074 }
2079 2075
2080 Send(new ViewMsg_WindowSnapshotCompleted( 2076 Send(new ViewMsg_WindowSnapshotCompleted(
2081 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2077 GetRoutingID(), snapshot_id, gfx::Size(), png));
2082 } 2078 }
2083 2079
2084 } // namespace content 2080 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698