Commit 059ce7c0 authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[ios] Remove unused and unneeded BVC methods.

This CL removes -resetAllWebviews, which no longer has any call sites.

This CL also removes -ensureViewCreated, which is just our implementation
of [UIViewController loadViewIfNeeded], which has been available since
iOS9. 

Bug: 
Change-Id: Ia2adab95a7a5726114a7e81ce784aaa4e40aa676
Reviewed-on: https://chromium-review.googlesource.com/570019
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487434}
parent e66a78a3
......@@ -1883,7 +1883,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
- (id<ToolbarOwner>)tabSwitcherTransitionToolbarOwner {
// Request the view to ensure that the view has been loaded and initialized,
// since it may never have been loaded (or have been swapped out).
[self.currentBVC ensureViewCreated];
[self.currentBVC loadViewIfNeeded];
return self.currentBVC;
}
......
......@@ -107,10 +107,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint
// Called when a UI element to create a new tab is triggered.
- (void)newTab:(id)sender;
// Makes sure that the view hierarchy has been built. Equivalent to calling
// -view, but without the annoying compiler warning.
- (void)ensureViewCreated;
// Called when the browser state provided to this instance is being destroyed.
// At this point the browser will no longer ever be active, and will likely be
// deallocated soon.
......@@ -128,11 +124,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint
atIndex:(NSUInteger)position
transition:(ui::PageTransition)transition;
// This will dismiss the web views on all the tabs and reload the frontmost one
// if there is one. This is used when a userdefault changes and the web views
// need to be re-created to pick it up.
- (void)resetAllWebViews;
// Informs the BVC that a new foreground tab is about to be opened. This is
// intended to be called before setWebUsageSuspended:NO in cases where a new tab
// is about to appear in order to allow the BVC to avoid doing unnecessary work
......
......@@ -1047,7 +1047,7 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
// tab if the caller is about to create one) ends up on screen completely.
Tab* currentTab = [_model currentTab];
// Force loading the view in case it was not loaded yet.
[self ensureViewCreated];
[self loadViewIfNeeded];
if (_expectingForegroundTab)
[currentTab.webController setOverlayPreviewMode:YES];
if (currentTab)
......@@ -1730,10 +1730,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
}
}
- (void)ensureViewCreated {
ignore_result([self view]);
}
- (void)browserStateDestroyed {
[self setActive:NO];
// Reset the toolbar opacity in case it was changed for contextual search.
......@@ -1934,12 +1930,8 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
- (void)displayTab:(Tab*)tab isNewSelection:(BOOL)newSelection {
DCHECK(tab);
// Ensure that self.view is loaded to avoid errors that can otherwise occur
// when accessing |_contentArea| below.
if (!_contentArea)
[self ensureViewCreated];
[self loadViewIfNeeded];
DCHECK(_contentArea);
if (!self.inNewTabAnimation) {
// Hide findbar. |updateToolbar| will restore the findbar later.
[self hideFindBarWithAnimation:NO];
......@@ -4335,11 +4327,6 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
appendTo:kCurrentTab];
}
- (void)resetAllWebViews {
[_dialogPresenter cancelAllDialogs];
[_model resetAllWebViews];
}
#pragma mark - Find Bar
- (void)hideFindBarWithAnimation:(BOOL)animate {
......
......@@ -35,7 +35,7 @@
transitionContextContent.initialTabID = bvc.tabModel.currentTab.tabId;
if (![bvc isViewLoaded]) {
[bvc ensureViewCreated];
[bvc loadViewIfNeeded];
[bvc.view setFrame:[[UIScreen mainScreen] bounds]];
}
......
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