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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #import "ios/web/public/navigation_manager.h" | 10 #import "ios/web/public/navigation_manager.h" |
| 11 | 11 |
| 12 namespace web { | 12 namespace web { |
| 13 | 13 |
| 14 struct LoadCommittedDetails; | 14 struct LoadCommittedDetails; |
| 15 class WebState; | 15 class WebState; |
| 16 class WebViewNavigationProxy; | |
| 16 | 17 |
| 17 // Delegate for NavigationManager to hand off parts of the navigation flow. | 18 // Delegate for NavigationManager to hand off parts of the navigation flow. |
| 18 class NavigationManagerDelegate { | 19 class NavigationManagerDelegate { |
| 19 public: | 20 public: |
| 20 virtual ~NavigationManagerDelegate() {} | 21 virtual ~NavigationManagerDelegate() {} |
| 21 | 22 |
| 22 // Instructs the delegate to begin navigating to the item with index. | 23 // Instructs the delegate to begin navigating to the item with index. |
| 23 // TODO(crbug.com/661316): Remove this method once all navigation code is | 24 // TODO(crbug.com/661316): Remove this method once all navigation code is |
| 24 // moved to NavigationManagerImpl. | 25 // moved to NavigationManagerImpl. |
| 25 virtual void GoToIndex(int index) = 0; | 26 virtual void GoToIndex(int index) = 0; |
| 26 | 27 |
| 27 // Instructs the delegate to load the URL. | 28 // Instructs the delegate to load the URL. |
| 28 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; | 29 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; |
| 29 | 30 |
| 30 // Instructs the delegate to reload. | 31 // Instructs the delegate to reload. |
| 31 virtual void Reload() = 0; | 32 virtual void Reload() = 0; |
| 32 | 33 |
| 33 // Informs the delegate that committed navigation items have been pruned. | 34 // Informs the delegate that committed navigation items have been pruned. |
| 34 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; | 35 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; |
| 35 | 36 |
| 36 // Informs the delegate that a navigation item has been changed. | 37 // Informs the delegate that a navigation item has been changed. |
| 37 virtual void OnNavigationItemChanged() = 0; | 38 virtual void OnNavigationItemChanged() = 0; |
| 38 | 39 |
| 39 // Informs the delegate that a navigation item has been commited. | 40 // Informs the delegate that a navigation item has been commited. |
| 40 virtual void OnNavigationItemCommitted( | 41 virtual void OnNavigationItemCommitted( |
| 41 const LoadCommittedDetails& load_details) = 0; | 42 const LoadCommittedDetails& load_details) = 0; |
| 42 | 43 |
| 43 // Returns the WebState associated with this delegate. | 44 // Returns the WebState associated with this delegate. |
| 44 virtual WebState* GetWebState() = 0; | 45 virtual WebState* GetWebState() = 0; |
| 46 | |
| 47 // Returns the main WKWebView used to display web content. | |
|
Eugene But (OOO till 7-30)
2017/06/29 01:48:19
Update comment?
danyao
2017/06/29 16:05:25
Done.
| |
| 48 virtual WebViewNavigationProxy* GetWebViewNavigationProxy() const = 0; | |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace web | 51 } // namespace web |
| 48 | 52 |
| 49 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 53 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
| OLD | NEW |