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

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: windows 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 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 1788
1789 void RenderViewHostImpl::UpdateWebkitPreferences( 1789 void RenderViewHostImpl::UpdateWebkitPreferences(
1790 const webkit_glue::WebPreferences& prefs) { 1790 const webkit_glue::WebPreferences& prefs) {
1791 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); 1791 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs));
1792 } 1792 }
1793 1793
1794 void RenderViewHostImpl::NotifyTimezoneChange() { 1794 void RenderViewHostImpl::NotifyTimezoneChange() {
1795 Send(new ViewMsg_TimezoneChange(GetRoutingID())); 1795 Send(new ViewMsg_TimezoneChange(GetRoutingID()));
1796 } 1796 }
1797 1797
1798 void RenderViewHostImpl::SetAccessibilityLayoutCompleteCallbackForTesting(
1799 const base::Closure& callback) {
1800 accessibility_layout_callback_ = callback;
1801 }
1802
1803 void RenderViewHostImpl::SetAccessibilityLoadCompleteCallbackForTesting(
1804 const base::Closure& callback) {
1805 accessibility_load_callback_ = callback;
1806 }
1807
1808 void RenderViewHostImpl::SetAccessibilityOtherCallbackForTesting(
1809 const base::Closure& callback) {
1810 accessibility_other_callback_ = callback;
1811 }
1812
1798 void RenderViewHostImpl::ClearFocusedNode() { 1813 void RenderViewHostImpl::ClearFocusedNode() {
1799 Send(new ViewMsg_ClearFocusedNode(GetRoutingID())); 1814 Send(new ViewMsg_ClearFocusedNode(GetRoutingID()));
1800 } 1815 }
1801 1816
1802 void RenderViewHostImpl::SetZoomLevel(double level) { 1817 void RenderViewHostImpl::SetZoomLevel(double level) {
1803 Send(new ViewMsg_SetZoomLevel(GetRoutingID(), level)); 1818 Send(new ViewMsg_SetZoomLevel(GetRoutingID(), level));
1804 } 1819 }
1805 1820
1806 void RenderViewHostImpl::Zoom(PageZoom zoom) { 1821 void RenderViewHostImpl::Zoom(PageZoom zoom) {
1807 Send(new ViewMsg_Zoom(GetRoutingID(), zoom)); 1822 Send(new ViewMsg_Zoom(GetRoutingID(), zoom));
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 for (unsigned i = 0; i < params.size(); i++) { 1900 for (unsigned i = 0; i < params.size(); i++) {
1886 const AccessibilityHostMsg_NotificationParams& param = params[i]; 1901 const AccessibilityHostMsg_NotificationParams& param = params[i];
1887 AccessibilityNotification src_type = param.notification_type; 1902 AccessibilityNotification src_type = param.notification_type;
1888 1903
1889 if ((src_type == AccessibilityNotificationLayoutComplete || 1904 if ((src_type == AccessibilityNotificationLayoutComplete ||
1890 src_type == AccessibilityNotificationLoadComplete) && 1905 src_type == AccessibilityNotificationLoadComplete) &&
1891 save_accessibility_tree_for_testing_) { 1906 save_accessibility_tree_for_testing_) {
1892 accessibility_tree_ = param.acc_tree; 1907 accessibility_tree_ = param.acc_tree;
1893 } 1908 }
1894 1909
1895 NotificationType dst_type; 1910 if (src_type == AccessibilityNotificationLayoutComplete) {
1896 if (src_type == AccessibilityNotificationLoadComplete) 1911 accessibility_layout_callback_.Run();
1897 dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE; 1912 } else if (src_type == AccessibilityNotificationLoadComplete) {
1898 else if (src_type == AccessibilityNotificationLayoutComplete) 1913 accessibility_load_callback_.Run();
1899 dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE; 1914 } else {
1900 else 1915 accessibility_other_callback_.Run();
1901 dst_type = NOTIFICATION_ACCESSIBILITY_OTHER; 1916 }
1902 NotificationService::current()->Notify(
1903 dst_type,
1904 Source<RenderViewHost>(this),
1905 NotificationService::NoDetails());
1906 } 1917 }
1907 1918
1908 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); 1919 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID()));
1909 } 1920 }
1910 1921
1911 void RenderViewHostImpl::OnScriptEvalResponse(int id, 1922 void RenderViewHostImpl::OnScriptEvalResponse(int id,
1912 const base::ListValue& result) { 1923 const base::ListValue& result) {
1913 const base::Value* result_value; 1924 const base::Value* result_value;
1914 if (!result.Get(0, &result_value)) { 1925 if (!result.Get(0, &result_value)) {
1915 // Programming error or rogue renderer. 1926 // Programming error or rogue renderer.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 GetRoutingID(), snapshot_id, snapshot_size, png)); 2082 GetRoutingID(), snapshot_id, snapshot_size, png));
2072 return; 2083 return;
2073 } 2084 }
2074 } 2085 }
2075 2086
2076 Send(new ViewMsg_WindowSnapshotCompleted( 2087 Send(new ViewMsg_WindowSnapshotCompleted(
2077 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2088 GetRoutingID(), snapshot_id, gfx::Size(), png));
2078 } 2089 }
2079 2090
2080 } // namespace content 2091 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698