Roll src/third_party/skia 96e657d:4412465
[chromium-blink-merge.git] / ios / web / history_state_util.h
blob6c48928f3428eadd07e1fa1a353d1221ed753e8b
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_
8 #import <Foundation/Foundation.h>
10 #include <string>
12 class GURL;
14 namespace web {
15 namespace history_state_util {
17 // Checks if toUrl is a valid argument to history.pushState() or
18 // history.replaceState() given the current URL.
19 bool IsHistoryStateChangeValid(const GURL& currentUrl,
20 const GURL& toUrl);
22 // Generates the appropriate full URL for a history.pushState() or
23 // history.replaceState() transition from currentURL to destination, resolved
24 // against baseURL. |destination| may be a relative URL. Will return an invalid
25 // URL if the resolved destination, or the transition, is not valid.
26 GURL GetHistoryStateChangeUrl(const GURL& currentUrl,
27 const GURL& baseUrl,
28 const std::string& destination);
30 } // namespace history_state_util
31 } // namespace web
33 #endif // IOS_WEB_HISTORY_STATE_UTIL_H_