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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 4057: Adds MSAA/IAccessible exposure of web content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 IPC_MESSAGE_HANDLER(ViewMsg_FormFill, OnFormFill) 303 IPC_MESSAGE_HANDLER(ViewMsg_FormFill, OnFormFill)
304 IPC_MESSAGE_HANDLER(ViewMsg_FillPasswordForm, OnFillPasswordForm) 304 IPC_MESSAGE_HANDLER(ViewMsg_FillPasswordForm, OnFillPasswordForm)
305 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragEnter, OnDragTargetDragEnter) 305 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragEnter, OnDragTargetDragEnter)
306 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragOver, OnDragTargetDragOver) 306 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragOver, OnDragTargetDragOver)
307 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragLeave, OnDragTargetDragLeave) 307 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragLeave, OnDragTargetDragLeave)
308 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDrop, OnDragTargetDrop) 308 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDrop, OnDragTargetDrop)
309 IPC_MESSAGE_HANDLER(ViewMsg_AllowDomAutomationBindings, 309 IPC_MESSAGE_HANDLER(ViewMsg_AllowDomAutomationBindings,
310 OnAllowDomAutomationBindings) 310 OnAllowDomAutomationBindings)
311 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) 311 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
312 IPC_MESSAGE_HANDLER(ViewMsg_SetDOMUIProperty, OnSetDOMUIProperty) 312 IPC_MESSAGE_HANDLER(ViewMsg_SetDOMUIProperty, OnSetDOMUIProperty)
313 IPC_MESSAGE_HANDLER(ViewMsg_DragSourceEndedOrMoved, OnDragSourceEndedOrMoved ) 313 IPC_MESSAGE_HANDLER(ViewMsg_DragSourceEndedOrMoved,
314 OnDragSourceEndedOrMoved)
314 IPC_MESSAGE_HANDLER(ViewMsg_DragSourceSystemDragEnded, 315 IPC_MESSAGE_HANDLER(ViewMsg_DragSourceSystemDragEnded,
315 OnDragSourceSystemDragEnded) 316 OnDragSourceSystemDragEnded)
316 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) 317 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
317 IPC_MESSAGE_HANDLER(ViewMsg_FindReplyACK, OnFindReplyAck) 318 IPC_MESSAGE_HANDLER(ViewMsg_FindReplyACK, OnFindReplyAck)
318 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) 319 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
319 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) 320 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
320 IPC_MESSAGE_HANDLER(ViewMsg_SetAltErrorPageURL, OnSetAltErrorPageURL) 321 IPC_MESSAGE_HANDLER(ViewMsg_SetAltErrorPageURL, OnSetAltErrorPageURL)
321 IPC_MESSAGE_HANDLER(ViewMsg_InstallMissingPlugin, OnInstallMissingPlugin) 322 IPC_MESSAGE_HANDLER(ViewMsg_InstallMissingPlugin, OnInstallMissingPlugin)
322 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) 323 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse)
323 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) 324 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode)
324 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBackForwardListCount, 325 IPC_MESSAGE_HANDLER(ViewMsg_UpdateBackForwardListCount,
325 OnUpdateBackForwardListCount) 326 OnUpdateBackForwardListCount)
326 IPC_MESSAGE_HANDLER(ViewMsg_GetAllSavableResourceLinksForCurrentPage, 327 IPC_MESSAGE_HANDLER(ViewMsg_GetAllSavableResourceLinksForCurrentPage,
327 OnGetAllSavableResourceLinksForCurrentPage) 328 OnGetAllSavableResourceLinksForCurrentPage)
328 IPC_MESSAGE_HANDLER(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLink s, 329 IPC_MESSAGE_HANDLER(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLink s,
329 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) 330 OnGetSerializedHtmlDataForCurrentPageWithLocalLinks)
330 IPC_MESSAGE_HANDLER(ViewMsg_GetApplicationInfo, OnGetApplicationInfo) 331 IPC_MESSAGE_HANDLER(ViewMsg_GetApplicationInfo, OnGetApplicationInfo)
332 IPC_MESSAGE_HANDLER(ViewMsg_GetAccessibilityInfo, OnGetAccessibilityInfo)
333 IPC_MESSAGE_HANDLER(ViewMsg_ClearAccessibilityInfo,
334 OnClearAccessibilityInfo)
331 IPC_MESSAGE_HANDLER(ViewMsg_ShouldClose, OnMsgShouldClose) 335 IPC_MESSAGE_HANDLER(ViewMsg_ShouldClose, OnMsgShouldClose)
332 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) 336 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
333 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) 337 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged)
334 #ifdef CHROME_PERSONALIZATION 338 #ifdef CHROME_PERSONALIZATION
335 IPC_MESSAGE_HANDLER(ViewMsg_PersonalizationEvent, OnPersonalizationEvent) 339 IPC_MESSAGE_HANDLER(ViewMsg_PersonalizationEvent, OnPersonalizationEvent)
336 #endif 340 #endif
337 IPC_MESSAGE_HANDLER(ViewMsg_HandleMessageFromExternalHost, 341 IPC_MESSAGE_HANDLER(ViewMsg_HandleMessageFromExternalHost,
338 OnMessageFromExternalHost) 342 OnMessageFromExternalHost)
339 // Have the super handle all other messages. 343 // Have the super handle all other messages.
340 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) 344 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 Send(new ViewHostMsg_FrameNavigate(routing_id_, params)); 1047 Send(new ViewHostMsg_FrameNavigate(routing_id_, params));
1044 } 1048 }
1045 1049
1046 last_page_id_sent_to_browser_ = 1050 last_page_id_sent_to_browser_ =
1047 std::max(last_page_id_sent_to_browser_, page_id_); 1051 std::max(last_page_id_sent_to_browser_, page_id_);
1048 1052
1049 // If we end up reusing this WebRequest (for example, due to a #ref click), 1053 // If we end up reusing this WebRequest (for example, due to a #ref click),
1050 // we don't want the transition type to persist. 1054 // we don't want the transition type to persist.
1051 if (extra_data) 1055 if (extra_data)
1052 extra_data->transition_type = PageTransition::LINK; // Just clear it. 1056 extra_data->transition_type = PageTransition::LINK; // Just clear it.
1057
1058 if (glue_accessibility_.get()) {
1059 // Clear accessibility info cache.
1060 glue_accessibility_->ClearIAccessibleMap(-1, true);
1061 }
1053 } 1062 }
1054 1063
1055 // Tell the embedding application that the title of the active page has changed 1064 // Tell the embedding application that the title of the active page has changed
1056 void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) { 1065 void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) {
1057 // Ignore all but top level navigations... 1066 // Ignore all but top level navigations...
1058 if (webview()->GetMainFrame() == frame) 1067 if (webview()->GetMainFrame() == frame)
1059 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, title)); 1068 Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, title));
1060 } 1069 }
1061 1070
1062 void RenderView::UpdateEncoding(WebFrame* frame, 1071 void RenderView::UpdateEncoding(WebFrame* frame,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 // again. 1147 // again.
1139 ResetPendingUpload(); 1148 ResetPendingUpload();
1140 } 1149 }
1141 1150
1142 void RenderView::DidStartProvisionalLoadForFrame( 1151 void RenderView::DidStartProvisionalLoadForFrame(
1143 WebView* webview, 1152 WebView* webview,
1144 WebFrame* frame, 1153 WebFrame* frame,
1145 NavigationGesture gesture) { 1154 NavigationGesture gesture) {
1146 if (webview->GetMainFrame() == frame) { 1155 if (webview->GetMainFrame() == frame) {
1147 navigation_gesture_ = gesture; 1156 navigation_gesture_ = gesture;
1148 1157
1149 // Make sure redirect tracking state is clear for the new load. 1158 // Make sure redirect tracking state is clear for the new load.
1150 completed_client_redirect_src_ = GURL(); 1159 completed_client_redirect_src_ = GURL();
1151 } 1160 }
1152 1161
1153 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( 1162 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame(
1154 routing_id_, webview->GetMainFrame() == frame, 1163 routing_id_, webview->GetMainFrame() == frame,
1155 frame->GetProvisionalDataSource()->GetRequest().GetURL())); 1164 frame->GetProvisionalDataSource()->GetRequest().GetURL()));
1156 } 1165 }
1157 1166
1158 bool RenderView::DidLoadResourceFromMemoryCache(WebView* webview, 1167 bool RenderView::DidLoadResourceFromMemoryCache(WebView* webview,
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 void RenderView::OnDebugDetach() { 2260 void RenderView::OnDebugDetach() {
2252 // Tell the plugin host to start accepting plugin messages again. 2261 // Tell the plugin host to start accepting plugin messages again.
2253 PluginChannelHost::SetListening(true); 2262 PluginChannelHost::SetListening(true);
2254 } 2263 }
2255 2264
2256 void RenderView::OnAllowDomAutomationBindings(bool allow_bindings) { 2265 void RenderView::OnAllowDomAutomationBindings(bool allow_bindings) {
2257 enable_dom_automation_ = allow_bindings; 2266 enable_dom_automation_ = allow_bindings;
2258 } 2267 }
2259 2268
2260 void RenderView::OnAllowBindings(bool enable_dom_ui_bindings, 2269 void RenderView::OnAllowBindings(bool enable_dom_ui_bindings,
2261 bool enable_external_host_bindings) 2270 bool enable_external_host_bindings) {
2262 {
2263 enable_dom_ui_bindings_ = enable_dom_ui_bindings; 2271 enable_dom_ui_bindings_ = enable_dom_ui_bindings;
2264 enable_external_host_bindings_ = enable_external_host_bindings; 2272 enable_external_host_bindings_ = enable_external_host_bindings;
2265 } 2273 }
2266 2274
2267 void RenderView::OnSetDOMUIProperty(const std::string& name, 2275 void RenderView::OnSetDOMUIProperty(const std::string& name,
2268 const std::string& value) { 2276 const std::string& value) {
2269 DCHECK(enable_dom_ui_bindings_); 2277 DCHECK(enable_dom_ui_bindings_);
2270 dom_ui_bindings_.SetProperty(name, value); 2278 dom_ui_bindings_.SetProperty(name, value);
2271 } 2279 }
2272 2280
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 2405
2398 main_frame->SetInViewSourceMode(true); 2406 main_frame->SetInViewSourceMode(true);
2399 } 2407 }
2400 2408
2401 void RenderView::OnUpdateBackForwardListCount(int back_list_count, 2409 void RenderView::OnUpdateBackForwardListCount(int back_list_count,
2402 int forward_list_count) { 2410 int forward_list_count) {
2403 history_back_list_count_ = back_list_count; 2411 history_back_list_count_ = back_list_count;
2404 history_forward_list_count_ = forward_list_count; 2412 history_forward_list_count_ = forward_list_count;
2405 } 2413 }
2406 2414
2415 void RenderView::OnGetAccessibilityInfo(
2416 const ViewMsg_Accessibility_In_Params& in_params,
2417 ViewHostMsg_Accessibility_Out_Params* out_params) {
2418
2419 if (!glue_accessibility_.get())
2420 glue_accessibility_.reset(new GlueAccessibility());
2421
2422 if (!glue_accessibility_->
2423 GetAccessibilityInfo(webview(), in_params, out_params)) {
2424 return;
2425 }
2426 }
2427
2428 void RenderView::OnClearAccessibilityInfo(int iaccessible_id, bool clear_all) {
2429 if (!glue_accessibility_.get()) {
2430 // If accessibility is not activated, ignore clearing message.
2431 return;
2432 }
2433
2434 if (!glue_accessibility_->ClearIAccessibleMap(iaccessible_id, clear_all))
2435 return;
2436 }
2437
2407 void RenderView::OnGetAllSavableResourceLinksForCurrentPage( 2438 void RenderView::OnGetAllSavableResourceLinksForCurrentPage(
2408 const GURL& page_url) { 2439 const GURL& page_url) {
2409 // Prepare list to storage all savable resource links. 2440 // Prepare list to storage all savable resource links.
2410 std::vector<GURL> resources_list; 2441 std::vector<GURL> resources_list;
2411 std::vector<GURL> referrers_list; 2442 std::vector<GURL> referrers_list;
2412 std::vector<GURL> frames_list; 2443 std::vector<GURL> frames_list;
2413 webkit_glue::SavableResourcesResult result(&resources_list, 2444 webkit_glue::SavableResourcesResult result(&resources_list,
2414 &referrers_list, 2445 &referrers_list,
2415 &frames_list); 2446 &frames_list);
2416 2447
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 2558
2528 if (template_html.empty()) { 2559 if (template_html.empty()) {
2529 NOTREACHED() << "unable to load template. ID: " << template_resource_id; 2560 NOTREACHED() << "unable to load template. ID: " << template_resource_id;
2530 return ""; 2561 return "";
2531 } 2562 }
2532 // "t" is the id of the templates root node. 2563 // "t" is the id of the templates root node.
2533 return jstemplate_builder::GetTemplateHtml( 2564 return jstemplate_builder::GetTemplateHtml(
2534 template_html, &error_strings, "t"); 2565 template_html, &error_strings, "t");
2535 } 2566 }
2536 2567
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698