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

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: Fix tests. 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/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 3bc61e190e232071a9cff83b1efe4d836c09242c..0c2ddc74c749fcbf3213ab6531d9f211c34a62d5 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_;
@@ -545,10 +543,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
initWithSnapshotManager:snapshotManager_
tab:self]);
- findInPageController_.reset([[FindInPageController alloc]
- initWithWebState:self.webState
- delegate:self]);
-
[self initNativeAppNavigationController];
if (attachTabHelpers) {
@@ -563,6 +557,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 =
@@ -1194,9 +1189,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [findInPageController_ detachFromWebState];
- findInPageController_.reset();
-
[passwordController_ detach];
passwordController_.reset();
tabInfoBarObserver_.reset();
@@ -1698,7 +1690,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];
@@ -2175,10 +2166,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
}
}
-- (FindInPageController*)findInPageController {
- return findInPageController_;
-}
-
- (NativeAppNavigationController*)nativeAppNavigationController {
return nativeAppNavigationController_;
}

Powered by Google App Engine
This is Rietveld 408576698