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

Unified Diff: ios/web/shell/view_controller.mm

Issue 1838323003: [ios] Added NavigationManager::LoadURLWithParams public API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/navigation_manager.h ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/view_controller.mm
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm
index 893ec812fa90f677286546fdf69d173c91d8a6d9..4bc488efd95a6ebd06ce422a4c488f88cc51c417 100644
--- a/ios/web/shell/view_controller.mm
+++ b/ios/web/shell/view_controller.mm
@@ -44,6 +44,7 @@ using web::NavigationManager;
base::mac::ObjCPropertyReleaser _propertyReleaser_ViewController;
}
@property(nonatomic, assign, readonly) web::WebState* webState;
+@property(nonatomic, assign, readonly) NavigationManager* navigationManager;
@property(nonatomic, readwrite, retain) UITextField* field;
@end
@@ -129,13 +130,17 @@ using web::NavigationManager;
NavigationManager::WebLoadParams params(GURL("https://dev.chromium.org/"));
params.transition_type = ui::PAGE_TRANSITION_TYPED;
- [_webController loadWithParams:params];
+ self.navigationManager->LoadURLWithParams(params);
}
- (web::WebState*)webState {
return [_webController webState];
}
+- (NavigationManager*)navigationManager {
+ return self.webState->GetNavigationManager();
+}
+
- (void)setUpNetworkStack {
// Disable the default cache.
[NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]];
@@ -169,16 +174,14 @@ using web::NavigationManager;
}
- (void)back {
- NavigationManager* navManager = self.webState->GetNavigationManager();
- if (navManager->CanGoBack()) {
- navManager->GoBack();
+ if (self.navigationManager->CanGoBack()) {
+ self.navigationManager->GoBack();
}
}
- (void)forward {
- NavigationManager* navManager = self.webState->GetNavigationManager();
- if (navManager->CanGoForward()) {
- navManager->GoForward();
+ if (self.navigationManager->CanGoForward()) {
+ self.navigationManager->GoForward();
}
}
@@ -189,7 +192,7 @@ using web::NavigationManager;
if (URL.is_valid()) {
NavigationManager::WebLoadParams params(URL);
params.transition_type = ui::PAGE_TRANSITION_TYPED;
- [_webController loadWithParams:params];
+ self.navigationManager->LoadURLWithParams(params);
}
[field resignFirstResponder];
« no previous file with comments | « ios/web/public/navigation_manager.h ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698