Commit 68bfa35d authored by Eugene But's avatar Eugene But Committed by Commit Bot

Removed webDidUpdateSessionForLoadWithURL: callback.

This was deprecated method from CRWWebDelegate which is not used
anymore.

Bug: 674991
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ie06ae35173b03681a49625272aa0ec8c2a38265f
Reviewed-on: https://chromium-review.googlesource.com/820934Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523801}
parent 3c61a497
...@@ -444,10 +444,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, ...@@ -444,10 +444,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
overscrollActionsControllerDelegate_ = overscrollActionsControllerDelegate; overscrollActionsControllerDelegate_ = overscrollActionsControllerDelegate;
} }
- (void)webDidUpdateSessionForLoadWithURL:(const GURL&)URL {
// TODO(crbug.com/674991): Remove this method.
}
// Halt the tab, which amounts to halting its webController. // Halt the tab, which amounts to halting its webController.
- (void)terminateNetworkActivity { - (void)terminateNetworkActivity {
[self.webController terminateNetworkActivity]; [self.webController terminateNetworkActivity];
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
@protocol CRWWebViewNavigationProxy; @protocol CRWWebViewNavigationProxy;
class GURL;
namespace web { namespace web {
...@@ -38,10 +37,6 @@ class NavigationManagerDelegate { ...@@ -38,10 +37,6 @@ class NavigationManagerDelegate {
// navigation using a different user agent type. // navigation using a different user agent type.
virtual void WillChangeUserAgentType() = 0; virtual void WillChangeUserAgentType() = 0;
// Instructs the delegate to notify its delegates that the current navigation
// item will be loaded.
virtual void WillLoadCurrentItemWithUrl(const GURL&) = 0;
// Instructs the delegate to load the current navigation item. // Instructs the delegate to load the current navigation item.
virtual void LoadCurrentItem() = 0; virtual void LoadCurrentItem() = 0;
......
...@@ -262,7 +262,6 @@ void NavigationManagerImpl::LoadURLWithParams( ...@@ -262,7 +262,6 @@ void NavigationManagerImpl::LoadURLWithParams(
added_item->SetShouldSkipRepostFormConfirmation(true); added_item->SetShouldSkipRepostFormConfirmation(true);
} }
delegate_->WillLoadCurrentItemWithUrl(params.url);
delegate_->LoadCurrentItem(); delegate_->LoadCurrentItem();
} }
......
...@@ -73,7 +73,6 @@ class MockNavigationManagerDelegate : public NavigationManagerDelegate { ...@@ -73,7 +73,6 @@ class MockNavigationManagerDelegate : public NavigationManagerDelegate {
MOCK_METHOD0(ClearTransientContent, void()); MOCK_METHOD0(ClearTransientContent, void());
MOCK_METHOD0(RecordPageStateInNavigationItem, void()); MOCK_METHOD0(RecordPageStateInNavigationItem, void());
MOCK_METHOD0(UpdateHtml5HistoryState, void()); MOCK_METHOD0(UpdateHtml5HistoryState, void());
MOCK_METHOD1(WillLoadCurrentItemWithUrl, void(const GURL&));
MOCK_METHOD0(WillChangeUserAgentType, void()); MOCK_METHOD0(WillChangeUserAgentType, void());
MOCK_METHOD0(LoadCurrentItem, void()); MOCK_METHOD0(LoadCurrentItem, void());
MOCK_METHOD0(LoadIfNecessary, void()); MOCK_METHOD0(LoadIfNecessary, void());
...@@ -2128,8 +2127,6 @@ TEST_P(NavigationManagerTest, LoadURLWithParamsWithExtraHeadersAndPostData) { ...@@ -2128,8 +2127,6 @@ TEST_P(NavigationManagerTest, LoadURLWithParamsWithExtraHeadersAndPostData) {
EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem()) EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem())
.Times(1); .Times(1);
EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1); EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1);
EXPECT_CALL(navigation_manager_delegate(),
WillLoadCurrentItemWithUrl(::testing::Ref(params.url)));
EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1); EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1);
navigation_manager()->LoadURLWithParams(params); navigation_manager()->LoadURLWithParams(params);
...@@ -2161,8 +2158,6 @@ TEST_P(NavigationManagerTest, LoadURLWithParamsSavesStateOnCurrentItem) { ...@@ -2161,8 +2158,6 @@ TEST_P(NavigationManagerTest, LoadURLWithParamsSavesStateOnCurrentItem) {
EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem()) EXPECT_CALL(navigation_manager_delegate(), RecordPageStateInNavigationItem())
.Times(1); .Times(1);
EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1); EXPECT_CALL(navigation_manager_delegate(), ClearTransientContent()).Times(1);
EXPECT_CALL(navigation_manager_delegate(),
WillLoadCurrentItemWithUrl(::testing::Ref(params.url)));
EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1); EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(1);
navigation_manager()->LoadURLWithParams(params); navigation_manager()->LoadURLWithParams(params);
......
...@@ -69,7 +69,6 @@ class MockNavigationManagerDelegate : public NavigationManagerDelegate { ...@@ -69,7 +69,6 @@ class MockNavigationManagerDelegate : public NavigationManagerDelegate {
MOCK_METHOD0(ClearTransientContent, void()); MOCK_METHOD0(ClearTransientContent, void());
MOCK_METHOD0(RecordPageStateInNavigationItem, void()); MOCK_METHOD0(RecordPageStateInNavigationItem, void());
MOCK_METHOD0(UpdateHtml5HistoryState, void()); MOCK_METHOD0(UpdateHtml5HistoryState, void());
MOCK_METHOD1(WillLoadCurrentItemWithUrl, void(const GURL&));
MOCK_METHOD0(WillChangeUserAgentType, void()); MOCK_METHOD0(WillChangeUserAgentType, void());
MOCK_METHOD0(LoadCurrentItem, void()); MOCK_METHOD0(LoadCurrentItem, void());
MOCK_METHOD0(LoadIfNecessary, void()); MOCK_METHOD0(LoadIfNecessary, void());
...@@ -577,7 +576,6 @@ TEST_F(WKBasedNavigationManagerTest, RestoreSessionWithHistory) { ...@@ -577,7 +576,6 @@ TEST_F(WKBasedNavigationManagerTest, RestoreSessionWithHistory) {
items.push_back(std::move(item0)); items.push_back(std::move(item0));
items.push_back(std::move(item1)); items.push_back(std::move(item1));
EXPECT_CALL(delegate_, WillLoadCurrentItemWithUrl(testing::_)).Times(1);
manager_->Restore(0 /* last_committed_item_index */, std::move(items)); manager_->Restore(0 /* last_committed_item_index */, std::move(items));
NavigationItem* pending_item = manager_->GetPendingItem(); NavigationItem* pending_item = manager_->GetPendingItem();
...@@ -656,7 +654,6 @@ TEST_F(WKBasedNavigationManagerTest, RestoreSessionResetsHistory) { ...@@ -656,7 +654,6 @@ TEST_F(WKBasedNavigationManagerTest, RestoreSessionResetsHistory) {
// Tests that Restore() accepts empty session history and performs no-op. // Tests that Restore() accepts empty session history and performs no-op.
TEST_F(WKBasedNavigationManagerTest, RestoreSessionWithEmptyHistory) { TEST_F(WKBasedNavigationManagerTest, RestoreSessionWithEmptyHistory) {
EXPECT_CALL(delegate_, WillLoadCurrentItemWithUrl(testing::_)).Times(0);
manager_->Restore(-1 /* last_committed_item_index */, manager_->Restore(-1 /* last_committed_item_index */,
std::vector<std::unique_ptr<NavigationItem>>()); std::vector<std::unique_ptr<NavigationItem>>());
......
...@@ -37,15 +37,6 @@ class GURL; ...@@ -37,15 +37,6 @@ class GURL;
- (void)webController:(CRWWebController*)webController - (void)webController:(CRWWebController*)webController
retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; retrievePlaceholderOverlayImage:(void (^)(UIImage*))block;
// ---------------------------------------------------------------------
// TODO(rohitrao): Eliminate as many of the following delegate methods as
// possible. They only exist because the Tab and CRWWebController logic was
// very intertwined. We should streamline the logic to jump between classes
// less, then remove any delegate method that becomes unnecessary as a result.
// Called when a page is loaded using loadWithParams.
- (void)webDidUpdateSessionForLoadWithURL:(const GURL&)URL;
@optional @optional
// Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL.
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#import "ios/web/navigation/navigation_manager_delegate.h" #import "ios/web/navigation/navigation_manager_delegate.h"
class GURL;
@protocol CRWWebViewNavigationProxy; @protocol CRWWebViewNavigationProxy;
namespace web { namespace web {
...@@ -17,7 +16,6 @@ class FakeNavigationManagerDelegate : public NavigationManagerDelegate { ...@@ -17,7 +16,6 @@ class FakeNavigationManagerDelegate : public NavigationManagerDelegate {
void ClearTransientContent() override; void ClearTransientContent() override;
void RecordPageStateInNavigationItem() override; void RecordPageStateInNavigationItem() override;
void UpdateHtml5HistoryState() override; void UpdateHtml5HistoryState() override;
void WillLoadCurrentItemWithUrl(const GURL&) override;
void WillChangeUserAgentType() override; void WillChangeUserAgentType() override;
void LoadCurrentItem() override; void LoadCurrentItem() override;
void LoadIfNecessary() override; void LoadIfNecessary() override;
......
...@@ -15,7 +15,6 @@ namespace web { ...@@ -15,7 +15,6 @@ namespace web {
void FakeNavigationManagerDelegate::ClearTransientContent() {} void FakeNavigationManagerDelegate::ClearTransientContent() {}
void FakeNavigationManagerDelegate::RecordPageStateInNavigationItem() {} void FakeNavigationManagerDelegate::RecordPageStateInNavigationItem() {}
void FakeNavigationManagerDelegate::UpdateHtml5HistoryState() {} void FakeNavigationManagerDelegate::UpdateHtml5HistoryState() {}
void FakeNavigationManagerDelegate::WillLoadCurrentItemWithUrl(const GURL&) {}
void FakeNavigationManagerDelegate::WillChangeUserAgentType() {} void FakeNavigationManagerDelegate::WillChangeUserAgentType() {}
void FakeNavigationManagerDelegate::LoadCurrentItem() {} void FakeNavigationManagerDelegate::LoadCurrentItem() {}
void FakeNavigationManagerDelegate::LoadIfNecessary() {} void FakeNavigationManagerDelegate::LoadIfNecessary() {}
......
...@@ -158,11 +158,6 @@ class WebStateImpl; ...@@ -158,11 +158,6 @@ class WebStateImpl;
// to generate an overlay placeholder view. // to generate an overlay placeholder view.
- (BOOL)canUseViewForGeneratingOverlayPlaceholderView; - (BOOL)canUseViewForGeneratingOverlayPlaceholderView;
// Notifies delegate that |currentNavItem| will be loaded with |url|.
// TODO(crbug.com/674991): Remove this method when CRWWebDelegate is no longer
// used.
- (void)willLoadCurrentItemWithURL:(const GURL&)URL;
// Loads the URL indicated by current session state. // Loads the URL indicated by current session state.
- (void)loadCurrentURL; - (void)loadCurrentURL;
......
...@@ -1792,10 +1792,6 @@ registerLoadRequestForURL:(const GURL&)requestURL ...@@ -1792,10 +1792,6 @@ registerLoadRequestForURL:(const GURL&)requestURL
withCompletionHandler:completionHandler]; withCompletionHandler:completionHandler];
} }
- (void)willLoadCurrentItemWithURL:(const GURL&)URL {
[_delegate webDidUpdateSessionForLoadWithURL:URL];
}
- (void)loadCurrentURL { - (void)loadCurrentURL {
// If the content view doesn't exist, the tab has either been evicted, or // If the content view doesn't exist, the tab has either been evicted, or
// never displayed. Bail, and let the URL be loaded when the tab is shown. // never displayed. Bail, and let the URL be loaded when the tab is shown.
......
...@@ -277,7 +277,6 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate { ...@@ -277,7 +277,6 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
void RecordPageStateInNavigationItem() override; void RecordPageStateInNavigationItem() override;
void UpdateHtml5HistoryState() override; void UpdateHtml5HistoryState() override;
void WillChangeUserAgentType() override; void WillChangeUserAgentType() override;
void WillLoadCurrentItemWithUrl(const GURL&) override;
void LoadCurrentItem() override; void LoadCurrentItem() override;
void LoadIfNecessary() override; void LoadIfNecessary() override;
void Reload() override; void Reload() override;
......
...@@ -783,10 +783,6 @@ void WebStateImpl::WillChangeUserAgentType() { ...@@ -783,10 +783,6 @@ void WebStateImpl::WillChangeUserAgentType() {
[web_controller_ requirePageReconstruction]; [web_controller_ requirePageReconstruction];
} }
void WebStateImpl::WillLoadCurrentItemWithUrl(const GURL& url) {
[web_controller_ willLoadCurrentItemWithURL:url];
}
void WebStateImpl::LoadCurrentItem() { void WebStateImpl::LoadCurrentItem() {
[web_controller_ loadCurrentURL]; [web_controller_ loadCurrentURL];
} }
......
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