OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/npapi/plugin_utils.h" | 5 #include "webkit/plugins/npapi/plugin_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
11 #include "base/version.h" | 11 #include "base/version.h" |
12 | 12 |
13 namespace webkit { | 13 namespace webkit { |
14 namespace npapi { | 14 namespace npapi { |
15 | 15 |
16 void CreateVersionFromString(const string16& version_string, | 16 void CreateVersionFromString(const base::string16& version_string, |
17 Version* parsed_version) { | 17 Version* parsed_version) { |
18 // Remove spaces and ')' from the version string, | 18 // Remove spaces and ')' from the version string, |
19 // Replace any instances of 'r', ',' or '(' with a dot. | 19 // Replace any instances of 'r', ',' or '(' with a dot. |
20 std::string version = UTF16ToASCII(version_string); | 20 std::string version = UTF16ToASCII(version_string); |
21 RemoveChars(version, ") ", &version); | 21 RemoveChars(version, ") ", &version); |
22 std::replace(version.begin(), version.end(), 'd', '.'); | 22 std::replace(version.begin(), version.end(), 'd', '.'); |
23 std::replace(version.begin(), version.end(), 'r', '.'); | 23 std::replace(version.begin(), version.end(), 'r', '.'); |
24 std::replace(version.begin(), version.end(), ',', '.'); | 24 std::replace(version.begin(), version.end(), ',', '.'); |
25 std::replace(version.begin(), version.end(), '(', '.'); | 25 std::replace(version.begin(), version.end(), '(', '.'); |
26 std::replace(version.begin(), version.end(), '_', '.'); | 26 std::replace(version.begin(), version.end(), '_', '.'); |
(...skipping 20 matching lines...) Expand all Loading... |
47 bool NPAPIPluginsSupported() { | 47 bool NPAPIPluginsSupported() { |
48 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(USE_
AURA)) | 48 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(USE_
AURA)) |
49 return true; | 49 return true; |
50 #else | 50 #else |
51 return false; | 51 return false; |
52 #endif | 52 #endif |
53 } | 53 } |
54 | 54 |
55 } // namespace npapi | 55 } // namespace npapi |
56 } // namespace webkit | 56 } // namespace webkit |
OLD | NEW |