| 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" |
| 11 |
| 10 namespace web { | 12 namespace web { |
| 11 | 13 |
| 12 struct LoadCommittedDetails; | 14 struct LoadCommittedDetails; |
| 13 class WebState; | 15 class WebState; |
| 14 | 16 |
| 15 // Delegate for NavigationManager to hand off parts of the navigation flow. | 17 // Delegate for NavigationManager to hand off parts of the navigation flow. |
| 16 // TODO(stuartmorgan): See if this can be eliminated by moving more | 18 // TODO(stuartmorgan): See if this can be eliminated by moving more |
| 17 class NavigationManagerDelegate { | 19 class NavigationManagerDelegate { |
| 18 public: | 20 public: |
| 19 virtual ~NavigationManagerDelegate() {} | 21 virtual ~NavigationManagerDelegate() {} |
| 20 | 22 |
| 21 // Instructs the delegate to begin navigating to the pending entry. | 23 // Instructs the delegate to begin navigating to the pending entry. |
| 22 // TODO(stuartmorgan): Remove this once more navigation logic moves to | 24 // TODO(stuartmorgan): Remove this once more navigation logic moves to |
| 23 // NavigationManagerImpl. | 25 // NavigationManagerImpl. |
| 24 virtual void NavigateToPendingEntry() = 0; | 26 virtual void NavigateToPendingEntry() = 0; |
| 25 | 27 |
| 28 // Instructs the delegate to load the URL. |
| 29 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; |
| 30 |
| 26 // Informs the delegate that committed navigation items have been pruned. | 31 // Informs the delegate that committed navigation items have been pruned. |
| 27 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; | 32 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; |
| 28 | 33 |
| 29 // Informs the delegate that a navigation item has been changed. | 34 // Informs the delegate that a navigation item has been changed. |
| 30 virtual void OnNavigationItemChanged() = 0; | 35 virtual void OnNavigationItemChanged() = 0; |
| 31 | 36 |
| 32 // Informs the delegate that a navigation item has been commited. | 37 // Informs the delegate that a navigation item has been commited. |
| 33 virtual void OnNavigationItemCommitted( | 38 virtual void OnNavigationItemCommitted( |
| 34 const LoadCommittedDetails& load_details) = 0; | 39 const LoadCommittedDetails& load_details) = 0; |
| 35 | 40 |
| 36 // Returns the WebState associated with this delegate. | 41 // Returns the WebState associated with this delegate. |
| 37 virtual WebState* GetWebState() = 0; | 42 virtual WebState* GetWebState() = 0; |
| 38 }; | 43 }; |
| 39 | 44 |
| 40 } // namespace web | 45 } // namespace web |
| 41 | 46 |
| 42 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 47 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
| OLD | NEW |