1
Index: src/chrome/browser/browser_resources.grd
2
===================================================================
3
--- src/chrome/browser/browser_resources.grd (revision 179520)
4
+++ src/chrome/browser/browser_resources.grd (working copy)
7
<if expr="not pp_ifdef('chromeos')">
8
<include name="IDR_PLUGIN_DB_JSON" file="resources\plugin_metadata\plugins_linux.json" type="BINDATA" />
9
+ <include name="IDR_PLATFORM_PLUGIN_DB_JSON" file="resources\plugin_metadata\plugins_ubuntu_linux.json" type="BINDATA" />
12
<include name="IDR_POLICY_CSS" file="resources\policy.css" type="BINDATA"/>
13
Index: src/chrome/browser/plugins/plugin_finder.cc
14
===================================================================
15
--- src/chrome/browser/plugins/plugin_finder.cc (revision 179520)
16
+++ src/chrome/browser/plugins/plugin_finder.cc (working copy)
21
+base::DictionaryValue* LoadPlatformPluginListWithId(int resourceId) {
22
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
23
+ base::StringPiece json_resource(
24
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
26
+ std::string error_str;
27
+ scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
29
+ base::JSON_PARSE_RFC,
33
+ DLOG(ERROR) << error_str;
36
+ if (value->GetType() != base::Value::TYPE_DICTIONARY)
38
+ return static_cast<base::DictionaryValue*>(value.release());
40
+ return new DictionaryValue();
51
+void PluginFinder::MergePlatformSpecifiPlugins (base::DictionaryValue * plugin_list) {
54
+ scoped_ptr<base::DictionaryValue> platform_plugin_list =
55
+ scoped_ptr<base::DictionaryValue>(LoadPlatformPluginList());
56
+ if (platform_plugin_list) {
57
+ plugin_list->MergeDictionary(platform_plugin_list.get());
62
PluginFinder* PluginFinder::GetInstance() {
63
// PluginFinder::GetInstance() is the only method that's allowed to call
64
// Singleton<PluginFinder>::get().
66
void PluginFinder::Init() {
67
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
68
plugin_list_.reset(ComputePluginList());
70
+ MergePlatformSpecifiPlugins(plugin_list_.get());
72
DCHECK(plugin_list_.get());
79
+DictionaryValue* PluginFinder::LoadPlatformPluginList() {
80
+ return LoadPlatformPluginListWithId(IDR_PLATFORM_PLUGIN_DB_JSON);
84
DictionaryValue* PluginFinder::LoadPluginList() {
85
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
86
- base::StringPiece json_resource(
87
- ResourceBundle::GetSharedInstance().GetRawDataResource(
88
- IDR_PLUGIN_DB_JSON));
89
- std::string error_str;
90
- scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
92
- base::JSON_PARSE_RFC,
96
- DLOG(ERROR) << error_str;
99
- if (value->GetType() != base::Value::TYPE_DICTIONARY)
101
- return static_cast<base::DictionaryValue*>(value.release());
103
- return new DictionaryValue();
105
+ return LoadPlatformPluginListWithId(IDR_PLUGIN_DB_JSON);
108
PluginFinder::~PluginFinder() {
110
identifier_plugin_.clear();
112
plugin_list_.reset(json_metadata.DeepCopy());
113
+ MergePlatformSpecifiPlugins(plugin_list_.get());
118
Index: src/chrome/browser/plugins/plugin_finder.h
119
===================================================================
120
--- src/chrome/browser/plugins/plugin_finder.h (revision 179520)
121
+++ src/chrome/browser/plugins/plugin_finder.h (working copy)
123
// Returns NULL if the plug-in list couldn't be parsed.
124
static base::DictionaryValue* LoadPluginList();
126
+ // Loads platform specific whitelisted plugins from the browser
127
+ // resources and parses it.
128
+ // Returns NULL if the plug-in list couldn't be parsed.
129
+ static base::DictionaryValue* LoadPlatformPluginList();
131
+ // Merges the platform specific plugins to the list of plugins
132
+ // passed as parameters.
133
+ static void MergePlatformSpecifiPlugins(base::DictionaryValue * plugin_list);
137
scoped_ptr<base::DictionaryValue> plugin_list_;
138
Index: src/chrome/browser/resources/plugin_metadata/plugins_ubuntu_linux.json
139
===================================================================
140
--- src/chrome/browser/resources/plugin_metadata/plugins_ubuntu_linux.json (revision 0)
141
+++ src/chrome/browser/resources/plugin_metadata/plugins_ubuntu_linux.json (working copy)
144
+ "libunity_npapi_plugin.so": {
146
+ "application/x-unity-webapps-npapi"
151
+ "status": "up_to_date",
152
+ "reference": "https://launchpad.net/unity-chromium-extension/12.10"
156
+ "name": "Unity WebApps plugin",
157
+ "url": "https://launchpad.net/ubuntu/quantal/+source/unity-chromium-extension",
158
+ "group_name_matcher": "Unity WebApps plugin"