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

Side by Side Diff: ios/chrome/browser/find_in_page/find_tab_helper.mm

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 unified diff | Download patch
OLDNEW
(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 #import "ios/chrome/browser/find_in_page/find_tab_helper.h"
6
7 #import "ios/chrome/browser/find_in_page/find_in_page_controller.h"
8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
13 DEFINE_WEB_STATE_USER_DATA_KEY(FindTabHelper);
14
15 // static
16 void FindTabHelper::CreateForWebState(
17 web::WebState* web_state,
18 id<FindInPageControllerDelegate> controller_delegate) {
19 DCHECK(web_state);
20 if (!FromWebState(web_state)) {
21 web_state->SetUserData(UserDataKey(),
22 new FindTabHelper(web_state, controller_delegate));
23 }
24 }
25
26 FindTabHelper::FindTabHelper(
27 web::WebState* web_state,
28 id<FindInPageControllerDelegate> controller_delegate) {
29 controller_ =
30 [[FindInPageController alloc] initWithWebState:web_state
31 delegate:controller_delegate];
32 }
33
34 FindTabHelper::~FindTabHelper() {}
35
36 FindInPageController* FindTabHelper::GetController() {
37 return controller_;
38 }
39
40 void FindTabHelper::NavigationItemCommitted(
41 const web::LoadCommittedDetails& load_details) {
42 [controller_ disableFindInPageWithCompletionHandler:nil];
43 }
44
45 void FindTabHelper::WebStateDestroyed() {
46 [controller_ detachFromWebState];
47 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/find_in_page/find_tab_helper.h ('k') | ios/chrome/browser/find_in_page/find_tab_helper_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698