Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: ios/web/history_state_util.h

Issue 988383002: Upstream various ios/web utilities and helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-public-upstreaming
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/history_state_util.h
diff --git a/ios/web/history_state_util.h b/ios/web/history_state_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c48928f3428eadd07e1fa1a353d1221ed753e8b
--- /dev/null
+++ b/ios/web/history_state_util.h
@@ -0,0 +1,33 @@
+// Copyright 2012 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_HISTORY_STATE_UTIL_H_
+#define IOS_WEB_HISTORY_STATE_UTIL_H_
+
+#import <Foundation/Foundation.h>
Eugene But (OOO till 7-30) 2015/03/09 16:17:43 Optional: No need for this mport
+
+#include <string>
+
+class GURL;
+
+namespace web {
+namespace history_state_util {
+
+// Checks if toUrl is a valid argument to history.pushState() or
+// history.replaceState() given the current URL.
+bool IsHistoryStateChangeValid(const GURL& currentUrl,
+ const GURL& toUrl);
+
+// Generates the appropriate full URL for a history.pushState() or
+// history.replaceState() transition from currentURL to destination, resolved
+// against baseURL. |destination| may be a relative URL. Will return an invalid
+// URL if the resolved destination, or the transition, is not valid.
+GURL GetHistoryStateChangeUrl(const GURL& currentUrl,
+ const GURL& baseUrl,
+ const std::string& destination);
+
+} // namespace history_state_util
+} // namespace web
+
+#endif // IOS_WEB_HISTORY_STATE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698