OLD | NEW |
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 Loading... |
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 |
1789 void RenderViewHostImpl::UpdateWebkitPreferences( | 1799 void RenderViewHostImpl::UpdateWebkitPreferences( |
1790 const webkit_glue::WebPreferences& prefs) { | 1800 const webkit_glue::WebPreferences& prefs) { |
1791 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 1801 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
1792 } | 1802 } |
1793 | 1803 |
1794 void RenderViewHostImpl::NotifyTimezoneChange() { | 1804 void RenderViewHostImpl::NotifyTimezoneChange() { |
1795 Send(new ViewMsg_TimezoneChange(GetRoutingID())); | 1805 Send(new ViewMsg_TimezoneChange(GetRoutingID())); |
1796 } | 1806 } |
1797 | 1807 |
1798 void RenderViewHostImpl::ClearFocusedNode() { | 1808 void RenderViewHostImpl::ClearFocusedNode() { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 for (unsigned i = 0; i < params.size(); i++) { | 1895 for (unsigned i = 0; i < params.size(); i++) { |
1886 const AccessibilityHostMsg_NotificationParams& param = params[i]; | 1896 const AccessibilityHostMsg_NotificationParams& param = params[i]; |
1887 AccessibilityNotification src_type = param.notification_type; | 1897 AccessibilityNotification src_type = param.notification_type; |
1888 | 1898 |
1889 if ((src_type == AccessibilityNotificationLayoutComplete || | 1899 if ((src_type == AccessibilityNotificationLayoutComplete || |
1890 src_type == AccessibilityNotificationLoadComplete) && | 1900 src_type == AccessibilityNotificationLoadComplete) && |
1891 save_accessibility_tree_for_testing_) { | 1901 save_accessibility_tree_for_testing_) { |
1892 accessibility_tree_ = param.acc_tree; | 1902 accessibility_tree_ = param.acc_tree; |
1893 } | 1903 } |
1894 | 1904 |
1895 NotificationType dst_type; | 1905 if (src_type == AccessibilityNotificationLayoutComplete) { |
1896 if (src_type == AccessibilityNotificationLoadComplete) | 1906 accessibility_layout_callback_.Run(); |
1897 dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE; | 1907 } else if (src_type == AccessibilityNotificationLoadComplete) { |
1898 else if (src_type == AccessibilityNotificationLayoutComplete) | 1908 accessibility_load_callback_.Run(); |
1899 dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE; | 1909 } |
1900 else | |
1901 dst_type = NOTIFICATION_ACCESSIBILITY_OTHER; | |
1902 NotificationService::current()->Notify( | |
1903 dst_type, | |
1904 Source<RenderViewHost>(this), | |
1905 NotificationService::NoDetails()); | |
1906 } | 1910 } |
1907 | 1911 |
1908 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); | 1912 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); |
1909 } | 1913 } |
1910 | 1914 |
1911 void RenderViewHostImpl::OnScriptEvalResponse(int id, | 1915 void RenderViewHostImpl::OnScriptEvalResponse(int id, |
1912 const base::ListValue& result) { | 1916 const base::ListValue& result) { |
1913 const base::Value* result_value; | 1917 const base::Value* result_value; |
1914 if (!result.Get(0, &result_value)) { | 1918 if (!result.Get(0, &result_value)) { |
1915 // Programming error or rogue renderer. | 1919 // Programming error or rogue renderer. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 GetRoutingID(), snapshot_id, snapshot_size, png)); | 2075 GetRoutingID(), snapshot_id, snapshot_size, png)); |
2072 return; | 2076 return; |
2073 } | 2077 } |
2074 } | 2078 } |
2075 | 2079 |
2076 Send(new ViewMsg_WindowSnapshotCompleted( | 2080 Send(new ViewMsg_WindowSnapshotCompleted( |
2077 GetRoutingID(), snapshot_id, gfx::Size(), png)); | 2081 GetRoutingID(), snapshot_id, gfx::Size(), png)); |
2078 } | 2082 } |
2079 | 2083 |
2080 } // namespace content | 2084 } // namespace content |
OLD | NEW |