| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 // Resets the accessibility serializer in the renderer. | 460 // Resets the accessibility serializer in the renderer. |
| 461 void AccessibilityReset(); | 461 void AccessibilityReset(); |
| 462 | 462 |
| 463 // Turn on accessibility testing. The given callback will be run | 463 // Turn on accessibility testing. The given callback will be run |
| 464 // every time an accessibility notification is received from the | 464 // every time an accessibility notification is received from the |
| 465 // renderer process, and the accessibility tree it sent can be | 465 // renderer process, and the accessibility tree it sent can be |
| 466 // retrieved using GetAXTreeForTesting(). | 466 // retrieved using GetAXTreeForTesting(). |
| 467 void SetAccessibilityCallbackForTesting( | 467 void SetAccessibilityCallbackForTesting( |
| 468 const base::Callback<void(ui::AXEvent, int)>& callback); | 468 const base::Callback<void(ui::AXEvent, int)>& callback); |
| 469 | 469 |
| 470 // Called when the metadata about the accessibility tree for this frame |
| 471 // changes due to a browser-side change, as opposed to due to an IPC from |
| 472 // a renderer. |
| 473 void UpdateAXTreeData(); |
| 474 |
| 470 // Send a message to the render process to change text track style settings. | 475 // Send a message to the render process to change text track style settings. |
| 471 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); | 476 void SetTextTrackSettings(const FrameMsg_TextTrackSettings_Params& params); |
| 472 | 477 |
| 473 // Returns a snapshot of the accessibility tree received from the | 478 // Returns a snapshot of the accessibility tree received from the |
| 474 // renderer as of the last time an accessibility notification was | 479 // renderer as of the last time an accessibility notification was |
| 475 // received. | 480 // received. |
| 476 const ui::AXTree* GetAXTreeForTesting(); | 481 const ui::AXTree* GetAXTreeForTesting(); |
| 477 | 482 |
| 478 // Access the BrowserAccessibilityManager if it already exists. | 483 // Access the BrowserAccessibilityManager if it already exists. |
| 479 BrowserAccessibilityManager* browser_accessibility_manager() const { | 484 BrowserAccessibilityManager* browser_accessibility_manager() const { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 // main frame. | 705 // main frame. |
| 701 AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(int routing_id); | 706 AXTreeIDRegistry::AXTreeID BrowserPluginInstanceIDToAXTreeID(int routing_id); |
| 702 | 707 |
| 703 // Convert the content-layer-specific AXContentNodeData to a general-purpose | 708 // Convert the content-layer-specific AXContentNodeData to a general-purpose |
| 704 // AXNodeData structure. | 709 // AXNodeData structure. |
| 705 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, | 710 void AXContentNodeDataToAXNodeData(const AXContentNodeData& src, |
| 706 ui::AXNodeData* dst); | 711 ui::AXNodeData* dst); |
| 707 | 712 |
| 708 // Convert the content-layer-specific AXContentTreeData to a general-purpose | 713 // Convert the content-layer-specific AXContentTreeData to a general-purpose |
| 709 // AXTreeData structure. | 714 // AXTreeData structure. |
| 710 void AXContentTreeDataToAXTreeData(const AXContentTreeData& src, | 715 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); |
| 711 ui::AXTreeData* dst); | |
| 712 | 716 |
| 713 // Returns the RenderWidgetHostView used for accessibility. For subframes, | 717 // Returns the RenderWidgetHostView used for accessibility. For subframes, |
| 714 // this function will return the platform view on the main frame; for main | 718 // this function will return the platform view on the main frame; for main |
| 715 // frames, it will return the current frame's view. | 719 // frames, it will return the current frame's view. |
| 716 RenderWidgetHostViewBase* GetViewForAccessibility(); | 720 RenderWidgetHostViewBase* GetViewForAccessibility(); |
| 717 | 721 |
| 718 // Sends a navigate message to the RenderFrame and notifies DevTools about | 722 // Sends a navigate message to the RenderFrame and notifies DevTools about |
| 719 // navigation happening. Should be used instead of sending the message | 723 // navigation happening. Should be used instead of sending the message |
| 720 // directly. | 724 // directly. |
| 721 void SendNavigateMessage( | 725 void SendNavigateMessage( |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 878 |
| 875 // This is nonzero if we sent an accessibility reset to the renderer and | 879 // This is nonzero if we sent an accessibility reset to the renderer and |
| 876 // we're waiting for an IPC containing this reset token (sequentially | 880 // we're waiting for an IPC containing this reset token (sequentially |
| 877 // assigned) and a complete replacement accessibility tree. | 881 // assigned) and a complete replacement accessibility tree. |
| 878 int accessibility_reset_token_; | 882 int accessibility_reset_token_; |
| 879 | 883 |
| 880 // A count of the number of times we needed to reset accessibility, so | 884 // A count of the number of times we needed to reset accessibility, so |
| 881 // we don't keep trying to reset forever. | 885 // we don't keep trying to reset forever. |
| 882 int accessibility_reset_count_; | 886 int accessibility_reset_count_; |
| 883 | 887 |
| 888 // The last AXContentTreeData for this frame received from the RenderFrame. |
| 889 AXContentTreeData ax_content_tree_data_; |
| 890 |
| 884 // The mapping from callback id to corresponding callback for pending | 891 // The mapping from callback id to corresponding callback for pending |
| 885 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. | 892 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. |
| 886 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; | 893 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; |
| 887 | 894 |
| 888 // Callback when an event is received, for testing. | 895 // Callback when an event is received, for testing. |
| 889 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; | 896 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; |
| 890 // The most recently received accessibility tree - for testing only. | 897 // The most recently received accessibility tree - for testing only. |
| 891 scoped_ptr<ui::AXTree> ax_tree_for_testing_; | 898 scoped_ptr<ui::AXTree> ax_tree_for_testing_; |
| 892 // Flag to not create a BrowserAccessibilityManager, for testing. If one | 899 // Flag to not create a BrowserAccessibilityManager, for testing. If one |
| 893 // already exists it will still be used. | 900 // already exists it will still be used. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 938 |
| 932 // NOTE: This must be the last member. | 939 // NOTE: This must be the last member. |
| 933 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 940 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 934 | 941 |
| 935 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 942 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 936 }; | 943 }; |
| 937 | 944 |
| 938 } // namespace content | 945 } // namespace content |
| 939 | 946 |
| 940 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 947 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |