OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/npapi/webplugininfo.h" |
6 | 6 |
| 7 #include "base/logging.h" |
| 8 |
7 namespace webkit { | 9 namespace webkit { |
8 namespace npapi { | 10 namespace npapi { |
9 | 11 |
10 WebPluginMimeType::WebPluginMimeType() {} | 12 WebPluginMimeType::WebPluginMimeType() {} |
11 | 13 |
12 WebPluginMimeType::~WebPluginMimeType() {} | 14 WebPluginMimeType::~WebPluginMimeType() {} |
13 | 15 |
14 WebPluginInfo::WebPluginInfo() : enabled(false) {} | 16 WebPluginInfo::WebPluginInfo() |
| 17 : enabled(USER_DISABLED_POLICY_UNMANAGED) { |
| 18 } |
15 | 19 |
16 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) | 20 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) |
17 : name(rhs.name), | 21 : name(rhs.name), |
18 path(rhs.path), | 22 path(rhs.path), |
19 version(rhs.version), | 23 version(rhs.version), |
20 desc(rhs.desc), | 24 desc(rhs.desc), |
21 mime_types(rhs.mime_types), | 25 mime_types(rhs.mime_types), |
22 enabled(rhs.enabled) { | 26 enabled(rhs.enabled) { |
23 } | 27 } |
24 | 28 |
(...skipping 11 matching lines...) Expand all Loading... |
36 | 40 |
37 WebPluginInfo::WebPluginInfo(const string16& fake_name, | 41 WebPluginInfo::WebPluginInfo(const string16& fake_name, |
38 const FilePath& fake_path, | 42 const FilePath& fake_path, |
39 const string16& fake_version, | 43 const string16& fake_version, |
40 const string16& fake_desc) | 44 const string16& fake_desc) |
41 : name(fake_name), | 45 : name(fake_name), |
42 path(fake_path), | 46 path(fake_path), |
43 version(fake_version), | 47 version(fake_version), |
44 desc(fake_desc), | 48 desc(fake_desc), |
45 mime_types(), | 49 mime_types(), |
46 enabled(true) { | 50 enabled(USER_ENABLED_POLICY_UNMANAGED) { |
| 51 } |
| 52 |
| 53 bool IsPluginEnabled(const WebPluginInfo& plugin) { |
| 54 return ((plugin.enabled & WebPluginInfo::POLICY_ENABLED) || |
| 55 plugin.enabled == WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED); |
47 } | 56 } |
48 | 57 |
49 } // namespace npapi | 58 } // namespace npapi |
50 } // namespace webkit | 59 } // namespace webkit |
51 | |
OLD | NEW |