Commit e76b94d0 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Remove -[CRWWebController visibleFrame] method.

The implementation of this method is folded into BVC.

Bug: 620489
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ia28f15d5b2ba55c4d661e2b0a200c143e2a4f296
Reviewed-on: https://chromium-review.googlesource.com/1073916
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563002}
parent 36c94951
......@@ -791,6 +791,8 @@ NSString* const kBrowserViewControllerSnackbarCategory =
- (BOOL)isTabScrolledToTop:(Tab*)tab;
// Returns the footer view if one exists (e.g. the voice search bar).
- (UIView*)footerView;
// Returns web contents frame without including primary toolbar.
- (CGRect)visibleFrameForTab:(Tab*)tab;
// Returns the header height needed for |tab|.
- (CGFloat)headerHeightForTab:(Tab*)tab;
// Sets the frame for the headers.
......@@ -2578,6 +2580,12 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
}
}
- (CGRect)visibleFrameForTab:(Tab*)tab {
UIEdgeInsets headerInset = UIEdgeInsetsMake(
[self nativeContentHeaderHeightForWebState:tab.webState], 0, 0, 0);
return UIEdgeInsetsInsetRect(tab.view.bounds, headerInset);
}
- (CGFloat)headerHeightForTab:(Tab*)tab {
id nativeController = [self nativeControllerForTab:tab];
if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] &&
......@@ -2935,13 +2943,10 @@ bubblePresenterForFeature:(const base::Feature&)feature
selectText:(BOOL)selectText
shouldFocus:(BOOL)shouldFocus {
DCHECK(_findBarController);
Tab* tab = [_model currentTab];
DCHECK(tab);
CRWWebController* webController = tab.webController;
CGRect referenceFrame = CGRectZero;
if ([self canShowTabStrip]) {
referenceFrame = webController.visibleFrame;
DCHECK(_model.currentTab);
referenceFrame = [self visibleFrameForTab:_model.currentTab];
referenceFrame.origin.y -= kIPadFindBarOverlap;
} else {
referenceFrame = self.contentArea.frame;
......@@ -3487,10 +3492,10 @@ bubblePresenterForFeature:(const base::Feature&)feature
return CGRectGetMaxY(self.view.frame);
} else if (IsIPadIdiom()) {
// The infobars on iPad are display at the top of a tab.
return CGRectGetMinY([[_model currentTab].webController visibleFrame]);
return CGRectGetMinY([self visibleFrameForTab:_model.currentTab]);
} else {
// The infobars on iPhone are displayed at the bottom of a tab.
CGRect visibleFrame = [[_model currentTab].webController visibleFrame];
CGRect visibleFrame = [self visibleFrameForTab:_model.currentTab];
return CGRectGetMaxY(visibleFrame) -
CGRectGetHeight(_infoBarContainer->view().frame);
}
......@@ -3498,7 +3503,7 @@ bubblePresenterForFeature:(const base::Feature&)feature
// Returns a vertical download manager offset relative to the tab content.
- (CGFloat)downloadManagerOverlayYOffsetForTab:(Tab*)tab {
return CGRectGetMaxY([tab.webController visibleFrame]) -
return CGRectGetMaxY([self visibleFrameForTab:tab]) -
CGRectGetHeight(_downloadManagerCoordinator.viewController.view.frame);
}
......@@ -3521,7 +3526,7 @@ bubblePresenterForFeature:(const base::Feature&)feature
return CGRectGetMaxY(self.view.frame);
} else {
// The voice search bar on iPhone is displayed at the bottom of a tab.
CGRect visibleFrame = [[_model currentTab].webController visibleFrame];
CGRect visibleFrame = [self visibleFrameForTab:_model.currentTab];
return CGRectGetMaxY(visibleFrame) - kVoiceSearchBarHeight;
}
}
......
......@@ -204,10 +204,6 @@ class WebStateImpl;
// Removes |toolbar| from the web view.
- (void)removeToolbarViewFromWebView:(UIView*)toolbarView;
// Returns the always-visible frame, not including the part that could be
// covered by the toolbar.
- (CGRect)visibleFrame;
- (CRWJSInjectionReceiver*)jsInjectionReceiver;
// Returns the native controller (if any) current mananging the content.
......
......@@ -747,8 +747,6 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
- (BOOL)isMainFrameNavigationAction:(WKNavigationAction*)action;
// Returns whether external URL navigation action should be opened.
- (BOOL)shouldOpenExternalURLForNavigationAction:(WKNavigationAction*)action;
// Returns the header height.
- (CGFloat)headerHeight;
// Updates SSL status for the current navigation item based on the information
// provided by web view.
- (void)updateSSLStatusForCurrentNavigationItem;
......@@ -2218,7 +2216,7 @@ registerLoadRequestForURL:(const GURL&)requestURL
- (CGFloat)nativeContentHeaderHeightForContainerView:
(CRWWebControllerContainerView*)containerView {
return [self headerHeight];
return [_nativeProvider nativeContentHeaderHeightForWebState:self.webState];
}
#pragma mark -
......@@ -3614,14 +3612,6 @@ registerLoadRequestForURL:(const GURL&)requestURL
#pragma mark -
#pragma mark Fullscreen
- (CGRect)visibleFrame {
CGRect frame = [_containerView bounds];
CGFloat headerHeight = [self headerHeight];
frame.origin.y = headerHeight;
frame.size.height -= headerHeight;
return frame;
}
- (void)optOutScrollsToTopForSubviews {
NSMutableArray* stack =
[NSMutableArray arrayWithArray:[self.webScrollView subviews]];
......@@ -3688,10 +3678,6 @@ registerLoadRequestForURL:(const GURL&)requestURL
[_delegate webController:self shouldOpenExternalURL:requestURL];
}
- (CGFloat)headerHeight {
return [_nativeProvider nativeContentHeaderHeightForWebState:self.webState];
}
- (void)updateSSLStatusForCurrentNavigationItem {
if (_isBeingDestroyed) {
return;
......
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