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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/browser_view_controller.h" 5 #import "ios/chrome/browser/ui/browser_view_controller.h"
6 6
7 #import <AssetsLibrary/AssetsLibrary.h> 7 #import <AssetsLibrary/AssetsLibrary.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 #import <PassKit/PassKit.h> 9 #import <PassKit/PassKit.h>
10 #import <Photos/Photos.h> 10 #import <Photos/Photos.h>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 #import "ios/net/request_tracker.h" 163 #import "ios/net/request_tracker.h"
164 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 164 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
165 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h" 165 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h"
166 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h" 166 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h"
167 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h" 167 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h"
168 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h" 168 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h"
169 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h" 169 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h"
170 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg ate.h" 170 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg ate.h"
171 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" 171 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
172 #import "ios/web/navigation/crw_session_controller.h" 172 #import "ios/web/navigation/crw_session_controller.h"
173 #import "ios/web/navigation/crw_session_entry.h"
173 #include "ios/web/navigation/navigation_manager_impl.h" 174 #include "ios/web/navigation/navigation_manager_impl.h"
174 #include "ios/web/public/active_state_manager.h" 175 #include "ios/web/public/active_state_manager.h"
175 #include "ios/web/public/navigation_item.h" 176 #include "ios/web/public/navigation_item.h"
176 #import "ios/web/public/navigation_manager.h" 177 #import "ios/web/public/navigation_manager.h"
177 #include "ios/web/public/referrer_util.h" 178 #include "ios/web/public/referrer_util.h"
178 #include "ios/web/public/ssl_status.h" 179 #include "ios/web/public/ssl_status.h"
179 #include "ios/web/public/url_scheme_util.h" 180 #include "ios/web/public/url_scheme_util.h"
180 #include "ios/web/public/web_client.h" 181 #include "ios/web/public/web_client.h"
181 #import "ios/web/public/web_state/context_menu_params.h" 182 #import "ios/web/public/web_state/context_menu_params.h"
182 #import "ios/web/public/web_state/crw_web_view_proxy.h" 183 #import "ios/web/public/web_state/crw_web_view_proxy.h"
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 1904
1904 FindInPageController* controller = GetFindInPageController(tab); 1905 FindInPageController* controller = GetFindInPageController(tab);
1905 if (controller.findInPageModel.enabled) { 1906 if (controller.findInPageModel.enabled) {
1906 [self showFindBarWithAnimation:NO 1907 [self showFindBarWithAnimation:NO
1907 selectText:YES 1908 selectText:YES
1908 shouldFocus:[_findBarController isFocused]]; 1909 shouldFocus:[_findBarController isFocused]];
1909 } 1910 }
1910 1911
1911 // Hide the toolbar if displaying phone NTP. 1912 // Hide the toolbar if displaying phone NTP.
1912 if (!IsIPadIdiom()) { 1913 if (!IsIPadIdiom()) {
1913 web::NavigationItem* item = [tab navigationManager]->GetVisibleItem(); 1914 CRWSessionEntry* entry =
1915 [[tab navigationManager]->GetSessionController() currentEntry];
1914 BOOL hideToolbar = NO; 1916 BOOL hideToolbar = NO;
1915 if (item) { 1917 if (entry) {
1916 GURL url = item->GetURL(); 1918 GURL url = [entry navigationItem]->GetURL();
1917 BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL); 1919 BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL);
1918 hideToolbar = isNTP && !_isOffTheRecord && 1920 hideToolbar = isNTP && !_isOffTheRecord &&
1919 ![_toolbarController isOmniboxFirstResponder] && 1921 ![_toolbarController isOmniboxFirstResponder] &&
1920 ![_toolbarController showingOmniboxPopup]; 1922 ![_toolbarController showingOmniboxPopup];
1921 } 1923 }
1922 [[_toolbarController view] setHidden:hideToolbar]; 1924 [[_toolbarController view] setHidden:hideToolbar];
1923 } 1925 }
1924 } 1926 }
1925 1927
1926 - (void)updateDialogPresenterActiveState { 1928 - (void)updateDialogPresenterActiveState {
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
4780 } 4782 }
4781 return YES; 4783 return YES;
4782 } 4784 }
4783 4785
4784 #pragma mark - PreloadControllerDelegate methods 4786 #pragma mark - PreloadControllerDelegate methods
4785 4787
4786 - (BOOL)shouldUseDesktopUserAgent { 4788 - (BOOL)shouldUseDesktopUserAgent {
4787 return [_model currentTab].useDesktopUserAgent; 4789 return [_model currentTab].useDesktopUserAgent;
4788 } 4790 }
4789 4791
4792 - (CRWSessionEntry*)currentSessionEntry {
4793 Tab* tab = [_model currentTab];
4794 if (![tab navigationManager])
4795 return nil;
4796 return [[tab navigationManager]->GetSessionController() currentEntry];
4797 }
4798
4790 #pragma mark - BookmarkBridgeMethods 4799 #pragma mark - BookmarkBridgeMethods
4791 4800
4792 // If an added or removed bookmark is the same as the current url, update the 4801 // If an added or removed bookmark is the same as the current url, update the
4793 // toolbar so the star highlight is kept in sync. 4802 // toolbar so the star highlight is kept in sync.
4794 - (void)bookmarkNodeModified:(const BookmarkNode*)node { 4803 - (void)bookmarkNodeModified:(const BookmarkNode*)node {
4795 if ([_model currentTab] && node->url() == [_model currentTab].url) 4804 if ([_model currentTab] && node->url() == [_model currentTab].url)
4796 [self updateToolbar]; 4805 [self updateToolbar];
4797 } 4806 }
4798 4807
4799 // If all bookmarks are removed, update the toolbar so the star highlight is 4808 // If all bookmarks are removed, update the toolbar so the star highlight is
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
4988 4997
4989 - (UIView*)voiceSearchButton { 4998 - (UIView*)voiceSearchButton {
4990 return _voiceSearchButton; 4999 return _voiceSearchButton;
4991 } 5000 }
4992 5001
4993 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5002 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
4994 return [self currentLogoAnimationControllerOwner]; 5003 return [self currentLogoAnimationControllerOwner];
4995 } 5004 }
4996 5005
4997 @end 5006 @end
OLDNEW
« 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