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

Unified Diff: ios/chrome/browser/tabs/tab.mm

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/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 36ff77d9cea55717e0d69db7d33c17b0e45a309a..6ba09b3b8f2b3b816d255ab940c83ec2bfb70c56 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -63,6 +63,7 @@
#include "ios/chrome/browser/experimental_flags.h"
#include "ios/chrome/browser/favicon/favicon_service_factory.h"
#import "ios/chrome/browser/find_in_page/find_in_page_controller.h"
+#import "ios/chrome/browser/find_in_page/find_tab_helper.h"
#import "ios/chrome/browser/geolocation/omnibox_geolocation_controller.h"
#include "ios/chrome/browser/history/history_service_factory.h"
#include "ios/chrome/browser/history/top_sites_factory.h"
@@ -273,9 +274,6 @@ enum class RendererTerminationTabState {
// Handles autofill.
base::scoped_nsobject<AutofillController> autofillController_;
- // Handles find on page.
- base::scoped_nsobject<FindInPageController> findInPageController_;
-
// Handles GAL infobar on web pages.
base::scoped_nsobject<NativeAppNavigationController>
nativeAppNavigationController_;
@@ -537,10 +535,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
initWithSnapshotManager:snapshotManager_
tab:self]);
- findInPageController_.reset([[FindInPageController alloc]
- initWithWebState:self.webState
- delegate:self]);
-
[self initNativeAppNavigationController];
// IOSChromeSessionTabHelper comes first because it sets up the tab ID, and
// other helpers may rely on that.
@@ -553,6 +547,7 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
IOSSecurityStateTabHelper::CreateForWebState(self.webState);
RepostFormTabHelper::CreateForWebState(self.webState);
BlockedPopupTabHelper::CreateForWebState(self.webState);
+ FindTabHelper::CreateForWebState(self.webState, self);
if (reading_list::switches::IsReadingListEnabled()) {
ReadingListModel* model =
@@ -1181,9 +1176,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [findInPageController_ detachFromWebState];
- findInPageController_.reset();
-
[passwordController_ detach];
passwordController_.reset();
tabInfoBarObserver_.reset();
@@ -1686,7 +1678,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// TODO(crbug.com/381201): Move this call there once that bug is fixed so that
// |disableFullScreen| is called only from one place.
[fullScreenController_ disableFullScreen];
- [findInPageController_ disableFindInPageWithCompletionHandler:nil];
GURL lastCommittedURL = webState->GetLastCommittedURL();
[autoReloadBridge_ loadStartedForURL:lastCommittedURL];
@@ -2172,10 +2163,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
}
}
-- (FindInPageController*)findInPageController {
- return findInPageController_;
-}
-
- (NativeAppNavigationController*)nativeAppNavigationController {
return nativeAppNavigationController_;
}
@@ -2248,7 +2235,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// Start observing the new web controller's InfoBarManager and FaviconDriver.
[self setShouldObserveInfoBarManager:YES];
[self setShouldObserveFaviconChanges:YES];
- findInPageController_.reset();
}
- (void)replaceExternalAppLauncher:(id)externalAppLauncher {

Powered by Google App Engine
This is Rietveld 408576698