| Index: ios/clean/chrome/browser/ui/omnibox/location_bar_coordinator.mm
|
| diff --git a/ios/clean/chrome/browser/ui/omnibox/location_bar_coordinator.mm b/ios/clean/chrome/browser/ui/omnibox/location_bar_coordinator.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7cf4c32a0485be5111e0d68eaafe64234f11f5c0
|
| --- /dev/null
|
| +++ b/ios/clean/chrome/browser/ui/omnibox/location_bar_coordinator.mm
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#import "ios/clean/chrome/browser/ui/omnibox/location_bar_coordinator.h"
|
| +
|
| +#include "base/memory/ptr_util.h"
|
| +#import "ios/chrome/browser/ui/omnibox/location_bar_controller_impl.h"
|
| +#include "ios/chrome/browser/ui/toolbar/toolbar_model_ios.h"
|
| +#import "ios/clean/chrome/browser/ui/omnibox/location_bar_mediator.h"
|
| +#import "ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.h"
|
| +#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
|
| +#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h"
|
| +
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| +@interface LocationBarCoordinator ()
|
| +
|
| +@property(nonatomic, strong) LocationBarMediator* mediator;
|
| +@property(nonatomic, readwrite, strong)
|
| + LocationBarViewController* viewController;
|
| +
|
| +@end
|
| +
|
| +@implementation LocationBarCoordinator {
|
| +}
|
| +
|
| +@synthesize mediator = _mediator;
|
| +@synthesize viewController = _viewController;
|
| +
|
| +- (void)start {
|
| + DCHECK(self.parentCoordinator);
|
| + self.viewController = [[LocationBarViewController alloc] init];
|
| +
|
| + Browser* browser = self.browser;
|
| +
|
| + _mediator = [[LocationBarMediator alloc]
|
| + initWithWebStateList:&(browser->web_state_list())];
|
| + std::unique_ptr<LocationBarController> locationBar =
|
| + base::MakeUnique<LocationBarControllerImpl>(
|
| + self.viewController.omnibox, browser->browser_state(),
|
| + nil /* PreloadProvider */, nil /* OmniboxPopupPositioner */,
|
| + _mediator);
|
| + [_mediator setLocationBar:std::move(locationBar)];
|
| + [super start];
|
| +}
|
| +
|
| +- (void)stop {
|
| + [super stop];
|
| + self.viewController = nil;
|
| +}
|
| +
|
| +@end
|
|
|