Commit 7bfb1473 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Remove PrimaryToolbarCoordinator protocol

Change-Id: Ie3fb20c37902459599a8a02202a6d4ff91907963
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1942692
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Auto-Submit: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720032}
parent ed4248fc
......@@ -274,6 +274,7 @@ source_set("perf_tests") {
"//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/location_bar:location_bar_model_delegate",
"//ios/chrome/browser/ui/toolbar",
"//ios/chrome/browser/ui/toolbar:toolbar_ui",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/web_state_list",
"//ios/chrome/browser/web_state_list:test_support",
......
......@@ -17,6 +17,7 @@
#import "ios/chrome/browser/ui/commands/command_dispatcher.h"
#include "ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.h"
#import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h"
#import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.h"
#import "ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.h"
#import "ios/chrome/browser/ui/toolbar/toolbar_coordinator_delegate.h"
#import "ios/chrome/browser/ui/util/named_guide.h"
......
......@@ -6,19 +6,43 @@
#define IOS_CHROME_BROWSER_UI_TOOLBAR_PRIMARY_TOOLBAR_COORDINATOR_H_
#import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.h"
#import "ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h"
#import "ios/chrome/browser/ui/toolbar/public/fakebox_focuser.h"
@protocol ActivityServicePositioner;
@class CommandDispatcher;
@protocol OmniboxPopupPresenterDelegate;
@protocol ToolbarCoordinatorDelegate;
// Coordinator for the primary part, the one containing the omnibox, of the
// adaptive toolbar.
@interface PrimaryToolbarCoordinator
: AdaptiveToolbarCoordinator<PrimaryToolbarCoordinator>
: AdaptiveToolbarCoordinator <FakeboxFocuser>
// Delegate for this coordinator.
// TODO(crbug.com/799446): Change this.
@property(nonatomic, weak) id<ToolbarCoordinatorDelegate> delegate;
// Defines where the omnibox popup will be positioned.
@property(nonatomic, weak) id<OmniboxPopupPresenterDelegate>
popupPresenterDelegate;
// Command dispatcher.
@property(nonatomic, strong) CommandDispatcher* commandDispatcher;
// Positioner for activity services attached to the toolbar
- (id<ActivityServicePositioner>)activityServicePositioner;
// Shows the animation when transitioning to a prerendered page.
- (void)showPrerenderingAnimation;
// Whether the omnibox is currently the first responder.
- (BOOL)isOmniboxFirstResponder;
// Whether the omnibox popup is currently presented.
- (BOOL)showingOmniboxPopup;
// Coordinates the location bar focusing/defocusing. For example, initiates
// transition to the expanded location bar state of the view controller.
- (void)transitionToLocationBarFocusedState:(BOOL)focused;
@end
#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PRIMARY_TOOLBAR_COORDINATOR_H_
......@@ -105,16 +105,12 @@
self.started = NO;
}
#pragma mark - PrimaryToolbarCoordinator
#pragma mark - Public
- (id<ActivityServicePositioner>)activityServicePositioner {
return self.viewController;
}
- (id<OmniboxFocuser>)omniboxFocuser {
return self.locationBarCoordinator;
}
- (void)showPrerenderingAnimation {
[self.viewController showPrerenderingAnimation];
}
......
......@@ -7,7 +7,6 @@ source_set("public") {
sources = [
"fakebox_focuser.h",
"omnibox_focuser.h",
"primary_toolbar_coordinator.h",
"side_swipe_toolbar_interacting.h",
"side_swipe_toolbar_snapshot_providing.h",
"toolbar_coordinating.h",
......
// Copyright 2018 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.
#ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_PRIMARY_TOOLBAR_COORDINATOR_H_
#define IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_PRIMARY_TOOLBAR_COORDINATOR_H_
#import "ios/chrome/browser/ui/toolbar/public/fakebox_focuser.h"
#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h"
#import "ios/chrome/browser/ui/toolbar/public/side_swipe_toolbar_snapshot_providing.h"
@protocol ActivityServicePositioner;
@class CommandDispatcher;
@protocol OmniboxPopupPresenterDelegate;
// Protocol defining a primary toolbar, in a paradigm where the toolbar can be
// split between primary and secondary.
@protocol PrimaryToolbarCoordinator<FakeboxFocuser,
SideSwipeToolbarSnapshotProviding>
// Defines where the omnibox popup will be positioned.
@property(nonatomic, weak) id<OmniboxPopupPresenterDelegate>
popupPresenterDelegate;
// Command dispatcher.
@property(nonatomic, strong) CommandDispatcher* commandDispatcher;
@property(nonatomic, strong, readonly) UIViewController* viewController;
// Returns the different protocols and superclass now implemented by the
// internal ViewController.
- (id<ActivityServicePositioner>)activityServicePositioner;
- (id<OmniboxFocuser>)omniboxFocuser;
// Stops the coordinator.
- (void)stop;
// Shows the animation when transitioning to a prerendered page.
- (void)showPrerenderingAnimation;
// Whether the omnibox is currently the first responder.
- (BOOL)isOmniboxFirstResponder;
// Whether the omnibox popup is currently presented.
- (BOOL)showingOmniboxPopup;
// Coordinates the location bar focusing/defocusing. For example, initiates
// transition to the expanded location bar state of the view controller.
- (void)transitionToLocationBarFocusedState:(BOOL)focused;
@end
#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_PRIMARY_TOOLBAR_COORDINATOR_H_
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