| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base/capabilities.h" | 5 #include "remoting/base/capabilities.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 | 11 |
| 12 namespace remoting { | 12 namespace remoting { |
| 13 | 13 |
| 14 bool HasCapability(const std::string& capabilities, const std::string& key) { | 14 bool HasCapability(const std::string& capabilities, const std::string& key) { |
| 15 std::vector<std::string> caps; | 15 std::vector<std::string> caps; |
| 16 Tokenize(capabilities, " ", &caps); | 16 Tokenize(capabilities, " ", &caps); |
| 17 return std::find(caps.begin(), caps.end(), key) != caps.end(); | 17 return std::find(caps.begin(), caps.end(), key) != caps.end(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 std::string IntersectCapabilities(const std::string& client_capabilities, | 20 std::string IntersectCapabilities(const std::string& client_capabilities, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 host_caps.begin(), | 35 host_caps.begin(), |
| 36 host_caps.end(), | 36 host_caps.end(), |
| 37 result.begin()); | 37 result.begin()); |
| 38 if (end != result.end()) | 38 if (end != result.end()) |
| 39 result.erase(end, result.end()); | 39 result.erase(end, result.end()); |
| 40 | 40 |
| 41 return JoinString(result, " "); | 41 return JoinString(result, " "); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace remoting | 44 } // namespace remoting |
| OLD | NEW |