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/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 namespace npapi { | |
12 | 11 |
13 WebPluginMimeType::WebPluginMimeType() {} | 12 WebPluginMimeType::WebPluginMimeType() {} |
14 | 13 |
15 WebPluginMimeType::WebPluginMimeType(const std::string& m, | 14 WebPluginMimeType::WebPluginMimeType(const std::string& m, |
16 const std::string& f, | 15 const std::string& f, |
17 const std::string& d) | 16 const std::string& d) |
18 : mime_type(m), | 17 : mime_type(m), |
19 file_extensions(), | 18 file_extensions(), |
20 description(ASCIIToUTF16(d)) { | 19 description(ASCIIToUTF16(d)) { |
21 file_extensions.push_back(f); | 20 file_extensions.push_back(f); |
22 } | 21 } |
23 | 22 |
24 WebPluginMimeType::~WebPluginMimeType() {} | 23 WebPluginMimeType::~WebPluginMimeType() {} |
25 | 24 |
26 WebPluginInfo::WebPluginInfo() | 25 WebPluginInfo::WebPluginInfo() |
27 : enabled(USER_DISABLED_POLICY_UNMANAGED) { | 26 : enabled(USER_DISABLED_POLICY_UNMANAGED), type(PLUGIN_TYPE_NPAPI) { |
28 } | 27 } |
29 | 28 |
30 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) | 29 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) |
31 : name(rhs.name), | 30 : name(rhs.name), |
32 path(rhs.path), | 31 path(rhs.path), |
33 version(rhs.version), | 32 version(rhs.version), |
34 desc(rhs.desc), | 33 desc(rhs.desc), |
35 mime_types(rhs.mime_types), | 34 mime_types(rhs.mime_types), |
36 enabled(rhs.enabled) { | 35 enabled(rhs.enabled), |
| 36 type(rhs.type) { |
37 } | 37 } |
38 | 38 |
39 WebPluginInfo::~WebPluginInfo() {} | 39 WebPluginInfo::~WebPluginInfo() {} |
40 | 40 |
41 WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) { | 41 WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) { |
42 name = rhs.name; | 42 name = rhs.name; |
43 path = rhs.path; | 43 path = rhs.path; |
44 version = rhs.version; | 44 version = rhs.version; |
45 desc = rhs.desc; | 45 desc = rhs.desc; |
46 mime_types = rhs.mime_types; | 46 mime_types = rhs.mime_types; |
47 enabled = rhs.enabled; | 47 enabled = rhs.enabled; |
| 48 type = rhs.type; |
48 return *this; | 49 return *this; |
49 } | 50 } |
50 | 51 |
51 WebPluginInfo::WebPluginInfo(const string16& fake_name, | 52 WebPluginInfo::WebPluginInfo(const string16& fake_name, |
52 const FilePath& fake_path, | 53 const FilePath& fake_path, |
53 const string16& fake_version, | 54 const string16& fake_version, |
54 const string16& fake_desc) | 55 const string16& fake_desc) |
55 : name(fake_name), | 56 : name(fake_name), |
56 path(fake_path), | 57 path(fake_path), |
57 version(fake_version), | 58 version(fake_version), |
58 desc(fake_desc), | 59 desc(fake_desc), |
59 mime_types(), | 60 mime_types(), |
60 enabled(USER_ENABLED_POLICY_UNMANAGED) { | 61 enabled(USER_ENABLED_POLICY_UNMANAGED), |
| 62 type(PLUGIN_TYPE_NPAPI) { |
61 } | 63 } |
62 | 64 |
63 bool IsPluginEnabled(const WebPluginInfo& plugin) { | 65 bool IsPluginEnabled(const WebPluginInfo& plugin) { |
64 return ((plugin.enabled & WebPluginInfo::POLICY_ENABLED) || | 66 return ((plugin.enabled & WebPluginInfo::POLICY_ENABLED) || |
65 plugin.enabled == WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED); | 67 plugin.enabled == WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED); |
66 } | 68 } |
67 | 69 |
68 } // namespace npapi | |
69 } // namespace webkit | 70 } // namespace webkit |
OLD | NEW |