Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_info.cc

Issue 7978009: Split ppapi::PluginList from PepperPluginRegistry so that DRT could load pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_info.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "webkit/plugins/ppapi/ppapi_plugin_info.h"
6
7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h"
9
10 namespace webkit {
11 namespace ppapi {
12
13 PluginInfo::PluginInfo()
14 : is_internal(false),
15 is_out_of_process(false) {
16 }
17
18 PluginInfo::~PluginInfo() {
19 }
20
21 void PepperToWebPluginInfo(const PluginInfo& pepper_info,
22 webkit::WebPluginInfo* web_info) {
23 web_info->type = pepper_info.is_out_of_process ?
24 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS :
25 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS;
26
27 web_info->name = pepper_info.name.empty() ?
28 pepper_info.path.BaseName().LossyDisplayName() :
29 UTF8ToUTF16(pepper_info.name);
30 web_info->path = pepper_info.path;
31 web_info->version = ASCIIToUTF16(pepper_info.version);
32 web_info->desc = ASCIIToUTF16(pepper_info.description);
33 web_info->mime_types = pepper_info.mime_types;
34 }
35
36 bool WebToPepperPluginInfo(const webkit::WebPluginInfo& web_info,
37 PluginInfo* pepper_info) {
38 if (!webkit::IsPepperPlugin(web_info))
39 return false;
40
41 pepper_info->is_out_of_process =
42 web_info.type == webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS;
43
44 pepper_info->path = FilePath(web_info.path);
45 pepper_info->name = UTF16ToASCII(web_info.name);
46 pepper_info->description = UTF16ToASCII(web_info.desc);
47 pepper_info->version = UTF16ToASCII(web_info.version);
48 pepper_info->mime_types = web_info.mime_types;
49 return true;
50 }
51
52 } // namespace ppapi
53 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_info.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698