OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/setup/oauth_helper.h" | 5 #include "remoting/host/setup/oauth_helper.h" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "google_apis/google_api_keys.h" | 8 #include "google_apis/google_api_keys.h" |
9 #include "googleurl/src/url_parse.h" | 9 #include "googleurl/src/url_parse.h" |
10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 std::string GetComponent(const std::string& url, | 14 std::string GetComponent(const std::string& url, |
15 const url_parse::Component component) { | 15 const url_parse::Component component) { |
16 if (component.len < 0) { | 16 if (component.len < 0) { |
17 return std::string(); | 17 return std::string(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 url_parse::Component value; | 71 url_parse::Component value; |
72 while (ExtractQueryKeyValue(url.c_str(), &query, &key, &value)) { | 72 while (ExtractQueryKeyValue(url.c_str(), &query, &key, &value)) { |
73 if (GetComponent(url, key) == "code") { | 73 if (GetComponent(url, key) == "code") { |
74 return GetComponent(url, value); | 74 return GetComponent(url, value); |
75 } | 75 } |
76 } | 76 } |
77 return std::string(); | 77 return std::string(); |
78 } | 78 } |
79 | 79 |
80 } // namespace remoting | 80 } // namespace remoting |
OLD | NEW |