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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2667283007: Refactor Samsung SmartClip implementation. (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
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
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
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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 // The last AXContentTreeData for this frame received from the RenderFrame. 1056 // The last AXContentTreeData for this frame received from the RenderFrame.
1050 AXContentTreeData ax_content_tree_data_; 1057 AXContentTreeData ax_content_tree_data_;
1051 1058
1052 // The AX tree ID of the embedder, if this is a browser plugin guest. 1059 // The AX tree ID of the embedder, if this is a browser plugin guest.
1053 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_; 1060 AXTreeIDRegistry::AXTreeID browser_plugin_embedder_ax_tree_id_;
1054 1061
1055 // The mapping from callback id to corresponding callback for pending 1062 // The mapping from callback id to corresponding callback for pending
1056 // accessibility tree snapshot calls created by RequestAXTreeSnapshot. 1063 // accessibility tree snapshot calls created by RequestAXTreeSnapshot.
1057 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_; 1064 std::map<int, AXTreeSnapshotCallback> ax_tree_snapshot_callbacks_;
1058 1065
1066 std::map<int, SmartClipCallback> smart_clip_callbacks_;
1067
1059 // Callback when an event is received, for testing. 1068 // Callback when an event is received, for testing.
1060 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)> 1069 base::Callback<void(RenderFrameHostImpl*, ui::AXEvent, int)>
1061 accessibility_testing_callback_; 1070 accessibility_testing_callback_;
1062 // The most recently received accessibility tree - for testing only. 1071 // The most recently received accessibility tree - for testing only.
1063 std::unique_ptr<ui::AXTree> ax_tree_for_testing_; 1072 std::unique_ptr<ui::AXTree> ax_tree_for_testing_;
1064 // Flag to not create a BrowserAccessibilityManager, for testing. If one 1073 // Flag to not create a BrowserAccessibilityManager, for testing. If one
1065 // already exists it will still be used. 1074 // already exists it will still be used.
1066 bool no_create_browser_accessibility_manager_for_testing_; 1075 bool no_create_browser_accessibility_manager_for_testing_;
1067 1076
1068 // PlzNavigate: Owns the stream used in navigations to store the body of the 1077 // 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
1143 1152
1144 // NOTE: This must be the last member. 1153 // NOTE: This must be the last member.
1145 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1154 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1146 1155
1147 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1156 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1148 }; 1157 };
1149 1158
1150 } // namespace content 1159 } // namespace content
1151 1160
1152 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1161 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698