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

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

Issue 2654433007: [ios] Moves find-in-page code out of Tab and into FindTabHelper. (Closed)
Patch Set: Review. 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/find_in_page/find_tab_helper.h
diff --git a/ios/chrome/browser/find_in_page/find_tab_helper.h b/ios/chrome/browser/find_in_page/find_tab_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc1487421f83f788dcb9f81865f30f11de3e1a3c
--- /dev/null
+++ b/ios/chrome/browser/find_in_page/find_tab_helper.h
@@ -0,0 +1,44 @@
+// Copyright 2017 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_TAB_HELPER_H_
+#define IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_
+
+#include "base/macros.h"
+#include "ios/web/public/web_state/web_state_observer.h"
+#import "ios/web/public/web_state/web_state_user_data.h"
+
+@class FindInPageController;
+@protocol FindInPageControllerDelegate;
+
+// Adds support for the "Find in page" feature.
+class FindTabHelper : public web::WebStateObserver,
+ public web::WebStateUserData<FindTabHelper> {
+ public:
+ // Creates a FindTabHelper and attaches it to the given |web_state|.
+ // |controller_delegate| can be nil.
+ static void CreateForWebState(
+ web::WebState* web_state,
+ id<FindInPageControllerDelegate> controller_delegate);
+
+ // Returns the find in page controller.
+ FindInPageController* GetController();
+
+ private:
+ FindTabHelper(web::WebState* web_state,
+ id<FindInPageControllerDelegate> controller_delegate);
+ ~FindTabHelper() override;
+
+ // web::WebStateObserver.
+ void NavigationItemCommitted(
+ const web::LoadCommittedDetails& load_details) override;
+ void WebStateDestroyed() override;
+
+ // The ObjC find in page controller.
+ FindInPageController* controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(FindTabHelper);
+};
+
+#endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_
« no previous file with comments | « ios/chrome/browser/find_in_page/find_in_page_controller.mm ('k') | ios/chrome/browser/find_in_page/find_tab_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698