1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_HISTORY_STATE_UTIL_H_
6 #define IOS_WEB_HISTORY_STATE_UTIL_H_
13 namespace history_state_util
{
15 // Checks if toUrl is a valid argument to history.pushState() or
16 // history.replaceState() given the current URL.
17 bool IsHistoryStateChangeValid(const GURL
& currentUrl
,
20 // Generates the appropriate full URL for a history.pushState() or
21 // history.replaceState() transition from currentURL to destination, resolved
22 // against baseURL. |destination| may be a relative URL. Will return an invalid
23 // URL if the resolved destination, or the transition, is not valid.
24 GURL
GetHistoryStateChangeUrl(const GURL
& currentUrl
,
26 const std::string
& destination
);
28 } // namespace history_state_util
31 #endif // IOS_WEB_HISTORY_STATE_UTIL_H_