Commit 6ca36dd2 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Migrate AppLauncher from BVC

Change-Id: Ib1f0a6716ff4682b3754b94e969b25a279bcc9ae
Reviewed-on: https://chromium-review.googlesource.com/c/1341248
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609783}
parent 952284b7
......@@ -279,7 +279,6 @@ source_set("ui_internal") {
"//ios/chrome/app:tests_hook",
"//ios/chrome/app/strings",
"//ios/chrome/browser",
"//ios/chrome/browser/app_launcher",
"//ios/chrome/browser/autofill:autofill_internal",
"//ios/chrome/browser/bookmarks",
"//ios/chrome/browser/browser_state",
......@@ -310,7 +309,6 @@ source_set("ui_internal") {
"//ios/chrome/browser/ui/activity_services:coordinator",
"//ios/chrome/browser/ui/activity_services/requirements",
"//ios/chrome/browser/ui/alert_coordinator",
"//ios/chrome/browser/ui/app_launcher",
"//ios/chrome/browser/ui/autofill:autofill",
"//ios/chrome/browser/ui/autofill/manual_fill",
"//ios/chrome/browser/ui/bookmarks",
......
......@@ -10,6 +10,7 @@
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper_delegate.h"
// A coordinator that handles UI related to launching apps.
// TODO(crbug.com/906541) : Convert to ChromeCoordinator subclass.
@interface AppLauncherCoordinator : NSObject<AppLauncherTabHelperDelegate>
// Initializes the coordinator with the |baseViewController|, from which to
......
......@@ -51,8 +51,6 @@
#include "components/signin/ios/browser/active_state_manager.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/app/tests_hook.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper.h"
#import "ios/chrome/browser/autofill/autofill_tab_helper.h"
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
......@@ -111,7 +109,6 @@
#import "ios/chrome/browser/ui/activity_services/activity_service_legacy_coordinator.h"
#import "ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h"
#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
#import "ios/chrome/browser/ui/app_launcher/app_launcher_coordinator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/password_coordinator.h"
#import "ios/chrome/browser/ui/background_generator.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.h"
......@@ -560,9 +557,6 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// Coordinator for the PassKit UI presentation.
PassKitCoordinator* _passKitCoordinator;
// Coordinator for UI related to launching external apps.
AppLauncherCoordinator* _appLauncherCoordinator;
// Fake status bar view used to blend the toolbar into the status bar.
UIView* _fakeStatusBarView;
......@@ -939,9 +933,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint
_downloadManagerCoordinator.presenter =
[[VerticalAnimationContainer alloc] init];
_appLauncherCoordinator =
[[AppLauncherCoordinator alloc] initWithBaseViewController:self];
_javaScriptDialogPresenter.reset(
new JavaScriptDialogPresenterImpl(_dialogPresenter));
_webStateDelegate.reset(new web::WebStateDelegateBridge(self));
......@@ -2854,9 +2845,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint
NetExportTabHelper::CreateForWebState(tab.webState, self);
CaptivePortalDetectorTabHelper::CreateForWebState(tab.webState, self);
PassKitTabHelper::CreateForWebState(tab.webState, _passKitCoordinator);
AppLauncherTabHelper::CreateForWebState(
tab.webState, [[AppLauncherAbuseDetector alloc] init],
_appLauncherCoordinator);
// DownloadManagerTabHelper cannot function without delegate.
DCHECK(_downloadManagerCoordinator);
......
......@@ -19,6 +19,7 @@ source_set("main") {
"//base",
"//ios/chrome/app/resources:launchscreen_xib",
"//ios/chrome/browser",
"//ios/chrome/browser/app_launcher",
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/browsing_data",
"//ios/chrome/browser/crash_report:crash_report_internal",
......@@ -28,6 +29,7 @@ source_set("main") {
"//ios/chrome/browser/tabs",
"//ios/chrome/browser/tabs:tabs_internal",
"//ios/chrome/browser/ui/alert_coordinator",
"//ios/chrome/browser/ui/app_launcher",
"//ios/chrome/browser/ui/authentication/consent_bump",
"//ios/chrome/browser/ui/autofill",
"//ios/chrome/browser/ui/commands",
......
......@@ -7,7 +7,10 @@
#include <memory>
#include "base/scoped_observer.h"
#import "ios/chrome/browser/app_launcher/app_launcher_abuse_detector.h"
#import "ios/chrome/browser/app_launcher/app_launcher_tab_helper.h"
#import "ios/chrome/browser/ui/alert_coordinator/repost_form_coordinator.h"
#import "ios/chrome/browser/ui/app_launcher/app_launcher_coordinator.h"
#import "ios/chrome/browser/ui/authentication/consent_bump/consent_bump_coordinator.h"
#import "ios/chrome/browser/ui/authentication/consent_bump/consent_bump_coordinator_delegate.h"
#import "ios/chrome/browser/ui/autofill/form_input_accessory_coordinator.h"
......@@ -41,6 +44,9 @@
// Child Coordinators, listed in alphabetical order.
// =================================================
// Coordinator for UI related to launching external apps.
@property(nonatomic, strong) AppLauncherCoordinator* appLauncherCoordinator;
// Coordinator to ask the user for the new consent.
@property(nonatomic, strong) ConsentBumpCoordinator* consentBumpCoordinator;
......@@ -75,6 +81,7 @@
@synthesize dispatcher = _dispatcher;
// Child coordinators
@synthesize appLauncherCoordinator = _appLauncherCoordinator;
@synthesize consentBumpCoordinator = _consentBumpCoordinator;
@synthesize formInputAccessoryCoordinator = _formInputAccessoryCoordinator;
@synthesize qrScannerCoordinator = _qrScannerCoordinator;
......@@ -138,6 +145,9 @@
// coordinators.
DCHECK(self.dispatcher);
self.appLauncherCoordinator = [[AppLauncherCoordinator alloc]
initWithBaseViewController:self.viewController];
/* ConsentBumpCoordinator is created and started by a BrowserCommand */
self.formInputAccessoryCoordinator = [[FormInputAccessoryCoordinator alloc]
......@@ -164,6 +174,10 @@
// Stops child coordinators.
- (void)stopChildCoordinators {
// TODO(crbug.com/906541) : AppLauncherCoordinator is not a subclass of
// ChromeCoordinator, and does not have a |-stop| method.
self.appLauncherCoordinator = nil;
[self.consentBumpCoordinator stop];
self.consentBumpCoordinator = nil;
......@@ -357,6 +371,10 @@
// Install delegates for |webState|.
- (void)installDelegatesForWebState:(web::WebState*)webState {
AppLauncherTabHelper::CreateForWebState(
webState, [[AppLauncherAbuseDetector alloc] init],
self.appLauncherCoordinator);
RepostFormTabHelper::CreateForWebState(webState, self);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment