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

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

Issue 2722983003: Reland Tab History and BrowserViewController CRWSessionEntry removal. (Closed)
Patch Set: TODO, early return Created 3 years, 10 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/history/BUILD.gn » ('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 767fdea5744bd638740d557735b4c0feb54cd2a9..ad2e0f31203d38c25b19e97152ea1cc2f8b684c7 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_delegate.h"
#include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
#import "ios/web/navigation/crw_session_controller.h"
-#import "ios/web/navigation/crw_session_entry.h"
#include "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/public/active_state_manager.h"
#include "ios/web/public/navigation_item.h"
@@ -1918,11 +1917,10 @@ - (void)updateToolbar {
// Hide the toolbar if displaying phone NTP.
if (!IsIPadIdiom()) {
- CRWSessionEntry* entry =
- [[tab navigationManagerImpl]->GetSessionController() currentEntry];
+ web::NavigationItem* item = [tab navigationManager]->GetVisibleItem();
BOOL hideToolbar = NO;
- if (entry) {
- GURL url = [entry navigationItem]->GetURL();
+ if (item) {
+ GURL url = item->GetURL();
BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL);
hideToolbar = isNTP && !_isOffTheRecord &&
![_toolbarController isOmniboxFirstResponder] &&
@@ -3380,7 +3378,7 @@ - (void)showTabHistoryPopupForBackwardHistory {
CRWSessionController* sc =
[tab navigationManagerImpl]->GetSessionController();
[_toolbarController showTabHistoryPopupInView:[self view]
- withSessionEntries:[sc backwardEntries]
+ withItems:[sc backwardItems]
forBackHistory:YES];
}
@@ -3397,14 +3395,14 @@ - (void)showTabHistoryPopupForForwardHistory {
CRWSessionController* sc =
[tab navigationManagerImpl]->GetSessionController();
[_toolbarController showTabHistoryPopupInView:[self view]
- withSessionEntries:[sc forwardEntries]
+ withItems:[sc forwardItems]
forBackHistory:NO];
}
- (void)navigateToSelectedEntry:(id)sender {
DCHECK([sender isKindOfClass:[TabHistoryCell class]]);
TabHistoryCell* selectedCell = (TabHistoryCell*)sender;
- [[_model currentTab] goToItem:selectedCell.entry.navigationItem];
+ [[_model currentTab] goToItem:selectedCell.item];
[_toolbarController dismissTabHistoryPopup];
}
@@ -4817,13 +4815,6 @@ - (BOOL)shouldUseDesktopUserAgent {
return [_model currentTab].usesDesktopUserAgent;
}
-- (CRWSessionEntry*)currentSessionEntry {
- Tab* tab = [_model currentTab];
- if (![tab navigationManager])
- return nil;
- return [[tab navigationManagerImpl]->GetSessionController() currentEntry];
-}
-
#pragma mark - BookmarkBridgeMethods
// If an added or removed bookmark is the same as the current url, update the
« no previous file with comments | « ios/chrome/browser/ui/DEPS ('k') | ios/chrome/browser/ui/history/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698