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

Side by Side Diff: content/renderer/render_view.h

Issue 7966013: Rewrite renderer accessibility to not use WebAccessibilityCache. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_RENDERER_RENDER_VIEW_H_ 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_H_
6 #define CONTENT_RENDERER_RENDER_VIEW_H_ 6 #define CONTENT_RENDERER_RENDER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 14 matching lines...) Expand all
25 #include "content/renderer/renderer_webcookiejar_impl.h" 25 #include "content/renderer/renderer_webcookiejar_impl.h"
26 #include "content/common/content_export.h" 26 #include "content/common/content_export.h"
27 #include "content/common/edit_command.h" 27 #include "content/common/edit_command.h"
28 #include "content/common/intents_messages.h" 28 #include "content/common/intents_messages.h"
29 #include "content/common/navigation_gesture.h" 29 #include "content/common/navigation_gesture.h"
30 #include "content/common/page_zoom.h" 30 #include "content/common/page_zoom.h"
31 #include "content/common/renderer_preferences.h" 31 #include "content/common/renderer_preferences.h"
32 #include "content/renderer/pepper_plugin_delegate_impl.h" 32 #include "content/renderer/pepper_plugin_delegate_impl.h"
33 #include "content/renderer/render_widget.h" 33 #include "content/renderer/render_widget.h"
34 #include "ipc/ipc_platform_file.h" 34 #include "ipc/ipc_platform_file.h"
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityNotif ication.h"
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h"
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h" 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h"
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h" 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h" 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityStat e.h"
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h"
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h" 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h"
(...skipping 18 matching lines...) Expand all
64 class IntentsDispatcher; 63 class IntentsDispatcher;
65 class LoadProgressTracker; 64 class LoadProgressTracker;
66 class MediaStreamImpl; 65 class MediaStreamImpl;
67 class NavigationState; 66 class NavigationState;
68 class NotificationProvider; 67 class NotificationProvider;
69 class PepperDeviceTest; 68 class PepperDeviceTest;
70 class PrintWebViewHelper; 69 class PrintWebViewHelper;
71 class RenderViewObserver; 70 class RenderViewObserver;
72 class RenderViewVisitor; 71 class RenderViewVisitor;
73 class RenderWidgetFullscreenPepper; 72 class RenderWidgetFullscreenPepper;
73 class RendererAccessibility;
74 class SkBitmap; 74 class SkBitmap;
75 class SpeechInputDispatcher; 75 class SpeechInputDispatcher;
76 class WebPluginDelegateProxy; 76 class WebPluginDelegateProxy;
77 class WebUIBindings; 77 class WebUIBindings;
78 struct ContextMenuMediaParams; 78 struct ContextMenuMediaParams;
79 struct PP_Flash_NetAddress; 79 struct PP_Flash_NetAddress;
80 struct ViewHostMsg_RunFileChooser_Params; 80 struct ViewHostMsg_RunFileChooser_Params;
81 struct ViewMsg_SwapOut_Params; 81 struct ViewMsg_SwapOut_Params;
82 struct ViewMsg_Navigate_Params; 82 struct ViewMsg_Navigate_Params;
83 struct ViewMsg_StopFinding_Params; 83 struct ViewMsg_StopFinding_Params;
(...skipping 24 matching lines...) Expand all
108 namespace webkit_glue { 108 namespace webkit_glue {
109 struct CustomContextMenuContext; 109 struct CustomContextMenuContext;
110 class ImageResourceFetcher; 110 class ImageResourceFetcher;
111 struct FileUploadData; 111 struct FileUploadData;
112 struct FormData; 112 struct FormData;
113 struct PasswordFormFillData; 113 struct PasswordFormFillData;
114 class ResourceFetcher; 114 class ResourceFetcher;
115 } 115 }
116 116
117 namespace WebKit { 117 namespace WebKit {
118 class WebAccessibilityCache;
119 class WebAccessibilityObject;
120 class WebApplicationCacheHost; 118 class WebApplicationCacheHost;
121 class WebApplicationCacheHostClient; 119 class WebApplicationCacheHostClient;
122 class WebDataSource; 120 class WebDataSource;
123 class WebDocument; 121 class WebDocument;
124 class WebDragData; 122 class WebDragData;
125 class WebFrame; 123 class WebFrame;
126 class WebGeolocationClient; 124 class WebGeolocationClient;
127 class WebGeolocationServiceInterface; 125 class WebGeolocationServiceInterface;
128 class WebIconURL; 126 class WebIconURL;
129 class WebImage; 127 class WebImage;
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnUpdateWebPreferences); 683 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, OnUpdateWebPreferences);
686 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, StaleNavigationsIgnored); 684 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, StaleNavigationsIgnored);
687 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL); 685 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, UpdateTargetURLWithInvalidURL);
688 #if defined(OS_MACOSX) 686 #if defined(OS_MACOSX)
689 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp); 687 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, MacTestCmdUp);
690 #endif 688 #endif
691 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, SetHistoryLengthAndPrune); 689 FRIEND_TEST_ALL_PREFIXES(RenderViewTest, SetHistoryLengthAndPrune);
692 690
693 typedef std::map<GURL, double> HostZoomLevels; 691 typedef std::map<GURL, double> HostZoomLevels;
694 692
695 // Identifies an accessibility notification from webkit.
696 struct RendererAccessibilityNotification {
697 public:
698 bool ShouldIncludeChildren();
699
700 // The webkit glue id of the accessibility object.
701 int32 id;
702
703 // The accessibility notification type.
704 WebKit::WebAccessibilityNotification type;
705 };
706
707 enum ErrorPageType { 693 enum ErrorPageType {
708 DNS_ERROR, 694 DNS_ERROR,
709 HTTP_404, 695 HTTP_404,
710 CONNECTION_ERROR, 696 CONNECTION_ERROR,
711 }; 697 };
712 698
713 RenderView(RenderThreadBase* render_thread, 699 RenderView(RenderThreadBase* render_thread,
714 gfx::NativeViewId parent_hwnd, 700 gfx::NativeViewId parent_hwnd,
715 int32 opener_id, 701 int32 opener_id,
716 const RendererPreferences& renderer_prefs, 702 const RendererPreferences& renderer_prefs,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 735
750 bool RunJavaScriptMessage(int type, 736 bool RunJavaScriptMessage(int type,
751 const string16& message, 737 const string16& message,
752 const string16& default_value, 738 const string16& default_value,
753 const GURL& frame_url, 739 const GURL& frame_url,
754 string16* result); 740 string16* result);
755 741
756 // Sends a message and runs a nested message loop. 742 // Sends a message and runs a nested message loop.
757 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message); 743 bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
758 744
759 // Send queued accessibility notifications from the renderer to the browser.
760 void SendPendingAccessibilityNotifications();
761
762 // Called when the "pinned to left/right edge" state needs to be updated. 745 // Called when the "pinned to left/right edge" state needs to be updated.
763 void UpdateScrollState(WebKit::WebFrame* frame); 746 void UpdateScrollState(WebKit::WebFrame* frame);
764 747
765 // IPC message handlers ------------------------------------------------------ 748 // IPC message handlers ------------------------------------------------------
766 // 749 //
767 // The documentation for these functions should be in 750 // The documentation for these functions should be in
768 // render_messages_internal.h for the message that the function is handling. 751 // render_messages_internal.h for the message that the function is handling.
769 752
770 void OnAccessibilityDoDefaultAction(int acc_obj_id);
771 void OnAccessibilityNotificationsAck();
772 void OnAllowBindings(int enabled_bindings_flags); 753 void OnAllowBindings(int enabled_bindings_flags);
773 void OnAllowScriptToClose(bool script_can_close); 754 void OnAllowScriptToClose(bool script_can_close);
774 void OnAsyncFileOpened(base::PlatformFileError error_code, 755 void OnAsyncFileOpened(base::PlatformFileError error_code,
775 IPC::PlatformFileForTransit file_for_transit, 756 IPC::PlatformFileForTransit file_for_transit,
776 int message_id); 757 int message_id);
777 void OnPpapiBrokerChannelCreated(int request_id, 758 void OnPpapiBrokerChannelCreated(int request_id,
778 base::ProcessHandle broker_process_handle, 759 base::ProcessHandle broker_process_handle,
779 const IPC::ChannelHandle& handle); 760 const IPC::ChannelHandle& handle);
780 void OnCancelDownload(int32 download_id); 761 void OnCancelDownload(int32 download_id);
781 void OnClearFocusedNode(); 762 void OnClearFocusedNode();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 void OnDragTargetDragLeave(); 799 void OnDragTargetDragLeave();
819 void OnDragTargetDragOver(const gfx::Point& client_pt, 800 void OnDragTargetDragOver(const gfx::Point& client_pt,
820 const gfx::Point& screen_pt, 801 const gfx::Point& screen_pt,
821 WebKit::WebDragOperationsMask operations_allowed); 802 WebKit::WebDragOperationsMask operations_allowed);
822 void OnEnablePreferredSizeChangedMode(int flags); 803 void OnEnablePreferredSizeChangedMode(int flags);
823 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths); 804 void OnEnumerateDirectoryResponse(int id, const std::vector<FilePath>& paths);
824 void OnExecuteEditCommand(const std::string& name, const std::string& value); 805 void OnExecuteEditCommand(const std::string& name, const std::string& value);
825 void OnFileChooserResponse(const std::vector<FilePath>& paths); 806 void OnFileChooserResponse(const std::vector<FilePath>& paths);
826 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&); 807 void OnFind(int request_id, const string16&, const WebKit::WebFindOptions&);
827 void OnFindReplyAck(); 808 void OnFindReplyAck();
828 void OnEnableAccessibility();
829 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); 809 void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url);
830 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( 810 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
831 const std::vector<GURL>& links, 811 const std::vector<GURL>& links,
832 const std::vector<FilePath>& local_paths, 812 const std::vector<FilePath>& local_paths,
833 const FilePath& local_directory_name); 813 const FilePath& local_directory_name);
834 void OnLockMouseACK(bool succeeded); 814 void OnLockMouseACK(bool succeeded);
835 void OnMediaPlayerActionAt(const gfx::Point& location, 815 void OnMediaPlayerActionAt(const gfx::Point& location,
836 const WebKit::WebMediaPlayerAction& action); 816 const WebKit::WebMediaPlayerAction& action);
837 void OnMouseLockLost(); 817 void OnMouseLockLost();
838 void OnMoveOrResizeStarted(); 818 void OnMoveOrResizeStarted();
839 void OnNavigate(const ViewMsg_Navigate_Params& params); 819 void OnNavigate(const ViewMsg_Navigate_Params& params);
840 void OnPaste(); 820 void OnPaste();
841 #if defined(OS_MACOSX) 821 #if defined(OS_MACOSX)
842 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id); 822 void OnPluginImeCompositionCompleted(const string16& text, int plugin_id);
843 #endif 823 #endif
844 void OnRedo(); 824 void OnRedo();
845 void OnReloadFrame(); 825 void OnReloadFrame();
846 void OnReplace(const string16& text); 826 void OnReplace(const string16& text);
847 void OnReservePageIDRange(int size_of_range); 827 void OnReservePageIDRange(int size_of_range);
848 void OnResetPageEncodingToDefault(); 828 void OnResetPageEncodingToDefault();
849 void OnScriptEvalRequest(const string16& frame_xpath, 829 void OnScriptEvalRequest(const string16& frame_xpath,
850 const string16& jscript, 830 const string16& jscript,
851 int id, 831 int id,
852 bool notify_result); 832 bool notify_result);
853 void OnSelectAll(); 833 void OnSelectAll();
854 void OnSelectRange(const gfx::Point& start, const gfx::Point& end); 834 void OnSelectRange(const gfx::Point& start, const gfx::Point& end);
855 void OnSetAccessibilityFocus(int acc_obj_id);
856 void OnSetActive(bool active); 835 void OnSetActive(bool active);
857 void OnSetAltErrorPageURL(const GURL& gurl); 836 void OnSetAltErrorPageURL(const GURL& gurl);
858 void OnSetBackground(const SkBitmap& background); 837 void OnSetBackground(const SkBitmap& background);
859 void OnSetWebUIProperty(const std::string& name, const std::string& value); 838 void OnSetWebUIProperty(const std::string& name, const std::string& value);
860 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands); 839 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands);
861 void OnSetHistoryLengthAndPrune(int history_length, int32 minimum_page_id); 840 void OnSetHistoryLengthAndPrune(int history_length, int32 minimum_page_id);
862 void OnSetInitialFocus(bool reverse); 841 void OnSetInitialFocus(bool reverse);
863 #if defined(OS_MACOSX) 842 #if defined(OS_MACOSX)
864 void OnSetInLiveResize(bool in_live_resize); 843 void OnSetInLiveResize(bool in_live_resize);
865 #endif 844 #endif
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1122
1144 PepperPluginDelegateImpl pepper_delegate_; 1123 PepperPluginDelegateImpl pepper_delegate_;
1145 1124
1146 // All the currently active plugin delegates for this RenderView; kept so that 1125 // All the currently active plugin delegates for this RenderView; kept so that
1147 // we can enumerate them to send updates about things like window location 1126 // we can enumerate them to send updates about things like window location
1148 // or tab focus and visibily. These are non-owning references. 1127 // or tab focus and visibily. These are non-owning references.
1149 std::set<WebPluginDelegateProxy*> plugin_delegates_; 1128 std::set<WebPluginDelegateProxy*> plugin_delegates_;
1150 1129
1151 // Helper objects ------------------------------------------------------------ 1130 // Helper objects ------------------------------------------------------------
1152 1131
1153 ScopedRunnableMethodFactory<RenderView> accessibility_method_factory_;
1154
1155 RendererWebCookieJarImpl cookie_jar_; 1132 RendererWebCookieJarImpl cookie_jar_;
1156 1133
1157 // The next group of objects all implement RenderViewObserver, so are deleted 1134 // The next group of objects all implement RenderViewObserver, so are deleted
1158 // along with the RenderView automatically. This is why we just store weak 1135 // along with the RenderView automatically. This is why we just store weak
1159 // references. 1136 // references.
1160 1137
1161 // Holds a reference to the service which provides desktop notifications. 1138 // Holds a reference to the service which provides desktop notifications.
1162 NotificationProvider* notification_provider_; 1139 NotificationProvider* notification_provider_;
1163 1140
1164 // The geolocation dispatcher attached to this view, lazily initialized. 1141 // The geolocation dispatcher attached to this view, lazily initialized.
1165 GeolocationDispatcher* geolocation_dispatcher_; 1142 GeolocationDispatcher* geolocation_dispatcher_;
1166 1143
1167 // The intents dispatcher attached to this view. Not lazily initialized. 1144 // The intents dispatcher attached to this view. Not lazily initialized.
1168 IntentsDispatcher* intents_dispatcher_; 1145 IntentsDispatcher* intents_dispatcher_;
1169 1146
1170 // The speech dispatcher attached to this view, lazily initialized. 1147 // The speech dispatcher attached to this view, lazily initialized.
1171 SpeechInputDispatcher* speech_input_dispatcher_; 1148 SpeechInputDispatcher* speech_input_dispatcher_;
1172 1149
1173 // Device orientation dispatcher attached to this view; lazily initialized. 1150 // Device orientation dispatcher attached to this view; lazily initialized.
1174 DeviceOrientationDispatcher* device_orientation_dispatcher_; 1151 DeviceOrientationDispatcher* device_orientation_dispatcher_;
1175 1152
1176 // MediaStreamImpl attached to this view; lazily initialized. 1153 // MediaStreamImpl attached to this view; lazily initialized.
1177 scoped_refptr<MediaStreamImpl> media_stream_impl_; 1154 scoped_refptr<MediaStreamImpl> media_stream_impl_;
1178 1155
1179 // Handles accessibility requests into the renderer side, as well as
1180 // maintains the cache and other features of the accessibility tree.
1181 scoped_ptr<WebKit::WebAccessibilityCache> accessibility_;
1182
1183 // Collect renderer accessibility notifications until they are ready to be
1184 // sent to the browser.
1185 std::vector<RendererAccessibilityNotification>
1186 pending_accessibility_notifications_;
1187
1188 // Set if we are waiting for a accessibility notification ack.
1189 bool accessibility_ack_pending_;
1190
1191 // True if verbose logging of accessibility events is on.
1192 bool accessibility_logging_;
1193
1194 // Dispatches all P2P socket used by the renderer. 1156 // Dispatches all P2P socket used by the renderer.
1195 content::P2PSocketDispatcher* p2p_socket_dispatcher_; 1157 content::P2PSocketDispatcher* p2p_socket_dispatcher_;
1196 1158
1197 DevToolsAgent* devtools_agent_; 1159 DevToolsAgent* devtools_agent_;
1198 1160
1161 RendererAccessibility* renderer_accessibility_;
1162
1199 // Misc ---------------------------------------------------------------------- 1163 // Misc ----------------------------------------------------------------------
1200 1164
1201 // The current and pending file chooser completion objects. If the queue is 1165 // The current and pending file chooser completion objects. If the queue is
1202 // nonempty, the first item represents the currently running file chooser 1166 // nonempty, the first item represents the currently running file chooser
1203 // callback, and the remaining elements are the other file chooser completion 1167 // callback, and the remaining elements are the other file chooser completion
1204 // still waiting to be run (in order). 1168 // still waiting to be run (in order).
1205 struct PendingFileChooser; 1169 struct PendingFileChooser;
1206 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_; 1170 std::deque< linked_ptr<PendingFileChooser> > file_chooser_completions_;
1207 1171
1208 // The current directory enumeration callback 1172 // The current directory enumeration callback
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 // bunch of stuff, you should probably create a helper class and put your 1224 // bunch of stuff, you should probably create a helper class and put your
1261 // data and methods on that to avoid bloating RenderView more. You can use 1225 // data and methods on that to avoid bloating RenderView more. You can use
1262 // the Observer interface to filter IPC messages and receive frame change 1226 // the Observer interface to filter IPC messages and receive frame change
1263 // notifications. 1227 // notifications.
1264 // --------------------------------------------------------------------------- 1228 // ---------------------------------------------------------------------------
1265 1229
1266 DISALLOW_COPY_AND_ASSIGN(RenderView); 1230 DISALLOW_COPY_AND_ASSIGN(RenderView);
1267 }; 1231 };
1268 1232
1269 #endif // CONTENT_RENDERER_RENDER_VIEW_H_ 1233 #endif // CONTENT_RENDERER_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698