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

Side by Side Diff: ios/chrome/browser/find_in_page/js_findinpage_manager.h

Issue 2685393004: [ios] Hoists the FindInPageModel up into the controller. (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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_ 5 #ifndef IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_
6 #define IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_ 6 #define IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_
7 7
8 #include <CoreGraphics/CGBase.h> 8 #include <CoreGraphics/CGBase.h>
9 #include <CoreGraphics/CGGeometry.h> 9 #include <CoreGraphics/CGGeometry.h>
10 10
11 #include "base/ios/block_types.h" 11 #include "base/ios/block_types.h"
12 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" 12 #import "ios/web/public/web_state/js/crw_js_injection_manager.h"
13 13
14 // Data from find in page. 14 // Data from find in page.
15 typedef struct FindInPageEntry { 15 typedef struct FindInPageEntry {
16 CGPoint point; // Scroll offset required to center the highlighted item. 16 CGPoint point; // Scroll offset required to center the highlighted item.
17 NSInteger index; // Currently higlighted search term. 17 NSInteger index; // Currently higlighted search term.
18 } FindInPageEntry; 18 } FindInPageEntry;
19 19
20 // Constant for "not found". 20 // Constant for "not found".
21 extern FindInPageEntry FindInPageEntryZero; 21 extern FindInPageEntry FindInPageEntryZero;
22 22
23 @class CRWJSInjectionReceiver; 23 @class CRWJSInjectionReceiver;
24 @class FindInPageModel; 24 @class FindInPageModel;
25 25
26 // Manager for the injection of the Find In Page JavaScript. 26 // Manager for the injection of the Find In Page JavaScript.
27 @interface JsFindinpageManager : CRWJSInjectionManager 27 @interface JsFindinpageManager : CRWJSInjectionManager
28 28
29 // Find In Page model. TODO(justincohen) consider using find_tab_helper.cc. 29 // Find In Page model.
30 @property(strong, nonatomic, readonly) FindInPageModel* findInPageModel; 30 @property(nonatomic, readwrite, strong) FindInPageModel* findInPageModel;
rohitrao (ping after 24h) 2017/02/10 21:07:08 This isn't created by the manager anymore, but I t
31 31
32 // Sets the width and height of the window. 32 // Sets the width and height of the window.
33 - (void)setWidth:(CGFloat)width height:(CGFloat)height; 33 - (void)setWidth:(CGFloat)width height:(CGFloat)height;
34 34
35 // Runs injected JavaScript to find |query| string. Calls |completionHandler| 35 // Runs injected JavaScript to find |query| string. Calls |completionHandler|
36 // with YES if the find operation completed, it is called with NO otherwise. 36 // with YES if the find operation completed, it is called with NO otherwise.
37 // If the find operation was successfiul the first match to scroll to is 37 // If the find operation was successfiul the first match to scroll to is
38 // also called with. If the |completionHandler| is called with NO, another 38 // also called with. If the |completionHandler| is called with NO, another
39 // call to |pumpWithCompletionHandler:| is required. |completionHandler| cannot 39 // call to |pumpWithCompletionHandler:| is required. |completionHandler| cannot
40 // be nil. 40 // be nil.
(...skipping 15 matching lines...) Expand all
56 // with the new scroll position passed in. The |completionHandler| can be nil. 56 // with the new scroll position passed in. The |completionHandler| can be nil.
57 - (void)previousMatchWithCompletionHandler:(void (^)(CGPoint))completionHandler; 57 - (void)previousMatchWithCompletionHandler:(void (^)(CGPoint))completionHandler;
58 58
59 // Stops find in page and calls |completionHandler| once find in page is 59 // Stops find in page and calls |completionHandler| once find in page is
60 // stopped. |completionHandler| cannot be nil. 60 // stopped. |completionHandler| cannot be nil.
61 - (void)disableWithCompletionHandler:(ProceduralBlock)completionHandler; 61 - (void)disableWithCompletionHandler:(ProceduralBlock)completionHandler;
62 62
63 @end 63 @end
64 64
65 #endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_ 65 #endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_JS_FINDINPAGE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698