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

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: Null checks Created 3 years, 11 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..c60f8992e8c551cf79bc562f97bc49819b593855
--- /dev/null
+++ b/ios/chrome/browser/find_in_page/find_tab_helper.h
@@ -0,0 +1,42 @@
+// 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"
+#import "ios/web/public/web_state/web_state_observer.h"
Eugene But (OOO till 7-30) 2017/01/31 19:03:48 nit: s/import/include
rohitrao (ping after 24h) 2017/02/08 16:14:59 Done.
+#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,
Eugene But (OOO till 7-30) 2017/01/31 19:03:48 Should this be FindInPageTabHelper to keep consist
rohitrao (ping after 24h) 2017/02/08 16:14:59 I kept it consistent with desktop.
+ public web::WebStateUserData<FindTabHelper> {
+ public:
+ static void CreateForWebState(
Eugene But (OOO till 7-30) 2017/01/31 19:03:48 Could you please add comments. F.e. is it ok to pa
rohitrao (ping after 24h) 2017/02/08 16:14:59 It is now =)
+ web::WebState* web_state,
+ id<FindInPageControllerDelegate> controller_delegate);
+
+ FindTabHelper(web::WebState* web_state,
Eugene But (OOO till 7-30) 2017/01/31 19:03:48 Should constructor, destructor and NavigationItemC
rohitrao (ping after 24h) 2017/02/08 16:14:59 Done.
+ id<FindInPageControllerDelegate> controller_delegate);
+ ~FindTabHelper() override;
+
+ FindInPageController* GetController();
+
+ // web::WebStateObserver.
+ void NavigationItemCommitted(
+ const web::LoadCommittedDetails& load_details) override;
+
+ private:
+ // The WebState that this object is attached to.
+ web::WebState* web_state_;
+
+ FindInPageController* controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(FindTabHelper);
+};
+
+#endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698