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

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

Issue 2685393004: [ios] Hoists the FindInPageModel up into the controller. (Closed)
Patch Set: 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_in_page_controller.mm
diff --git a/ios/chrome/browser/find_in_page/find_in_page_controller.mm b/ios/chrome/browser/find_in_page/find_in_page_controller.mm
index dbb5c17467635a46c641b3bf11f7015097c83810..ad1441dbb9671c96c711d007b43d8e6c86c28fe9 100644
--- a/ios/chrome/browser/find_in_page/find_in_page_controller.mm
+++ b/ios/chrome/browser/find_in_page/find_in_page_controller.mm
@@ -90,6 +90,7 @@ static NSString* gSearchTerm;
}
@synthesize delegate = _delegate;
+@synthesize findInPageModel = _findInPageModel;
+ (void)setSearchTerm:(NSString*)string {
gSearchTerm = [string copy];
@@ -103,9 +104,11 @@ static NSString* gSearchTerm;
delegate:(id<FindInPageControllerDelegate>)delegate {
self = [super init];
if (self) {
+ _findInPageModel = [[FindInPageModel alloc] init];
_findInPageJsManager = base::mac::ObjCCastStrict<JsFindinpageManager>(
[webState->GetJSInjectionReceiver()
instanceOfClass:[JsFindinpageManager class]]);
+ _findInPageJsManager.findInPageModel = _findInPageModel;
justincohen 2017/02/13 18:09:36 Does this need to be nilled out on dealloc of fipc
rohitrao (ping after 24h) 2017/02/14 14:52:49 I made it a strong reference, so the JS manager wi
_delegate = delegate;
_webStateObserverBridge.reset(
new web::WebStateObserverBridge(webState, self));
@@ -129,10 +132,6 @@ static NSString* gSearchTerm;
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-- (FindInPageModel*)findInPageModel {
- return [_findInPageJsManager findInPageModel];
-}
-
- (BOOL)canFindInPage {
return [_webViewProxy hasSearchableTextContent];
}

Powered by Google App Engine
This is Rietveld 408576698