blob: 2c565a64be0ad2aa91a352f12aff1206a3ecc61c [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_
#define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_
// This file contains extensions for web::NavigationManager API without making
// them part of ios/web/public.
namespace web {
class NavigationItem;
class NavigationManager;
// Returns transient, committed or pending navigation item with given
// |unique_id| or null if item is not found. Item's unique id is retrieved via
// GetUniqueID method.
NavigationItem* GetItemWithUniqueID(NavigationManager* navigation_manager,
int unique_id);
// Returns committed navigation item with given |unique_id| or null if item
// is not found or it is pending or transient. Item's unique id is retrieved
// via GetUniqueID method.
NavigationItem* GetCommittedItemWithUniqueID(
NavigationManager* navigation_manager,
int unique_id);
// Returns committed navigation item index with given |unique_id| or -1 if item
// is not found or it is pending or transient. Item's unique id is retrieved
// via GetUniqueID method.
int GetCommittedItemIndexWithUniqueID(NavigationManager* navigation_manager,
int unique_id);
} // namespace web
#endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_UTIL_H_