| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef IOS_CHROME_COMMON_X_CALLBACK_URL_H_ |
| 6 #define IOS_CHROME_COMMON_X_CALLBACK_URL_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 11 #include "base/strings/string_piece.h" |
| 12 #include "url/gurl.h" |
| 13 |
| 14 // Returns true if |url| is compliant with the x-callback-url specs. |
| 15 bool IsXCallbackURL(const GURL& url); |
| 16 |
| 17 // Returns a GURL compliant with the x-callback-url specs (simple version with |
| 18 // no parameters set, see XCallbackURLWithParameters for constructing complex |
| 19 // URLs). |
| 20 GURL CreateXCallbackURL(base::StringPiece scheme, base::StringPiece action); |
| 21 |
| 22 // Returns a GURL compliant with the x-callback-url specs. |
| 23 // See http://x-callback-url.com/specifications/ for specifications. |
| 24 // |scheme| must not be empty, all other parameters may be. |
| 25 GURL CreateXCallbackURLWithParameters( |
| 26 base::StringPiece scheme, |
| 27 base::StringPiece action, |
| 28 const GURL& success_url, |
| 29 const GURL& error_url, |
| 30 const GURL& cancel_url, |
| 31 const std::map<std::string, std::string>& parameters); |
| 32 |
| 33 // Extract query parameters from an x-callback-url URL. |x_callback_url| must |
| 34 // be compliant with the x-callback-url specs. |
| 35 std::map<std::string, std::string> ExtractQueryParametersFromXCallbackURL( |
| 36 const GURL& x_callback_url); |
| 37 |
| 38 #endif // IOS_CHROME_COMMON_X_CALLBACK_URL_H_ |
| OLD | NEW |