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

Unified Diff: ios/chrome/common/x_callback_url.h

Issue 2485573003: Functions to create and manipulate x-callback-url URLs. (Closed)
Patch Set: Address comments Created 4 years, 1 month 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
« no previous file with comments | « ios/chrome/common/DEPS ('k') | ios/chrome/common/x_callback_url.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/common/x_callback_url.h
diff --git a/ios/chrome/common/x_callback_url.h b/ios/chrome/common/x_callback_url.h
new file mode 100644
index 0000000000000000000000000000000000000000..5d7d53edc6845d50a988f986afb632bbab03eb3f
--- /dev/null
+++ b/ios/chrome/common/x_callback_url.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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_CHROME_COMMON_X_CALLBACK_URL_H_
+#define IOS_CHROME_COMMON_X_CALLBACK_URL_H_
+
+#include <map>
+#include <string>
+
+#include "base/strings/string_piece.h"
+#include "url/gurl.h"
+
+// Returns true if |url| is compliant with the x-callback-url specs.
+bool IsXCallbackURL(const GURL& url);
+
+// Returns a GURL compliant with the x-callback-url specs (simple version with
+// no parameters set, see XCallbackURLWithParameters for constructing complex
+// URLs).
+GURL CreateXCallbackURL(base::StringPiece scheme, base::StringPiece action);
+
+// Returns a GURL compliant with the x-callback-url specs.
+// See http://x-callback-url.com/specifications/ for specifications.
+// |scheme| must not be empty, all other parameters may be.
+GURL CreateXCallbackURLWithParameters(
+ base::StringPiece scheme,
+ base::StringPiece action,
+ const GURL& success_url,
+ const GURL& error_url,
+ const GURL& cancel_url,
+ const std::map<std::string, std::string>& parameters);
+
+// Extract query parameters from an x-callback-url URL. |x_callback_url| must
+// be compliant with the x-callback-url specs.
+std::map<std::string, std::string> ExtractQueryParametersFromXCallbackURL(
+ const GURL& x_callback_url);
+
+#endif // IOS_CHROME_COMMON_X_CALLBACK_URL_H_
« no previous file with comments | « ios/chrome/common/DEPS ('k') | ios/chrome/common/x_callback_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698