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

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

Issue 2740233002: Remove CRWSessionController usage from BrowserViewController. (Closed)
Patch Set: 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 unified diff | Download patch
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 #include "ios/chrome/grit/ios_strings.h" 164 #include "ios/chrome/grit/ios_strings.h"
165 #import "ios/net/request_tracker.h" 165 #import "ios/net/request_tracker.h"
166 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 166 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
167 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h" 167 #include "ios/public/provider/chrome/browser/ui/app_rating_prompt.h"
168 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h" 168 #include "ios/public/provider/chrome/browser/ui/default_ios_web_view_factory.h"
169 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h" 169 #import "ios/public/provider/chrome/browser/voice/voice_search_bar.h"
170 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h" 170 #import "ios/public/provider/chrome/browser/voice/voice_search_bar_owner.h"
171 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h" 171 #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h"
172 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg ate.h" 172 #include "ios/public/provider/chrome/browser/voice/voice_search_controller_deleg ate.h"
173 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" 173 #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
174 #import "ios/web/navigation/crw_session_controller.h"
Eugene But (OOO till 7-30) 2017/03/10 16:23:27 Could you please cleanup ios/chrome/browser/ui/DEP
kkhorimoto 2017/03/10 23:02:19 Done.
175 #include "ios/web/navigation/navigation_manager_impl.h" 174 #include "ios/web/navigation/navigation_manager_impl.h"
176 #include "ios/web/public/active_state_manager.h" 175 #include "ios/web/public/active_state_manager.h"
177 #include "ios/web/public/navigation_item.h" 176 #include "ios/web/public/navigation_item.h"
178 #import "ios/web/public/navigation_manager.h" 177 #import "ios/web/public/navigation_manager.h"
179 #include "ios/web/public/referrer_util.h" 178 #include "ios/web/public/referrer_util.h"
180 #include "ios/web/public/ssl_status.h" 179 #include "ios/web/public/ssl_status.h"
181 #include "ios/web/public/url_scheme_util.h" 180 #include "ios/web/public/url_scheme_util.h"
182 #include "ios/web/public/user_agent.h" 181 #include "ios/web/public/user_agent.h"
183 #include "ios/web/public/web_client.h" 182 #include "ios/web/public/web_client.h"
184 #import "ios/web/public/web_state/context_menu_params.h" 183 #import "ios/web/public/web_state/context_menu_params.h"
(...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after
3393 3392
3394 - (void)showTabHistoryPopupForBackwardHistory { 3393 - (void)showTabHistoryPopupForBackwardHistory {
3395 DCHECK(self.visible || self.dismissingModal); 3394 DCHECK(self.visible || self.dismissingModal);
3396 3395
3397 // Dismiss the omnibox (if open). 3396 // Dismiss the omnibox (if open).
3398 [_toolbarController cancelOmniboxEdit]; 3397 [_toolbarController cancelOmniboxEdit];
3399 // Dismiss the soft keyboard (if open). 3398 // Dismiss the soft keyboard (if open).
3400 Tab* tab = [_model currentTab]; 3399 Tab* tab = [_model currentTab];
3401 [tab.webController dismissKeyboard]; 3400 [tab.webController dismissKeyboard];
3402 3401
3403 DCHECK([tab navigationManager]); 3402 web::NavigationManager* navigationManager = [tab navigationManager];
3404 CRWSessionController* sc = 3403 DCHECK(navigationManager);
Eugene But (OOO till 7-30) 2017/03/10 16:23:27 nit: There is no need for DCHECK |navigationManage
kkhorimoto 2017/03/10 23:02:19 Done.
3405 [tab navigationManagerImpl]->GetSessionController(); 3404 [_toolbarController
3406 [_toolbarController showTabHistoryPopupInView:[self view] 3405 showTabHistoryPopupInView:[self view]
3407 withItems:[sc backwardItems] 3406 withItems:navigationManager->GetBackwardItems()
3408 forBackHistory:YES]; 3407 forBackHistory:YES];
3409 } 3408 }
3410 3409
3411 - (void)showTabHistoryPopupForForwardHistory { 3410 - (void)showTabHistoryPopupForForwardHistory {
3412 DCHECK(self.visible || self.dismissingModal); 3411 DCHECK(self.visible || self.dismissingModal);
3413 3412
3414 // Dismiss the omnibox (if open). 3413 // Dismiss the omnibox (if open).
3415 [_toolbarController cancelOmniboxEdit]; 3414 [_toolbarController cancelOmniboxEdit];
3416 // Dismiss the soft keyboard (if open). 3415 // Dismiss the soft keyboard (if open).
3417 Tab* tab = [_model currentTab]; 3416 Tab* tab = [_model currentTab];
3418 [tab.webController dismissKeyboard]; 3417 [tab.webController dismissKeyboard];
3419 3418
3420 DCHECK([tab navigationManager]); 3419 web::NavigationManager* navigationManager = [tab navigationManager];
3421 CRWSessionController* sc = 3420 DCHECK(navigationManager);
3422 [tab navigationManagerImpl]->GetSessionController(); 3421 [_toolbarController
3423 [_toolbarController showTabHistoryPopupInView:[self view] 3422 showTabHistoryPopupInView:[self view]
3424 withItems:[sc forwardItems] 3423 withItems:navigationManager->GetForwardItems()
3425 forBackHistory:NO]; 3424 forBackHistory:NO];
3426 } 3425 }
3427 3426
3428 - (void)navigateToSelectedEntry:(id)sender { 3427 - (void)navigateToSelectedEntry:(id)sender {
3429 DCHECK([sender isKindOfClass:[TabHistoryCell class]]); 3428 DCHECK([sender isKindOfClass:[TabHistoryCell class]]);
3430 TabHistoryCell* selectedCell = (TabHistoryCell*)sender; 3429 TabHistoryCell* selectedCell = (TabHistoryCell*)sender;
3431 [[_model currentTab] goToItem:selectedCell.item]; 3430 [[_model currentTab] goToItem:selectedCell.item];
3432 [_toolbarController dismissTabHistoryPopup]; 3431 [_toolbarController dismissTabHistoryPopup];
3433 } 3432 }
3434 3433
3435 - (void)print { 3434 - (void)print {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3609 return; 3608 return;
3610 } 3609 }
3611 3610
3612 if (url == [_preloadController prerenderedURL]) { 3611 if (url == [_preloadController prerenderedURL]) {
3613 Tab* oldTab = [_model currentTab]; 3612 Tab* oldTab = [_model currentTab];
3614 Tab* newTab = [_preloadController releasePrerenderContents]; 3613 Tab* newTab = [_preloadController releasePrerenderContents];
3615 DCHECK(oldTab); 3614 DCHECK(oldTab);
3616 DCHECK(newTab); 3615 DCHECK(newTab);
3617 if (oldTab && newTab) { 3616 if (oldTab && newTab) {
3618 [oldTab recordStateInHistory]; 3617 [oldTab recordStateInHistory];
3619 DCHECK([newTab navigationManager]); 3618 web::NavigationManager* newNavigationManager = [newTab navigationManager];
3620 CRWSessionController* newHistory = 3619 web::NavigationManager* oldNavigationManager = [oldTab navigationManager];
3621 [newTab navigationManagerImpl]->GetSessionController(); 3620 DCHECK(newNavigationManager);
Eugene But (OOO till 7-30) 2017/03/10 16:23:27 ditto
kkhorimoto 2017/03/10 23:02:19 Done.
3622 DCHECK([oldTab navigationManager]); 3621 DCHECK(oldNavigationManager);
3623 CRWSessionController* oldHistory = 3622 newNavigationManager->InsertStateFromManager(oldNavigationManager);
3624 [oldTab navigationManagerImpl]->GetSessionController();
3625 [newHistory insertStateFromSessionController:oldHistory];
3626 [[newTab nativeAppNavigationController] 3623 [[newTab nativeAppNavigationController]
3627 copyStateFrom:[oldTab nativeAppNavigationController]]; 3624 copyStateFrom:[oldTab nativeAppNavigationController]];
3628 [_model replaceTab:oldTab withTab:newTab]; 3625 [_model replaceTab:oldTab withTab:newTab];
3629 3626
3630 // Set isPrerenderTab to NO after replacing the tab. This will allow the 3627 // Set isPrerenderTab to NO after replacing the tab. This will allow the
3631 // BrowserViewController to detect that a pre-rendered tab is switched in, 3628 // BrowserViewController to detect that a pre-rendered tab is switched in,
3632 // and show the prerendering animation. 3629 // and show the prerendering animation.
3633 newTab.isPrerenderTab = NO; 3630 newTab.isPrerenderTab = NO;
3634 3631
3635 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished]; 3632 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished];
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
5054 5051
5055 - (UIView*)voiceSearchButton { 5052 - (UIView*)voiceSearchButton {
5056 return _voiceSearchButton; 5053 return _voiceSearchButton;
5057 } 5054 }
5058 5055
5059 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5056 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5060 return [self currentLogoAnimationControllerOwner]; 5057 return [self currentLogoAnimationControllerOwner];
5061 } 5058 }
5062 5059
5063 @end 5060 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698