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

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: rebase Created 7 years, 9 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 suspended_nav_message_(NULL), 168 suspended_nav_message_(NULL),
169 is_swapped_out_(swapped_out), 169 is_swapped_out_(swapped_out),
170 is_subframe_(false), 170 is_subframe_(false),
171 run_modal_reply_msg_(NULL), 171 run_modal_reply_msg_(NULL),
172 run_modal_opener_id_(MSG_ROUTING_NONE), 172 run_modal_opener_id_(MSG_ROUTING_NONE),
173 is_waiting_for_beforeunload_ack_(false), 173 is_waiting_for_beforeunload_ack_(false),
174 is_waiting_for_unload_ack_(false), 174 is_waiting_for_unload_ack_(false),
175 has_timed_out_on_unload_(false), 175 has_timed_out_on_unload_(false),
176 unload_ack_is_for_cross_site_transition_(false), 176 unload_ack_is_for_cross_site_transition_(false),
177 are_javascript_messages_suppressed_(false), 177 are_javascript_messages_suppressed_(false),
178 accessibility_layout_callback_(base::Bind(&base::DoNothing)),
179 accessibility_load_callback_(base::Bind(&base::DoNothing)),
180 accessibility_other_callback_(base::Bind(&base::DoNothing)),
178 sudden_termination_allowed_(false), 181 sudden_termination_allowed_(false),
179 session_storage_namespace_( 182 session_storage_namespace_(
180 static_cast<SessionStorageNamespaceImpl*>(session_storage)), 183 static_cast<SessionStorageNamespaceImpl*>(session_storage)),
181 save_accessibility_tree_for_testing_(false), 184 save_accessibility_tree_for_testing_(false),
182 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { 185 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
183 DCHECK(session_storage_namespace_); 186 DCHECK(session_storage_namespace_);
184 DCHECK(instance_); 187 DCHECK(instance_);
185 CHECK(delegate_); // http://crbug.com/82827 188 CHECK(delegate_); // http://crbug.com/82827
186 189
187 GetProcess()->EnableSendQueue(); 190 GetProcess()->EnableSendQueue();
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 // This should only be called when swapped out. 1778 // This should only be called when swapped out.
1776 DCHECK(is_swapped_out_); 1779 DCHECK(is_swapped_out_);
1777 1780
1778 frame_tree_ = frame_tree; 1781 frame_tree_ = frame_tree;
1779 Send(new ViewMsg_UpdateFrameTree(GetRoutingID(), 1782 Send(new ViewMsg_UpdateFrameTree(GetRoutingID(),
1780 process_id, 1783 process_id,
1781 route_id, 1784 route_id,
1782 frame_tree_)); 1785 frame_tree_));
1783 } 1786 }
1784 1787
1788 void RenderViewHostImpl::SetAccessibilityLayoutCompleteCallbackForTesting(
1789 const base::Closure& callback) {
1790 accessibility_layout_callback_ = callback;
1791 }
1792
1793 void RenderViewHostImpl::SetAccessibilityLoadCompleteCallbackForTesting(
1794 const base::Closure& callback) {
1795 accessibility_load_callback_ = callback;
1796 }
1797
1798 void RenderViewHostImpl::SetAccessibilityOtherCallbackForTesting(
1799 const base::Closure& callback) {
1800 accessibility_other_callback_ = callback;
1801 }
1802
1785 void RenderViewHostImpl::UpdateWebkitPreferences( 1803 void RenderViewHostImpl::UpdateWebkitPreferences(
1786 const webkit_glue::WebPreferences& prefs) { 1804 const webkit_glue::WebPreferences& prefs) {
1787 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); 1805 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs));
1788 } 1806 }
1789 1807
1790 void RenderViewHostImpl::NotifyTimezoneChange() { 1808 void RenderViewHostImpl::NotifyTimezoneChange() {
1791 Send(new ViewMsg_TimezoneChange(GetRoutingID())); 1809 Send(new ViewMsg_TimezoneChange(GetRoutingID()));
1792 } 1810 }
1793 1811
1794 void RenderViewHostImpl::ClearFocusedNode() { 1812 void RenderViewHostImpl::ClearFocusedNode() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 for (unsigned i = 0; i < params.size(); i++) { 1899 for (unsigned i = 0; i < params.size(); i++) {
1882 const AccessibilityHostMsg_NotificationParams& param = params[i]; 1900 const AccessibilityHostMsg_NotificationParams& param = params[i];
1883 AccessibilityNotification src_type = param.notification_type; 1901 AccessibilityNotification src_type = param.notification_type;
1884 1902
1885 if ((src_type == AccessibilityNotificationLayoutComplete || 1903 if ((src_type == AccessibilityNotificationLayoutComplete ||
1886 src_type == AccessibilityNotificationLoadComplete) && 1904 src_type == AccessibilityNotificationLoadComplete) &&
1887 save_accessibility_tree_for_testing_) { 1905 save_accessibility_tree_for_testing_) {
1888 accessibility_tree_ = param.acc_tree; 1906 accessibility_tree_ = param.acc_tree;
1889 } 1907 }
1890 1908
1891 NotificationType dst_type; 1909 if (src_type == AccessibilityNotificationLayoutComplete) {
1892 if (src_type == AccessibilityNotificationLoadComplete) 1910 accessibility_layout_callback_.Run();
1893 dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE; 1911 } else if (src_type == AccessibilityNotificationLoadComplete) {
1894 else if (src_type == AccessibilityNotificationLayoutComplete) 1912 accessibility_load_callback_.Run();
1895 dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE; 1913 } else {
1896 else 1914 accessibility_other_callback_.Run();
1897 dst_type = NOTIFICATION_ACCESSIBILITY_OTHER; 1915 }
1898 NotificationService::current()->Notify(
1899 dst_type,
1900 Source<RenderViewHost>(this),
1901 NotificationService::NoDetails());
1902 } 1916 }
1903 1917
1904 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); 1918 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID()));
1905 } 1919 }
1906 1920
1907 void RenderViewHostImpl::OnScriptEvalResponse(int id, 1921 void RenderViewHostImpl::OnScriptEvalResponse(int id,
1908 const base::ListValue& result) { 1922 const base::ListValue& result) {
1909 const base::Value* result_value; 1923 const base::Value* result_value;
1910 if (!result.Get(0, &result_value)) { 1924 if (!result.Get(0, &result_value)) {
1911 // Programming error or rogue renderer. 1925 // Programming error or rogue renderer.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 GetRoutingID(), snapshot_id, snapshot_size, png)); 2072 GetRoutingID(), snapshot_id, snapshot_size, png));
2059 return; 2073 return;
2060 } 2074 }
2061 } 2075 }
2062 2076
2063 Send(new ViewMsg_WindowSnapshotCompleted( 2077 Send(new ViewMsg_WindowSnapshotCompleted(
2064 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2078 GetRoutingID(), snapshot_id, gfx::Size(), png));
2065 } 2079 }
2066 2080
2067 } // namespace content 2081 } // 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