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 "content/public/common/webplugininfo.h" | 5 #include "content/public/common/webplugininfo.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 file_extensions(), | 25 file_extensions(), |
26 description(base::ASCIIToUTF16(d)) { | 26 description(base::ASCIIToUTF16(d)) { |
27 file_extensions.push_back(f); | 27 file_extensions.push_back(f); |
28 } | 28 } |
29 | 29 |
30 WebPluginMimeType::WebPluginMimeType(const WebPluginMimeType& other) = default; | 30 WebPluginMimeType::WebPluginMimeType(const WebPluginMimeType& other) = default; |
31 | 31 |
32 WebPluginMimeType::~WebPluginMimeType() {} | 32 WebPluginMimeType::~WebPluginMimeType() {} |
33 | 33 |
34 WebPluginInfo::WebPluginInfo() | 34 WebPluginInfo::WebPluginInfo() |
35 : type(PLUGIN_TYPE_NPAPI), | 35 : type(PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS), |
36 pepper_permissions(0) { | 36 pepper_permissions(0) { |
37 } | 37 } |
38 | 38 |
39 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) | 39 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) |
40 : name(rhs.name), | 40 : name(rhs.name), |
41 path(rhs.path), | 41 path(rhs.path), |
42 version(rhs.version), | 42 version(rhs.version), |
43 desc(rhs.desc), | 43 desc(rhs.desc), |
44 mime_types(rhs.mime_types), | 44 mime_types(rhs.mime_types), |
45 type(rhs.type), | 45 type(rhs.type), |
(...skipping 15 matching lines...) Expand all Loading... |
61 | 61 |
62 WebPluginInfo::WebPluginInfo(const base::string16& fake_name, | 62 WebPluginInfo::WebPluginInfo(const base::string16& fake_name, |
63 const base::FilePath& fake_path, | 63 const base::FilePath& fake_path, |
64 const base::string16& fake_version, | 64 const base::string16& fake_version, |
65 const base::string16& fake_desc) | 65 const base::string16& fake_desc) |
66 : name(fake_name), | 66 : name(fake_name), |
67 path(fake_path), | 67 path(fake_path), |
68 version(fake_version), | 68 version(fake_version), |
69 desc(fake_desc), | 69 desc(fake_desc), |
70 mime_types(), | 70 mime_types(), |
71 type(PLUGIN_TYPE_NPAPI), | 71 type(PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS), |
72 pepper_permissions(0) { | 72 pepper_permissions(0) { |
73 } | 73 } |
74 | 74 |
75 void WebPluginInfo::CreateVersionFromString( | 75 void WebPluginInfo::CreateVersionFromString( |
76 const base::string16& version_string, | 76 const base::string16& version_string, |
77 base::Version* parsed_version) { | 77 base::Version* parsed_version) { |
78 // Remove spaces and ')' from the version string, | 78 // Remove spaces and ')' from the version string, |
79 // Replace any instances of 'r', ',' or '(' with a dot. | 79 // Replace any instances of 'r', ',' or '(' with a dot. |
80 std::string version = base::UTF16ToASCII(version_string); | 80 std::string version = base::UTF16ToASCII(version_string); |
81 base::RemoveChars(version, ") ", &version); | 81 base::RemoveChars(version, ") ", &version); |
(...skipping 16 matching lines...) Expand all Loading... |
98 no_leading_zeros_version += (j < n) ? numbers[i].substr(j) : "0"; | 98 no_leading_zeros_version += (j < n) ? numbers[i].substr(j) : "0"; |
99 if (i != numbers.size() - 1) { | 99 if (i != numbers.size() - 1) { |
100 no_leading_zeros_version += "."; | 100 no_leading_zeros_version += "."; |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 *parsed_version = Version(no_leading_zeros_version); | 104 *parsed_version = Version(no_leading_zeros_version); |
105 } | 105 } |
106 | 106 |
107 } // namespace content | 107 } // namespace content |
OLD | NEW |