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

Side by Side Diff: ios/chrome/browser/ui/contextual_search/js_contextual_search_manager.h

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_JS_CONTEXTUAL_SEARCH_MANAGER_H_
6 #define IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_JS_CONTEXTUAL_SEARCH_MANAGER_H_
7
8 #import <UIKit/UIKit.h>
9
10 #import "ios/web/public/web_state/js/crw_js_injection_manager.h"
11
12 #include "base/ios/block_types.h"
13
14 // JsContextualSearchManager manages the scripts related to contextual search.
15 @interface JsContextualSearchManager : CRWJSInjectionManager
16
17 // Asynchronously fetches the search context for |point| in the web view.
18 // |handler| is called back with the JSON-encoded search context, or an
19 // empty dictionary if no search context was found at |point|
20 - (void)fetchContextFromSelectionAtPoint:(CGPoint)point
21 completionHandler:(void (^)(NSString*))handler;
22
23 // Sets the JavaScript events listeners on selection change and DOM mutation.
24 // |mutationDelay| is the timeout of the DOM mutation events.
25 // |bodyTouchDelay| is the timeout of the body touch events.
26 - (void)enableEventListenersWithMutationDelay:(CGFloat)mutationDelay
27 bodyTouchDelay:(CGFloat)bodyTouchDelay;
28
29 // Disables the JavaScript events listeners on selection change and DOM
30 // mutation.
31 - (void)disableListeners;
32
33 // Expands the highlight zone to the specified range.
34 - (void)expandHighlightToStartOffset:(int)startOffset
35 endOffset:(int)endOffset
36 completionHandler:(web::JavaScriptResultBlock)completion;
37
38 // Retrieve the position of the highlight in the web view.
39 - (void)highlightRectsWithCompletionHandler:
40 (web::JavaScriptResultBlock)completion;
41
42 // Clears the highlight info.
43 - (void)clearHighlight;
44
45 @end
46
47 #endif // IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_JS_CONTEXTUAL_SEARCH_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698