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 // Samsung Galaxy Note-specific "smart clip" stylus text getter. |
| 480 void RequestSmartClipExtract(SmartClipCallback callback, gfx::Rect rect); |
| 481 |
477 // Request a one-time snapshot of the accessibility tree without changing | 482 // Request a one-time snapshot of the accessibility tree without changing |
478 // the accessibility mode. | 483 // the accessibility mode. |
479 void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback); | 484 void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback); |
480 | 485 |
481 // Resets the accessibility serializer in the renderer. | 486 // Resets the accessibility serializer in the renderer. |
482 void AccessibilityReset(); | 487 void AccessibilityReset(); |
483 | 488 |
484 // Turn on accessibility testing. The given callback will be run | 489 // Turn on accessibility testing. The given callback will be run |
485 // every time an accessibility notification is received from the | 490 // every time an accessibility notification is received from the |
486 // renderer process, and the accessibility tree it sent can be | 491 // renderer process, and the accessibility tree it sent can be |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 int ack_token); | 732 int ack_token); |
728 void OnAccessibilityLocationChanges( | 733 void OnAccessibilityLocationChanges( |
729 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); | 734 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); |
730 void OnAccessibilityFindInPageResult( | 735 void OnAccessibilityFindInPageResult( |
731 const AccessibilityHostMsg_FindInPageResultParams& params); | 736 const AccessibilityHostMsg_FindInPageResultParams& params); |
732 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point, | 737 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point, |
733 int hit_obj_id); | 738 int hit_obj_id); |
734 void OnAccessibilitySnapshotResponse( | 739 void OnAccessibilitySnapshotResponse( |
735 int callback_id, | 740 int callback_id, |
736 const AXContentTreeUpdate& snapshot); | 741 const AXContentTreeUpdate& snapshot); |
| 742 void OnSmartClipDataExtracted(uint32_t id, |
| 743 base::string16 text, |
| 744 base::string16 html); |
737 void OnToggleFullscreen(bool enter_fullscreen); | 745 void OnToggleFullscreen(bool enter_fullscreen); |
738 void OnDidStartLoading(bool to_different_document); | 746 void OnDidStartLoading(bool to_different_document); |
739 void OnDidStopLoading(); | 747 void OnDidStopLoading(); |
740 void OnDidChangeLoadProgress(double load_progress); | 748 void OnDidChangeLoadProgress(double load_progress); |
741 void OnSerializeAsMHTMLResponse( | 749 void OnSerializeAsMHTMLResponse( |
742 int job_id, | 750 int job_id, |
743 MhtmlSaveStatus save_status, | 751 MhtmlSaveStatus save_status, |
744 const std::set<std::string>& digests_of_uris_of_serialized_resources, | 752 const std::set<std::string>& digests_of_uris_of_serialized_resources, |
745 base::TimeDelta renderer_main_thread_time); | 753 base::TimeDelta renderer_main_thread_time); |
746 void OnSelectionChanged(const base::string16& text, | 754 void OnSelectionChanged(const base::string16& text, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 // The last AXContentTreeData for this frame received from the RenderFrame. | 1059 // The last AXContentTreeData for this frame received from the RenderFrame. |
1052 AXContentTreeData ax_content_tree_data_; | 1060 AXContentTreeData ax_content_tree_data_; |
1053 | 1061 |
1054 // The AX tree ID of the embedder, if this is a browser plugin guest. | 1062 // The AX tree ID of the embedder, if this is a browser plugin guest. |
1055 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; | 1063 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; |
1056 | 1064 |
1057 // The mapping from callback id to corresponding callback for pending | 1065 // The mapping from callback id to corresponding callback for pending |
1058 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. | 1066 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. |
1059 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; | 1067 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; |
1060 | 1068 |
| 1069 // Samsung Galaxy Note-specific "smart clip" stylus text getter. |
| 1070 std::map<uint32_t, SmartClipCallback> smart_clip_callbacks_; |
| 1071 |
1061 // Callback when an event is received, for testing. | 1072 // Callback when an event is received, for testing. |
1062 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> | 1073 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> |
1063 accessibility_testing_callback_; | 1074 accessibility_testing_callback_; |
1064 // The most recently received accessibility tree - for testing only. | 1075 // The most recently received accessibility tree - for testing only. |
1065 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; | 1076 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; |
1066 // Flag to not create a BrowserAccessibilityManager, for testing. If one | 1077 // Flag to not create a BrowserAccessibilityManager, for testing. If one |
1067 // already exists it will still be used. | 1078 // already exists it will still be used. |
1068 bool no_create_browser_accessibility_manager_for_testing_; | 1079 bool no_create_browser_accessibility_manager_for_testing_; |
1069 | 1080 |
1070 // PlzNavigate: Owns the stream used in navigations to store the body of the | 1081 // 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 | 1156 |
1146 // NOTE: This must be the last member. | 1157 // NOTE: This must be the last member. |
1147 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1158 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
1148 | 1159 |
1149 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1160 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
1150 }; | 1161 }; |
1151 | 1162 |
1152 } // namespace content | 1163 } // namespace content |
1153 | 1164 |
1154 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1165 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |