| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 : public RenderFrameHost, | 112 : public RenderFrameHost, |
| 113 NON_EXPORTED_BASE(public mojom::FrameHost), | 113 NON_EXPORTED_BASE(public mojom::FrameHost), |
| 114 public BrowserAccessibilityDelegate, | 114 public BrowserAccessibilityDelegate, |
| 115 public SiteInstanceImpl::Observer, | 115 public SiteInstanceImpl::Observer, |
| 116 public NON_EXPORTED_BASE( | 116 public NON_EXPORTED_BASE( |
| 117 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>) { | 117 service_manager::InterfaceFactory<media::mojom::InterfaceFactory>) { |
| 118 public: | 118 public: |
| 119 using AXTreeSnapshotCallback = | 119 using AXTreeSnapshotCallback = |
| 120 base::Callback<void( | 120 base::Callback<void( |
| 121 const ui::AXTreeUpdate&)>; | 121 const ui::AXTreeUpdate&)>; |
| 122 using SmartClipCallback = base::Callback<void(const base::string16& text, |
| 123 const base::string16& html)>; |
| 122 | 124 |
| 123 // An accessibility reset is only allowed to prevent very rare corner cases | 125 // An accessibility reset is only allowed to prevent very rare corner cases |
| 124 // or race conditions where the browser and renderer get out of sync. If | 126 // or race conditions where the browser and renderer get out of sync. If |
| 125 // this happens more than this many times, kill the renderer. | 127 // this happens more than this many times, kill the renderer. |
| 126 static const int kMaxAccessibilityResets = 5; | 128 static const int kMaxAccessibilityResets = 5; |
| 127 | 129 |
| 128 static RenderFrameHostImpl* FromID(int process_id, int routing_id); | 130 static RenderFrameHostImpl* FromID(int process_id, int routing_id); |
| 129 static RenderFrameHostImpl* FromAXTreeID( | 131 static RenderFrameHostImpl* FromAXTreeID( |
| 130 AXTreeIDRegistry::AXTreeID ax_tree_id); | 132 AXTreeIDRegistry::AXTreeID ax_tree_id); |
| 131 | 133 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // closed by the user. | 469 // closed by the user. |
| 468 void JavaScriptDialogClosed(IPC::Message* reply_msg, | 470 void JavaScriptDialogClosed(IPC::Message* reply_msg, |
| 469 bool success, | 471 bool success, |
| 470 const base::string16& user_input, | 472 const base::string16& user_input, |
| 471 bool dialog_was_suppressed); | 473 bool dialog_was_suppressed); |
| 472 | 474 |
| 473 // Get the accessibility mode from the delegate and Send a message to the | 475 // Get the accessibility mode from the delegate and Send a message to the |
| 474 // renderer process to change the accessibility mode. | 476 // renderer process to change the accessibility mode. |
| 475 void UpdateAccessibilityMode(); | 477 void UpdateAccessibilityMode(); |
| 476 | 478 |
| 479 void RequestSmartClipExtract(SmartClipCallback callback, gfx::Rect rect); |
| 480 void OnSmartClipDataExtracted(int id, |
| 481 base::string16 text, |
| 482 base::string16 html); |
| 483 |
| 477 // Request a one-time snapshot of the accessibility tree without changing | 484 // Request a one-time snapshot of the accessibility tree without changing |
| 478 // the accessibility mode. | 485 // the accessibility mode. |
| 479 void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback); | 486 void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback); |
| 480 | 487 |
| 481 // Resets the accessibility serializer in the renderer. | 488 // Resets the accessibility serializer in the renderer. |
| 482 void AccessibilityReset(); | 489 void AccessibilityReset(); |
| 483 | 490 |
| 484 // Turn on accessibility testing. The given callback will be run | 491 // Turn on accessibility testing. The given callback will be run |
| 485 // every time an accessibility notification is received from the | 492 // every time an accessibility notification is received from the |
| 486 // renderer process, and the accessibility tree it sent can be | 493 // renderer process, and the accessibility tree it sent can be |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 // The last AXContentTreeData for this frame received from the RenderFrame. | 1058 // The last AXContentTreeData for this frame received from the RenderFrame. |
| 1052 AXContentTreeData ax_content_tree_data_; | 1059 AXContentTreeData ax_content_tree_data_; |
| 1053 | 1060 |
| 1054 // The AX tree ID of the embedder, if this is a browser plugin guest. | 1061 // The AX tree ID of the embedder, if this is a browser plugin guest. |
| 1055 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; | 1062 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; |
| 1056 | 1063 |
| 1057 // The mapping from callback id to corresponding callback for pending | 1064 // The mapping from callback id to corresponding callback for pending |
| 1058 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. | 1065 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. |
| 1059 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; | 1066 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; |
| 1060 | 1067 |
| 1068 std::map<int, SmartClipCallback> smart_clip_callbacks_; |
| 1069 |
| 1061 // Callback when an event is received, for testing. | 1070 // Callback when an event is received, for testing. |
| 1062 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> | 1071 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> |
| 1063 accessibility_testing_callback_; | 1072 accessibility_testing_callback_; |
| 1064 // The most recently received accessibility tree - for testing only. | 1073 // The most recently received accessibility tree - for testing only. |
| 1065 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; | 1074 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; |
| 1066 // Flag to not create a BrowserAccessibilityManager, for testing. If one | 1075 // Flag to not create a BrowserAccessibilityManager, for testing. If one |
| 1067 // already exists it will still be used. | 1076 // already exists it will still be used. |
| 1068 bool no_create_browser_accessibility_manager_for_testing_; | 1077 bool no_create_browser_accessibility_manager_for_testing_; |
| 1069 | 1078 |
| 1070 // PlzNavigate: Owns the stream used in navigations to store the body of the | 1079 // PlzNavigate: Owns the stream used in navigations to store the body of the |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 | 1154 |
| 1146 // NOTE: This must be the last member. | 1155 // NOTE: This must be the last member. |
| 1147 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1156 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1148 | 1157 |
| 1149 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1158 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1150 }; | 1159 }; |
| 1151 | 1160 |
| 1152 } // namespace content | 1161 } // namespace content |
| 1153 | 1162 |
| 1154 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1163 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |