OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_UTIL_H_ | 5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_ |
6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_ | 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_ |
7 | 7 |
8 // This file contains extensions for web::NavigationManager API without making | 8 // This file contains extensions for web::NavigationManager API without making |
9 // them part of ios/web/public. | 9 // them part of ios/web/public. |
10 | 10 |
11 namespace web { | 11 namespace web { |
12 | 12 |
13 class NavigationItem; | 13 class NavigationItem; |
14 class NavigationManager; | 14 class NavigationManager; |
15 | 15 |
| 16 // Returns transient, committed or pending navigation item with given |
| 17 // |unique_id| or null if item is not found. Item's unique id is retrieved via |
| 18 // GetUniqueID method. |
| 19 NavigationItem* GetItemWithUniqueID(NavigationManager* navigation_manager, |
| 20 int unique_id); |
| 21 |
16 // Returns committed navigation item with given |unique_id| or null if item | 22 // Returns committed navigation item with given |unique_id| or null if item |
17 // is not found or it is pending or transient. Item's unique id is retrieved | 23 // is not found or it is pending or transient. Item's unique id is retrieved |
18 // via GetUniqueID method. | 24 // via GetUniqueID method. |
19 NavigationItem* GetCommittedItemWithUniqueID( | 25 NavigationItem* GetCommittedItemWithUniqueID( |
20 NavigationManager* navigation_manager, | 26 NavigationManager* navigation_manager, |
21 int unique_id); | 27 int unique_id); |
22 | 28 |
23 // Returns committed navigation item index with given |unique_id| or -1 if item | 29 // Returns committed navigation item index with given |unique_id| or -1 if item |
24 // is not found or it is pending or transient. Item's unique id is retrieved | 30 // is not found or it is pending or transient. Item's unique id is retrieved |
25 // via GetUniqueID method. | 31 // via GetUniqueID method. |
26 int GetCommittedItemIndexWithUniqueID(NavigationManager* navigation_manager, | 32 int GetCommittedItemIndexWithUniqueID(NavigationManager* navigation_manager, |
27 int unique_id); | 33 int unique_id); |
28 | 34 |
29 } // namespace web | 35 } // namespace web |
30 | 36 |
31 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_ | 37 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_ |
OLD | NEW |