Commit 580ed67a authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Remove Infobar feature flag check for badges logic

Now that Badges logic will be used when in Incognito, it should not be
tied to the Infobar feature flag, which won't be rolled out to 100%
soon.

Bug: 976901
Change-Id: I94ece69646370de01672ba10c2ef15aad60e2fcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783226
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693800}
parent 072627d6
...@@ -150,10 +150,8 @@ void AttachTabHelpers(web::WebState* web_state, bool for_prerender) { ...@@ -150,10 +150,8 @@ void AttachTabHelpers(web::WebState* web_state, bool for_prerender) {
SnapshotTabHelper::CreateForWebState(web_state, tab_id); SnapshotTabHelper::CreateForWebState(web_state, tab_id);
PagePlaceholderTabHelper::CreateForWebState(web_state); PagePlaceholderTabHelper::CreateForWebState(web_state);
PrintTabHelper::CreateForWebState(web_state); PrintTabHelper::CreateForWebState(web_state);
if (IsInfobarUIRebootEnabled()) {
InfobarBadgeTabHelper::CreateForWebState(web_state); InfobarBadgeTabHelper::CreateForWebState(web_state);
} }
}
// Allow the embedder to attach tab helpers. // Allow the embedder to attach tab helpers.
ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state); ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state);
......
...@@ -174,19 +174,16 @@ const int kLocationAuthorizationStatusCount = 5; ...@@ -174,19 +174,16 @@ const int kLocationAuthorizationStatusCount = 5;
[self.omniboxPopupCoordinator start]; [self.omniboxPopupCoordinator start];
// Create BadgeMediator and set the viewController as its consumer. // Create BadgeMediator and set the viewController as its consumer.
if (IsInfobarUIRebootEnabled()) {
BadgeButtonActionHandler* actionHandler = BadgeButtonActionHandler* actionHandler =
[[BadgeButtonActionHandler alloc] init]; [[BadgeButtonActionHandler alloc] init];
actionHandler.dispatcher = actionHandler.dispatcher = static_cast<id<InfobarCommands>>(self.dispatcher);
static_cast<id<InfobarCommands>>(self.dispatcher);
BadgeButtonFactory* buttonFactory = BadgeButtonFactory* buttonFactory =
[[BadgeButtonFactory alloc] initWithActionHandler:actionHandler]; [[BadgeButtonFactory alloc] initWithActionHandler:actionHandler];
self.badgeViewController = self.badgeViewController =
[[BadgeViewController alloc] initWithButtonFactory:buttonFactory]; [[BadgeViewController alloc] initWithButtonFactory:buttonFactory];
[self.viewController addChildViewController:self.badgeViewController]; [self.viewController addChildViewController:self.badgeViewController];
[self.viewController setBadgeView:self.badgeViewController.view]; [self.viewController setBadgeView:self.badgeViewController.view];
[self.badgeViewController [self.badgeViewController didMoveToParentViewController:self.viewController];
didMoveToParentViewController:self.viewController];
self.badgeMediator = self.badgeMediator =
[[BadgeMediator alloc] initWithConsumer:self.badgeViewController [[BadgeMediator alloc] initWithConsumer:self.badgeViewController
webStateList:self.webStateList]; webStateList:self.webStateList];
...@@ -195,7 +192,6 @@ const int kLocationAuthorizationStatusCount = 5; ...@@ -195,7 +192,6 @@ const int kLocationAuthorizationStatusCount = 5;
FullscreenControllerFactory::GetInstance() FullscreenControllerFactory::GetInstance()
->GetForBrowserState(self.browserState) ->GetForBrowserState(self.browserState)
->AddObserver(_fullscreenBadgeObserver.get()); ->AddObserver(_fullscreenBadgeObserver.get());
}
self.mediator = [[LocationBarMediator alloc] self.mediator = [[LocationBarMediator alloc]
initWithLocationBarModel:[self locationBarModel]]; initWithLocationBarModel:[self locationBarModel]];
...@@ -232,11 +228,9 @@ const int kLocationAuthorizationStatusCount = 5; ...@@ -232,11 +228,9 @@ const int kLocationAuthorizationStatusCount = 5;
FullscreenControllerFactory::GetInstance() FullscreenControllerFactory::GetInstance()
->GetForBrowserState(self.browserState) ->GetForBrowserState(self.browserState)
->RemoveObserver(_fullscreenObserver.get()); ->RemoveObserver(_fullscreenObserver.get());
if (IsInfobarUIRebootEnabled()) {
FullscreenControllerFactory::GetInstance() FullscreenControllerFactory::GetInstance()
->GetForBrowserState(self.browserState) ->GetForBrowserState(self.browserState)
->RemoveObserver(_fullscreenBadgeObserver.get()); ->RemoveObserver(_fullscreenBadgeObserver.get());
}
self.started = NO; self.started = NO;
} }
......
...@@ -166,10 +166,8 @@ const double kHideBadgeViewThreshold = 0.1; ...@@ -166,10 +166,8 @@ const double kHideBadgeViewThreshold = 0.1;
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
if (IsInfobarUIRebootEnabled()) {
DCHECK(self.badgeView) << "The badge view must be set at this point"; DCHECK(self.badgeView) << "The badge view must be set at this point";
self.locationBarSteadyView.badgeView = self.badgeView; self.locationBarSteadyView.badgeView = self.badgeView;
}
[_locationBarSteadyView.locationButton [_locationBarSteadyView.locationButton
addTarget:self addTarget:self
...@@ -206,11 +204,9 @@ const double kHideBadgeViewThreshold = 0.1; ...@@ -206,11 +204,9 @@ const double kHideBadgeViewThreshold = 0.1;
CGFloat alphaValue = fmax((progress - 0.85) / 0.15, 0); CGFloat alphaValue = fmax((progress - 0.85) / 0.15, 0);
CGFloat scaleValue = 0.79 + 0.21 * progress; CGFloat scaleValue = 0.79 + 0.21 * progress;
self.locationBarSteadyView.trailingButton.alpha = alphaValue; self.locationBarSteadyView.trailingButton.alpha = alphaValue;
if (IsInfobarUIRebootEnabled()) {
BOOL badgeViewShouldCollapse = progress <= kHideBadgeViewThreshold; BOOL badgeViewShouldCollapse = progress <= kHideBadgeViewThreshold;
[self.locationBarSteadyView [self.locationBarSteadyView
setFullScreenCollapsedMode:badgeViewShouldCollapse]; setFullScreenCollapsedMode:badgeViewShouldCollapse];
}
self.locationBarSteadyView.transform = self.locationBarSteadyView.transform =
CGAffineTransformMakeScale(scaleValue, scaleValue); CGAffineTransformMakeScale(scaleValue, scaleValue);
} }
...@@ -293,15 +289,11 @@ const double kHideBadgeViewThreshold = 0.1; ...@@ -293,15 +289,11 @@ const double kHideBadgeViewThreshold = 0.1;
} }
- (void)hideSteadyViewBadgeView { - (void)hideSteadyViewBadgeView {
if (IsInfobarUIRebootEnabled()) {
[self.locationBarSteadyView displayBadgeView:NO animated:NO]; [self.locationBarSteadyView displayBadgeView:NO animated:NO];
}
} }
- (void)showSteadyViewBadgeView { - (void)showSteadyViewBadgeView {
if (IsInfobarUIRebootEnabled()) {
[self.locationBarSteadyView displayBadgeView:YES animated:NO]; [self.locationBarSteadyView displayBadgeView:YES animated:NO];
}
} }
- (void)setEditViewFaded:(BOOL)hidden { - (void)setEditViewFaded:(BOOL)hidden {
......
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