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

Side by Side Diff: ios/chrome/browser/tabs/tab.mm

Issue 2756483006: Adds NavigationManager util functions to ios/chrome/browser/web/ (Closed)
Patch Set: changed #include to #import and minor renaming. 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
« no previous file with comments | « no previous file | ios/chrome/browser/web/BUILD.gn » ('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/tabs/tab.h" 5 #import "ios/chrome/browser/tabs/tab.h"
6 6
7 #import <CoreLocation/CoreLocation.h> 7 #import <CoreLocation/CoreLocation.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #import "ios/chrome/browser/ui/fullscreen_controller.h" 98 #import "ios/chrome/browser/ui/fullscreen_controller.h"
99 #import "ios/chrome/browser/ui/open_in_controller.h" 99 #import "ios/chrome/browser/ui/open_in_controller.h"
100 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller. h" 100 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller. h"
101 #import "ios/chrome/browser/ui/prerender_delegate.h" 101 #import "ios/chrome/browser/ui/prerender_delegate.h"
102 #import "ios/chrome/browser/ui/reader_mode/reader_mode_checker.h" 102 #import "ios/chrome/browser/ui/reader_mode/reader_mode_checker.h"
103 #import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h" 103 #import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h"
104 #import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h" 104 #import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h"
105 #include "ios/chrome/browser/ui/ui_util.h" 105 #include "ios/chrome/browser/ui/ui_util.h"
106 #import "ios/chrome/browser/web/auto_reload_bridge.h" 106 #import "ios/chrome/browser/web/auto_reload_bridge.h"
107 #import "ios/chrome/browser/web/external_app_launcher.h" 107 #import "ios/chrome/browser/web/external_app_launcher.h"
108 #import "ios/chrome/browser/web/navigation_manager_util.h"
108 #import "ios/chrome/browser/web/passkit_dialog_provider.h" 109 #import "ios/chrome/browser/web/passkit_dialog_provider.h"
109 #include "ios/chrome/browser/web/print_observer.h" 110 #include "ios/chrome/browser/web/print_observer.h"
110 #import "ios/chrome/browser/xcallback_parameters.h" 111 #import "ios/chrome/browser/xcallback_parameters.h"
111 #include "ios/chrome/grit/ios_strings.h" 112 #include "ios/chrome/grit/ios_strings.h"
112 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 113 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
113 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_metad ata.h" 114 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_metad ata.h"
114 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_white list_manager.h" 115 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_white list_manager.h"
115 #import "ios/web/navigation/crw_session_controller.h" 116 #import "ios/web/navigation/crw_session_controller.h"
116 #import "ios/web/navigation/navigation_item_impl.h" 117 #import "ios/web/navigation/navigation_item_impl.h"
117 #import "ios/web/navigation/navigation_manager_impl.h" 118 #import "ios/web/navigation/navigation_manager_impl.h"
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 [self.webController requirePageReconstruction]; 1502 [self.webController requirePageReconstruction];
1502 1503
1503 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem 1504 // TODO(crbug.com/228171): A hack in session_controller -addPendingItem
1504 // discusses making tab responsible for distinguishing history stack 1505 // discusses making tab responsible for distinguishing history stack
1505 // navigation from new navigations. Because we want a new navigation here, we 1506 // navigation from new navigations. Because we want a new navigation here, we
1506 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so 1507 // use |PAGE_TRANSITION_FORM_SUBMIT|. When session_controller changes, so
1507 // should this. 1508 // should this.
1508 ui::PageTransition transition = 1509 ui::PageTransition transition =
1509 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_FORM_SUBMIT); 1510 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_FORM_SUBMIT);
1510 DCHECK([self navigationManager]); 1511 DCHECK([self navigationManager]);
1511 CRWSessionController* sessionController = 1512 web::NavigationItem* lastNonRedirectedItem =
1512 [self navigationManagerImpl]->GetSessionController(); 1513 GetLastNonRedirectedItem([self navigationManager]);
1513 web::NavigationItem* lastUserItem = [sessionController lastUserItem]; 1514 if (!lastNonRedirectedItem)
1514 if (!lastUserItem)
1515 return; 1515 return;
1516 1516
1517 // |originalUrl| will be empty if a page was open by DOM. 1517 // |originalUrl| will be empty if a page was open by DOM.
1518 GURL reloadURL(lastUserItem->GetOriginalRequestURL()); 1518 GURL reloadURL(lastNonRedirectedItem->GetOriginalRequestURL());
1519 if (reloadURL.is_empty()) { 1519 if (reloadURL.is_empty()) {
1520 DCHECK(sessionController.openedByDOM); 1520 DCHECK(
1521 reloadURL = lastUserItem->GetVirtualURL(); 1521 [[self navigationManagerImpl]->GetSessionController() isOpenedByDOM]);
1522 reloadURL = lastNonRedirectedItem->GetVirtualURL();
1522 } 1523 }
1523 1524
1524 web::NavigationManager::WebLoadParams params(reloadURL); 1525 web::NavigationManager::WebLoadParams params(reloadURL);
1525 params.referrer = lastUserItem->GetReferrer(); 1526 params.referrer = lastNonRedirectedItem->GetReferrer();
1526 params.transition_type = transition; 1527 params.transition_type = transition;
1527 if (self.navigationManager) 1528 if (self.navigationManager)
1528 self.navigationManager->LoadURLWithParams(params); 1529 self.navigationManager->LoadURLWithParams(params);
1529 } 1530 }
1530 1531
1531 - (id<SnapshotOverlayProvider>)snapshotOverlayProvider { 1532 - (id<SnapshotOverlayProvider>)snapshotOverlayProvider {
1532 return snapshotOverlayProvider_.get(); 1533 return snapshotOverlayProvider_.get();
1533 } 1534 }
1534 1535
1535 - (void)setSnapshotOverlayProvider: 1536 - (void)setSnapshotOverlayProvider:
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 2105
2105 - (TabModel*)parentTabModel { 2106 - (TabModel*)parentTabModel {
2106 return parentTabModel_; 2107 return parentTabModel_;
2107 } 2108 }
2108 2109
2109 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2110 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2110 return inputAccessoryViewController_.get(); 2111 return inputAccessoryViewController_.get();
2111 } 2112 }
2112 2113
2113 @end 2114 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698