Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
| 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #import <WebKit/WebKit.h> | |
| 8 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <memory> | |
| 9 | 11 |
| 10 #import "ios/web/public/navigation_manager.h" | 12 #import "ios/web/public/navigation_manager.h" |
| 11 | 13 |
| 12 namespace web { | 14 namespace web { |
| 13 | 15 |
| 14 struct LoadCommittedDetails; | 16 struct LoadCommittedDetails; |
| 15 class WebState; | 17 class WebState; |
| 18 class WebViewNavigationProxy; | |
| 16 | 19 |
| 17 // Delegate for NavigationManager to hand off parts of the navigation flow. | 20 // Delegate for NavigationManager to hand off parts of the navigation flow. |
| 18 class NavigationManagerDelegate { | 21 class NavigationManagerDelegate { |
| 19 public: | 22 public: |
| 20 virtual ~NavigationManagerDelegate() {} | 23 virtual ~NavigationManagerDelegate() {} |
| 21 | 24 |
| 22 // Instructs the delegate to begin navigating to the item with index. | 25 // Instructs the delegate to begin navigating to the item with index. |
| 23 // TODO(crbug.com/661316): Remove this method once all navigation code is | 26 // TODO(crbug.com/661316): Remove this method once all navigation code is |
| 24 // moved to NavigationManagerImpl. | 27 // moved to NavigationManagerImpl. |
| 25 virtual void GoToIndex(int index) = 0; | 28 virtual void GoToIndex(int index) = 0; |
| 26 | 29 |
| 27 // Instructs the delegate to load the URL. | 30 // Instructs the delegate to load the URL. |
| 28 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; | 31 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; |
| 29 | 32 |
| 30 // Instructs the delegate to reload. | 33 // Instructs the delegate to reload. |
| 31 virtual void Reload() = 0; | 34 virtual void Reload() = 0; |
| 32 | 35 |
| 33 // Informs the delegate that committed navigation items have been pruned. | 36 // Informs the delegate that committed navigation items have been pruned. |
| 34 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; | 37 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; |
| 35 | 38 |
| 36 // Informs the delegate that a navigation item has been changed. | 39 // Informs the delegate that a navigation item has been changed. |
| 37 virtual void OnNavigationItemChanged() = 0; | 40 virtual void OnNavigationItemChanged() = 0; |
| 38 | 41 |
| 39 // Informs the delegate that a navigation item has been commited. | 42 // Informs the delegate that a navigation item has been commited. |
| 40 virtual void OnNavigationItemCommitted( | 43 virtual void OnNavigationItemCommitted( |
| 41 const LoadCommittedDetails& load_details) = 0; | 44 const LoadCommittedDetails& load_details) = 0; |
| 42 | 45 |
| 43 // Returns the WebState associated with this delegate. | 46 // Returns the WebState associated with this delegate. |
| 44 virtual WebState* GetWebState() = 0; | 47 virtual WebState* GetWebState() = 0; |
| 48 | |
| 49 // Returns the main WKWebView used to display web content. | |
| 50 virtual WebViewNavigationProxy* GetWebViewNavigationProxy() const = 0; | |
|
Eugene But (OOO till 7-30)
2017/06/27 22:02:00
Would it make sense to have WKBasedNavigationManag
danyao
2017/06/28 22:11:04
I prefer this over SetWebViewNavigationProxy for a
Eugene But (OOO till 7-30)
2017/06/29 01:48:18
It's just somewhat strange that delegate has Get<S
| |
| 45 }; | 51 }; |
| 46 | 52 |
| 47 } // namespace web | 53 } // namespace web |
| 48 | 54 |
| 49 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 55 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
| OLD | NEW |