| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 return; | 1333 return; |
| 1334 } | 1334 } |
| 1335 accessibility_reset_token_ = 0; | 1335 accessibility_reset_token_ = 0; |
| 1336 | 1336 |
| 1337 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( | 1337 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( |
| 1338 render_view_host_->GetView()); | 1338 render_view_host_->GetView()); |
| 1339 | 1339 |
| 1340 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode(); | 1340 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode(); |
| 1341 if ((accessibility_mode != AccessibilityModeOff) && view && | 1341 if ((accessibility_mode != AccessibilityModeOff) && view && |
| 1342 RenderFrameHostImpl::IsRFHStateActive(rfh_state())) { | 1342 RenderFrameHostImpl::IsRFHStateActive(rfh_state())) { |
| 1343 if (accessibility_mode & AccessibilityModeFlagPlatform) { |
| 1344 GetOrCreateBrowserAccessibilityManager(); |
| 1345 if (browser_accessibility_manager_) |
| 1346 browser_accessibility_manager_->OnAccessibilityEvents(params); |
| 1347 } |
| 1348 |
| 1343 if (browser_accessibility_manager_) { | 1349 if (browser_accessibility_manager_) { |
| 1344 // Get the frame routing ids from out-of-process iframes and | 1350 // Get the frame routing ids from out-of-process iframes and |
| 1345 // browser plugin instance ids from guests and update the mappings in | 1351 // browser plugin instance ids from guests and update the mappings in |
| 1346 // FrameAccessibility. | 1352 // FrameAccessibility. |
| 1347 for (size_t i = 0; i < params.size(); ++i) { | 1353 for (size_t i = 0; i < params.size(); ++i) { |
| 1348 const AccessibilityHostMsg_EventParams& param = params[i]; | 1354 const AccessibilityHostMsg_EventParams& param = params[i]; |
| 1349 UpdateCrossProcessIframeAccessibility( | 1355 UpdateCrossProcessIframeAccessibility( |
| 1350 param.node_to_frame_routing_id_map); | 1356 param.node_to_frame_routing_id_map); |
| 1351 UpdateGuestFrameAccessibility( | 1357 UpdateGuestFrameAccessibility( |
| 1352 param.node_to_browser_plugin_instance_id_map); | 1358 param.node_to_browser_plugin_instance_id_map); |
| 1353 } | 1359 } |
| 1354 } | 1360 } |
| 1355 | 1361 |
| 1356 if (accessibility_mode & AccessibilityModeFlagPlatform) { | |
| 1357 GetOrCreateBrowserAccessibilityManager(); | |
| 1358 if (browser_accessibility_manager_) | |
| 1359 browser_accessibility_manager_->OnAccessibilityEvents(params); | |
| 1360 } | |
| 1361 | |
| 1362 // Send the updates to the automation extension API. | 1362 // Send the updates to the automation extension API. |
| 1363 std::vector<AXEventNotificationDetails> details; | 1363 std::vector<AXEventNotificationDetails> details; |
| 1364 details.reserve(params.size()); | 1364 details.reserve(params.size()); |
| 1365 for (size_t i = 0; i < params.size(); ++i) { | 1365 for (size_t i = 0; i < params.size(); ++i) { |
| 1366 const AccessibilityHostMsg_EventParams& param = params[i]; | 1366 const AccessibilityHostMsg_EventParams& param = params[i]; |
| 1367 AXEventNotificationDetails detail(param.update.node_id_to_clear, | 1367 AXEventNotificationDetails detail(param.update.node_id_to_clear, |
| 1368 param.update.nodes, | 1368 param.update.nodes, |
| 1369 param.event_type, | 1369 param.event_type, |
| 1370 param.id, | 1370 param.id, |
| 1371 GetProcess()->GetID(), | 1371 GetProcess()->GetID(), |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 // We may be returning to an existing NavigationEntry that had been granted | 2089 // We may be returning to an existing NavigationEntry that had been granted |
| 2090 // file access. If this is a different process, we will need to grant the | 2090 // file access. If this is a different process, we will need to grant the |
| 2091 // access again. The files listed in the page state are validated when they | 2091 // access again. The files listed in the page state are validated when they |
| 2092 // are received from the renderer to prevent abuse. | 2092 // are received from the renderer to prevent abuse. |
| 2093 if (request_params.page_state.IsValid()) { | 2093 if (request_params.page_state.IsValid()) { |
| 2094 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2094 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
| 2095 } | 2095 } |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 } // namespace content | 2098 } // namespace content |
| OLD | NEW |