Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2740233002: Remove CRWSessionController usage from BrowserViewController. (Closed)
Patch Set: Eugene's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/DEPS ('k') | ios/chrome/browser/ui/browser_view_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index a9b01c7d578fa0d66d0fb4317ce7390689acb2b6..26faf64bf1f4541c300a84cf24ea7906b99aa070 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -172,7 +172,6 @@
#include "ios/public/provider/chrome/browser/voice/voice_search_controller.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_controller_delegate.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
-#import "ios/web/navigation/crw_session_controller.h"
#include "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/public/active_state_manager.h"
#include "ios/web/public/navigation_item.h"
@@ -3434,12 +3433,11 @@ - (void)showTabHistoryPopupForBackwardHistory {
Tab* tab = [_model currentTab];
[tab.webController dismissKeyboard];
- DCHECK([tab navigationManager]);
- CRWSessionController* sc =
- [tab navigationManagerImpl]->GetSessionController();
- [_toolbarController showTabHistoryPopupInView:[self view]
- withItems:[sc backwardItems]
- forBackHistory:YES];
+ web::NavigationManager* navigationManager = [tab navigationManager];
+ [_toolbarController
+ showTabHistoryPopupInView:[self view]
+ withItems:navigationManager->GetBackwardItems()
+ forBackHistory:YES];
}
- (void)showTabHistoryPopupForForwardHistory {
@@ -3451,12 +3449,12 @@ - (void)showTabHistoryPopupForForwardHistory {
Tab* tab = [_model currentTab];
[tab.webController dismissKeyboard];
- DCHECK([tab navigationManager]);
- CRWSessionController* sc =
- [tab navigationManagerImpl]->GetSessionController();
- [_toolbarController showTabHistoryPopupInView:[self view]
- withItems:[sc forwardItems]
- forBackHistory:NO];
+ web::NavigationManager* navigationManager = [tab navigationManager];
+ DCHECK(navigationManager);
+ [_toolbarController
+ showTabHistoryPopupInView:[self view]
+ withItems:navigationManager->GetForwardItems()
+ forBackHistory:NO];
}
- (void)navigateToSelectedEntry:(id)sender {
@@ -3650,13 +3648,9 @@ - (void)loadURL:(const GURL&)url
DCHECK(newTab);
if (oldTab && newTab) {
[oldTab recordStateInHistory];
- DCHECK([newTab navigationManager]);
- CRWSessionController* newHistory =
- [newTab navigationManagerImpl]->GetSessionController();
- DCHECK([oldTab navigationManager]);
- CRWSessionController* oldHistory =
- [oldTab navigationManagerImpl]->GetSessionController();
- [newHistory insertStateFromSessionController:oldHistory];
+ web::NavigationManager* newNavigationManager = [newTab navigationManager];
+ web::NavigationManager* oldNavigationManager = [oldTab navigationManager];
+ newNavigationManager->InsertStateFromManager(oldNavigationManager);
[[newTab nativeAppNavigationController]
copyStateFrom:[oldTab nativeAppNavigationController]];
[_model replaceTab:oldTab withTab:newTab];
« no previous file with comments | « ios/chrome/browser/ui/DEPS ('k') | ios/chrome/browser/ui/browser_view_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698