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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2690943006: Remove CRWSessionEntry usage from BrowserViewController. (Closed)
Patch Set: fix DEPS 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"
174 #include "ios/web/navigation/navigation_manager_impl.h" 173 #include "ios/web/navigation/navigation_manager_impl.h"
175 #include "ios/web/public/active_state_manager.h" 174 #include "ios/web/public/active_state_manager.h"
176 #include "ios/web/public/navigation_item.h" 175 #include "ios/web/public/navigation_item.h"
177 #import "ios/web/public/navigation_manager.h" 176 #import "ios/web/public/navigation_manager.h"
178 #include "ios/web/public/referrer_util.h" 177 #include "ios/web/public/referrer_util.h"
179 #include "ios/web/public/ssl_status.h" 178 #include "ios/web/public/ssl_status.h"
180 #include "ios/web/public/url_scheme_util.h" 179 #include "ios/web/public/url_scheme_util.h"
181 #include "ios/web/public/web_client.h" 180 #include "ios/web/public/web_client.h"
182 #import "ios/web/public/web_state/context_menu_params.h" 181 #import "ios/web/public/web_state/context_menu_params.h"
183 #import "ios/web/public/web_state/crw_web_view_proxy.h" 182 #import "ios/web/public/web_state/crw_web_view_proxy.h"
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 1903
1905 FindInPageController* controller = GetFindInPageController(tab); 1904 FindInPageController* controller = GetFindInPageController(tab);
1906 if (controller.findInPageModel.enabled) { 1905 if (controller.findInPageModel.enabled) {
1907 [self showFindBarWithAnimation:NO 1906 [self showFindBarWithAnimation:NO
1908 selectText:YES 1907 selectText:YES
1909 shouldFocus:[_findBarController isFocused]]; 1908 shouldFocus:[_findBarController isFocused]];
1910 } 1909 }
1911 1910
1912 // Hide the toolbar if displaying phone NTP. 1911 // Hide the toolbar if displaying phone NTP.
1913 if (!IsIPadIdiom()) { 1912 if (!IsIPadIdiom()) {
1914 CRWSessionEntry* entry = 1913 web::NavigationItem* item = [tab navigationManager]->GetVisibleItem();
1915 [[tab navigationManager]->GetSessionController() currentEntry];
1916 BOOL hideToolbar = NO; 1914 BOOL hideToolbar = NO;
1917 if (entry) { 1915 if (item) {
1918 GURL url = [entry navigationItem]->GetURL(); 1916 GURL url = item->GetURL();
1919 BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL); 1917 BOOL isNTP = url.GetOrigin() == GURL(kChromeUINewTabURL);
1920 hideToolbar = isNTP && !_isOffTheRecord && 1918 hideToolbar = isNTP && !_isOffTheRecord &&
1921 ![_toolbarController isOmniboxFirstResponder] && 1919 ![_toolbarController isOmniboxFirstResponder] &&
1922 ![_toolbarController showingOmniboxPopup]; 1920 ![_toolbarController showingOmniboxPopup];
1923 } 1921 }
1924 [[_toolbarController view] setHidden:hideToolbar]; 1922 [[_toolbarController view] setHidden:hideToolbar];
1925 } 1923 }
1926 } 1924 }
1927 1925
1928 - (void)updateDialogPresenterActiveState { 1926 - (void)updateDialogPresenterActiveState {
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
4782 } 4780 }
4783 return YES; 4781 return YES;
4784 } 4782 }
4785 4783
4786 #pragma mark - PreloadControllerDelegate methods 4784 #pragma mark - PreloadControllerDelegate methods
4787 4785
4788 - (BOOL)shouldUseDesktopUserAgent { 4786 - (BOOL)shouldUseDesktopUserAgent {
4789 return [_model currentTab].useDesktopUserAgent; 4787 return [_model currentTab].useDesktopUserAgent;
4790 } 4788 }
4791 4789
4792 - (CRWSessionEntry*)currentSessionEntry {
4793 Tab* tab = [_model currentTab];
4794 if (![tab navigationManager])
4795 return nil;
4796 return [[tab navigationManager]->GetSessionController() currentEntry];
4797 }
4798
4799 #pragma mark - BookmarkBridgeMethods 4790 #pragma mark - BookmarkBridgeMethods
4800 4791
4801 // If an added or removed bookmark is the same as the current url, update the 4792 // If an added or removed bookmark is the same as the current url, update the
4802 // toolbar so the star highlight is kept in sync. 4793 // toolbar so the star highlight is kept in sync.
4803 - (void)bookmarkNodeModified:(const BookmarkNode*)node { 4794 - (void)bookmarkNodeModified:(const BookmarkNode*)node {
4804 if ([_model currentTab] && node->url() == [_model currentTab].url) 4795 if ([_model currentTab] && node->url() == [_model currentTab].url)
4805 [self updateToolbar]; 4796 [self updateToolbar];
4806 } 4797 }
4807 4798
4808 // If all bookmarks are removed, update the toolbar so the star highlight is 4799 // 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
4997 4988
4998 - (UIView*)voiceSearchButton { 4989 - (UIView*)voiceSearchButton {
4999 return _voiceSearchButton; 4990 return _voiceSearchButton;
5000 } 4991 }
5001 4992
5002 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 4993 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5003 return [self currentLogoAnimationControllerOwner]; 4994 return [self currentLogoAnimationControllerOwner];
5004 } 4995 }
5005 4996
5006 @end 4997 @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