| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_FIND_IN_PAGE_FIND_TAB_HELPER_H_ |
| 6 #define IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "ios/web/public/web_state/web_state_observer.h" |
| 10 #import "ios/web/public/web_state/web_state_user_data.h" |
| 11 |
| 12 @class FindInPageController; |
| 13 @protocol FindInPageControllerDelegate; |
| 14 |
| 15 // Adds support for the "Find in page" feature. |
| 16 class FindTabHelper : public web::WebStateObserver, |
| 17 public web::WebStateUserData<FindTabHelper> { |
| 18 public: |
| 19 // Creates a FindTabHelper and attaches it to the given |web_state|. |
| 20 // |controller_delegate| can be nil. |
| 21 static void CreateForWebState( |
| 22 web::WebState* web_state, |
| 23 id<FindInPageControllerDelegate> controller_delegate); |
| 24 |
| 25 // Returns the find in page controller. |
| 26 FindInPageController* GetController(); |
| 27 |
| 28 private: |
| 29 FindTabHelper(web::WebState* web_state, |
| 30 id<FindInPageControllerDelegate> controller_delegate); |
| 31 ~FindTabHelper() override; |
| 32 |
| 33 // web::WebStateObserver. |
| 34 void NavigationItemCommitted( |
| 35 const web::LoadCommittedDetails& load_details) override; |
| 36 void WebStateDestroyed() override; |
| 37 |
| 38 // The ObjC find in page controller. |
| 39 FindInPageController* controller_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(FindTabHelper); |
| 42 }; |
| 43 |
| 44 #endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_ |
| OLD | NEW |