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/pepper_plugin_info.h" | 5 #include "content/public/common/pepper_plugin_info.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 PepperPluginInfo::EntryPoints::EntryPoints() | 11 PepperPluginInfo::EntryPoints::EntryPoints() |
12 : get_interface(NULL), | 12 : get_interface(NULL), |
13 initialize_module(NULL), | 13 initialize_module(NULL), |
14 shutdown_module(NULL) { | 14 shutdown_module(NULL) { |
15 } | 15 } |
16 | 16 |
17 PepperPluginInfo::PepperPluginInfo() | 17 PepperPluginInfo::PepperPluginInfo() |
18 : is_internal(false), | 18 : is_internal(false), |
19 is_out_of_process(false), | 19 is_out_of_process(false), |
20 is_sandboxed(true), | |
21 permissions(0) { | 20 permissions(0) { |
22 } | 21 } |
23 | 22 |
24 PepperPluginInfo::~PepperPluginInfo() { | 23 PepperPluginInfo::~PepperPluginInfo() { |
25 } | 24 } |
26 | 25 |
27 WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { | 26 WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { |
28 WebPluginInfo info; | 27 WebPluginInfo info; |
29 | 28 |
30 info.type = is_out_of_process ? | 29 info.type = is_out_of_process ? |
31 (is_sandboxed ? | 30 WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS : |
32 WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS : | |
33 WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED) : | |
34 WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; | 31 WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; |
35 | 32 |
36 info.name = name.empty() ? | 33 info.name = name.empty() ? |
37 path.BaseName().LossyDisplayName() : base::UTF8ToUTF16(name); | 34 path.BaseName().LossyDisplayName() : base::UTF8ToUTF16(name); |
38 info.path = path; | 35 info.path = path; |
39 info.version = base::ASCIIToUTF16(version); | 36 info.version = base::ASCIIToUTF16(version); |
40 info.desc = base::ASCIIToUTF16(description); | 37 info.desc = base::ASCIIToUTF16(description); |
41 info.mime_types = mime_types; | 38 info.mime_types = mime_types; |
42 info.pepper_permissions = permissions; | 39 info.pepper_permissions = permissions; |
43 | 40 |
44 return info; | 41 return info; |
45 } | 42 } |
46 | 43 |
47 } // namespace content | 44 } // namespace content |
OLD | NEW |