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 | 16 |
17 // Delegate for NavigationManager to hand off parts of the navigation flow. | 17 // Delegate for NavigationManager to hand off parts of the navigation flow. |
18 class NavigationManagerDelegate { | 18 class NavigationManagerDelegate { |
19 public: | 19 public: |
20 virtual ~NavigationManagerDelegate() {} | 20 virtual ~NavigationManagerDelegate() {} |
21 | 21 |
22 // Instructs the delegate to begin navigating to the item with index. | 22 // Instructs the delegate to begin navigating to the item with index. |
23 // TODO(crbug.com/661316): Remove this method once all navigation code is | 23 // TODO(crbug.com/661316): Remove this method once all navigation code is |
24 // moved to NavigationManagerImpl. | 24 // moved to NavigationManagerImpl. |
25 virtual void GoToIndex(int index) = 0; | 25 virtual void GoToIndex(int index) = 0; |
26 | 26 |
27 // Instructs the delegate to load the URL. | 27 // Instructs the delegate to load the URL. |
28 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; | 28 virtual void LoadURLWithParams(const NavigationManager::WebLoadParams&) = 0; |
29 | 29 |
| 30 // Informs that delegate to reload. |
| 31 virtual void Reload() = 0; |
| 32 |
30 // Informs the delegate that committed navigation items have been pruned. | 33 // Informs the delegate that committed navigation items have been pruned. |
31 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; | 34 virtual void OnNavigationItemsPruned(size_t pruned_item_count) = 0; |
32 | 35 |
33 // Informs the delegate that a navigation item has been changed. | 36 // Informs the delegate that a navigation item has been changed. |
34 virtual void OnNavigationItemChanged() = 0; | 37 virtual void OnNavigationItemChanged() = 0; |
35 | 38 |
36 // Informs the delegate that a navigation item has been commited. | 39 // Informs the delegate that a navigation item has been commited. |
37 virtual void OnNavigationItemCommitted( | 40 virtual void OnNavigationItemCommitted( |
38 const LoadCommittedDetails& load_details) = 0; | 41 const LoadCommittedDetails& load_details) = 0; |
39 | 42 |
40 // Returns the WebState associated with this delegate. | 43 // Returns the WebState associated with this delegate. |
41 virtual WebState* GetWebState() = 0; | 44 virtual WebState* GetWebState() = 0; |
42 }; | 45 }; |
43 | 46 |
44 } // namespace web | 47 } // namespace web |
45 | 48 |
46 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ | 49 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_DELEGATE_H_ |
OLD | NEW |