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

Unified Diff: ios/chrome/browser/find_in_page/find_in_page_controller.h

Issue 1023813003: [iOS] Upstream ios/chrome/browser/find_in_page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upstreamAutofill
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/find_in_page/find_in_page_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/find_in_page/find_in_page_controller.h
diff --git a/ios/chrome/browser/find_in_page/find_in_page_controller.h b/ios/chrome/browser/find_in_page/find_in_page_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdd7a36ce0e38a90966d0d88c385060c9c054c87
--- /dev/null
+++ b/ios/chrome/browser/find_in_page/find_in_page_controller.h
@@ -0,0 +1,68 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_CONTROLLER_H_
+
+#import <Foundation/Foundation.h>
+
+#include "base/ios/block_types.h"
+
+namespace web {
+class WebState;
+}
+
+@class FindInPageModel;
+
+extern NSString* const kFindBarTextFieldWillBecomeFirstResponderNotification;
+extern NSString* const kFindBarTextFieldDidResignFirstResponderNotification;
+
+@protocol FindInPageControllerDelegate<NSObject>
+// Informs the delegate when the scroll position is about to be changed on the
+// page.
+- (void)willAdjustScrollPosition;
+@end
+
+@interface FindInPageController : NSObject
+
+// Designated initializer.
+- (id)initWithWebState:(web::WebState*)webState
+ delegate:(id<FindInPageControllerDelegate>)delegate;
+// Inject the find in page scripts into the web state.
+- (void)initFindInPage;
+// Find In Page model. TODO(justincohen) consider using find_tab_helper.cc.
+- (FindInPageModel*)findInPageModel;
+// Is Find In Page available right now (given the state of the WebState)?
+- (BOOL)canFindInPage;
+// Find |query| in page, update model with results of find. Calls
+// |completionHandler| after the find operation is complete. |completionHandler|
+// can be nil.
+- (void)findStringInPage:(NSString*)query
+ completionHandler:(ProceduralBlock)completionHandler;
+// Move to the next find result based on |-findInPageModel|, and scroll to
+// match. Calls |completionHandler| when the next string has been found.
+// |completionHandler| can be nil.
+- (void)findNextStringInPageWithCompletionHandler:
+ (ProceduralBlock)completionHandler;
+// Move to the previous find result based on |-findInPageModel|. Calls
+// |completionHandler| when the previous string has been found.
+// |completionHandler| can be nil.
+- (void)findPreviousStringInPageWithCompletionHandler:
+ (ProceduralBlock)completionHandler;
+// Disable find in page script and model. Calls |completionHandler| once the
+// model has been disabled and cleanup is complete. |completionHandler| can be
+// nil.
+- (void)disableFindInPageWithCompletionHandler:
+ (ProceduralBlock)completionHandler;
+
+// Save search term to Paste UIPasteboard.
+- (void)saveSearchTerm;
+// Restore search term from Paste UIPasteboard, updating findInPageModel.
+- (void)restoreSearchTerm;
+
+// Instructs the controller to detach itself from the web state.
+- (void)detachFromWebState;
+@end
+
+#endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_CONTROLLER_H_
« no previous file with comments | « no previous file | ios/chrome/browser/find_in_page/find_in_page_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698