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/webplugininfo.h" | 5 #include "webkit/plugins/webplugininfo.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 | 9 |
10 namespace webkit { | 10 namespace webkit { |
11 | 11 |
12 WebPluginMimeType::WebPluginMimeType() {} | 12 WebPluginMimeType::WebPluginMimeType() {} |
13 | 13 |
14 WebPluginMimeType::WebPluginMimeType(const std::string& m, | 14 WebPluginMimeType::WebPluginMimeType(const std::string& m, |
15 const std::string& f, | 15 const std::string& f, |
16 const std::string& d) | 16 const std::string& d) |
17 : mime_type(m), | 17 : mime_type(m), |
18 file_extensions(), | 18 file_extensions(), |
19 description(ASCIIToUTF16(d)) { | 19 description(ASCIIToUTF16(d)) { |
20 file_extensions.push_back(f); | 20 file_extensions.push_back(f); |
21 } | 21 } |
22 | 22 |
23 WebPluginMimeType::~WebPluginMimeType() {} | 23 WebPluginMimeType::~WebPluginMimeType() {} |
24 | 24 |
25 WebPluginInfo::WebPluginInfo() : type(PLUGIN_TYPE_NPAPI) { | 25 WebPluginInfo::WebPluginInfo() |
| 26 : type(PLUGIN_TYPE_NPAPI), |
| 27 pepper_permissions(0) { |
26 } | 28 } |
27 | 29 |
28 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) | 30 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) |
29 : name(rhs.name), | 31 : name(rhs.name), |
30 path(rhs.path), | 32 path(rhs.path), |
31 version(rhs.version), | 33 version(rhs.version), |
32 desc(rhs.desc), | 34 desc(rhs.desc), |
33 mime_types(rhs.mime_types), | 35 mime_types(rhs.mime_types), |
34 type(rhs.type) { | 36 type(rhs.type), |
| 37 pepper_permissions(rhs.pepper_permissions) { |
35 } | 38 } |
36 | 39 |
37 WebPluginInfo::~WebPluginInfo() {} | 40 WebPluginInfo::~WebPluginInfo() {} |
38 | 41 |
39 WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) { | 42 WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) { |
40 name = rhs.name; | 43 name = rhs.name; |
41 path = rhs.path; | 44 path = rhs.path; |
42 version = rhs.version; | 45 version = rhs.version; |
43 desc = rhs.desc; | 46 desc = rhs.desc; |
44 mime_types = rhs.mime_types; | 47 mime_types = rhs.mime_types; |
45 type = rhs.type; | 48 type = rhs.type; |
| 49 pepper_permissions = rhs.pepper_permissions; |
46 return *this; | 50 return *this; |
47 } | 51 } |
48 | 52 |
49 WebPluginInfo::WebPluginInfo(const string16& fake_name, | 53 WebPluginInfo::WebPluginInfo(const string16& fake_name, |
50 const FilePath& fake_path, | 54 const FilePath& fake_path, |
51 const string16& fake_version, | 55 const string16& fake_version, |
52 const string16& fake_desc) | 56 const string16& fake_desc) |
53 : name(fake_name), | 57 : name(fake_name), |
54 path(fake_path), | 58 path(fake_path), |
55 version(fake_version), | 59 version(fake_version), |
56 desc(fake_desc), | 60 desc(fake_desc), |
57 mime_types(), | 61 mime_types(), |
58 type(PLUGIN_TYPE_NPAPI) { | 62 type(PLUGIN_TYPE_NPAPI), |
| 63 pepper_permissions(0) { |
59 } | 64 } |
60 | 65 |
61 bool IsPepperPlugin(const WebPluginInfo& plugin) { | 66 bool IsPepperPlugin(const WebPluginInfo& plugin) { |
62 return ((plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS ) || | 67 return ((plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS ) || |
63 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || | 68 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || |
64 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED)); | 69 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED)); |
65 } | 70 } |
66 | 71 |
67 bool IsOutOfProcessPlugin(const WebPluginInfo& plugin) { | 72 bool IsOutOfProcessPlugin(const WebPluginInfo& plugin) { |
68 return ((plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) || | 73 return ((plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) || |
69 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || | 74 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || |
70 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED)); | 75 (plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED)); |
71 } | 76 } |
72 | 77 |
73 } // namespace webkit | 78 } // namespace webkit |
OLD | NEW |