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

Side by Side Diff: webkit/plugins/npapi/webplugininfo.cc

Issue 7648017: Make WebPluginInfo more generic (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/npapi/webplugininfo.h ('k') | webkit/plugins/webplugininfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/npapi/webplugininfo.h"
6
7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h"
9
10 namespace webkit {
11 namespace npapi {
12
13 WebPluginMimeType::WebPluginMimeType() {}
14
15 WebPluginMimeType::WebPluginMimeType(const std::string& m,
16 const std::string& f,
17 const std::string& d)
18 : mime_type(m),
19 file_extensions(),
20 description(ASCIIToUTF16(d)) {
21 file_extensions.push_back(f);
22 }
23
24 WebPluginMimeType::~WebPluginMimeType() {}
25
26 WebPluginInfo::WebPluginInfo()
27 : enabled(USER_DISABLED_POLICY_UNMANAGED) {
28 }
29
30 WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs)
31 : name(rhs.name),
32 path(rhs.path),
33 version(rhs.version),
34 desc(rhs.desc),
35 mime_types(rhs.mime_types),
36 enabled(rhs.enabled) {
37 }
38
39 WebPluginInfo::~WebPluginInfo() {}
40
41 WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) {
42 name = rhs.name;
43 path = rhs.path;
44 version = rhs.version;
45 desc = rhs.desc;
46 mime_types = rhs.mime_types;
47 enabled = rhs.enabled;
48 return *this;
49 }
50
51 WebPluginInfo::WebPluginInfo(const string16& fake_name,
52 const FilePath& fake_path,
53 const string16& fake_version,
54 const string16& fake_desc)
55 : name(fake_name),
56 path(fake_path),
57 version(fake_version),
58 desc(fake_desc),
59 mime_types(),
60 enabled(USER_ENABLED_POLICY_UNMANAGED) {
61 }
62
63 bool IsPluginEnabled(const WebPluginInfo& plugin) {
64 return ((plugin.enabled & WebPluginInfo::POLICY_ENABLED) ||
65 plugin.enabled == WebPluginInfo::USER_ENABLED_POLICY_UNMANAGED);
66 }
67
68 } // namespace npapi
69 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/webplugininfo.h ('k') | webkit/plugins/webplugininfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698