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

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

Issue 2712933002: Revert of Remove CRWSessionEntry usage from BrowserViewController. (Closed)
Patch Set: 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/preload_controller_delegate.h » ('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 972b2cc44b213fcbb160033b0fa9a08e56f918da..88368c6e54d28706be87be7c63a16d3c19d3c14b 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -170,6 +170,7 @@
#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"
@@ -1910,10 +1911,11 @@
// Hide the toolbar if displaying phone NTP.
if (!IsIPadIdiom()) {
- web::NavigationItem* item = [tab navigationManager]->GetVisibleItem();
+ CRWSessionEntry* entry =
+ [[tab navigationManager]->GetSessionController() currentEntry];
BOOL hideToolbar = NO;
- if (item) {
- GURL url = item->GetURL();
+ if (entry) {
+ GURL url = [entry navigationItem]->GetURL();
BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL);
hideToolbar = isNTP && !_isOffTheRecord &&
![_toolbarController isOmniboxFirstResponder] &&
@@ -4787,6 +4789,13 @@
return [_model currentTab].useDesktopUserAgent;
}
+- (CRWSessionEntry*)currentSessionEntry {
+ Tab* tab = [_model currentTab];
+ if (![tab navigationManager])
+ return nil;
+ return [[tab navigationManager]->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/preload_controller_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698