~ps-jenkins/unity-chromium-extension/trusty-proposed

« back to all changes in this revision

Viewing changes to chromium-patches/stable-28.0.1500.45/7-npapi-permission-not-defaults-to-unauthorized.patch

  • Committer: CI bot
  • Author(s): Justin McPherson
  • Date: 2014-02-17 23:43:23 UTC
  • mfrom: (239.2.1 remove-patches)
  • Revision ID: ps-jenkins@lists.canonical.com-20140217234323-4pw656wfrooeinde
Chromium patches are no longer maintained in this repo, remove them to avoid confusion. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: src/chrome/browser/browser_resources.grd
2
 
===================================================================
3
 
--- src/chrome/browser/browser_resources.grd    (revision 205727)
4
 
+++ src/chrome/browser/browser_resources.grd    (working copy)
5
 
@@ -200,6 +200,7 @@
6
 
         </if>
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" />
10
 
         </if>
11
 
       </if>
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 205727)
16
 
+++ src/chrome/browser/plugins/plugin_finder.cc (working copy)
17
 
@@ -134,6 +134,29 @@
18
 
   return plugin;
19
 
 }
20
 
 
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(
25
 
+          resourceId));
26
 
+  std::string error_str;
27
 
+  scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
28
 
+      json_resource,
29
 
+      base::JSON_PARSE_RFC,
30
 
+      NULL,
31
 
+      &error_str));
32
 
+  if (!value.get()) {
33
 
+    DLOG(ERROR) << error_str;
34
 
+    return NULL;
35
 
+  }
36
 
+  if (value->GetType() != base::Value::TYPE_DICTIONARY)
37
 
+    return NULL;
38
 
+  return static_cast<base::DictionaryValue*>(value.release());
39
 
+#else
40
 
+  return new DictionaryValue();
41
 
+#endif
42
 
+}
43
 
+
44
 
 }  // namespace
45
 
 
46
 
 // static
47
 
@@ -141,6 +164,16 @@
48
 
   registry->RegisterBooleanPref(prefs::kDisablePluginFinder, false);
49
 
 }
50
 
 
51
 
+void PluginFinder::MergePlatformSpecifiPlugins (base::DictionaryValue * plugin_list) {
52
 
+  if (!plugin_list)
53
 
+    return;
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());
58
 
+  }
59
 
+}
60
 
+
61
 
 // static
62
 
 PluginFinder* PluginFinder::GetInstance() {
63
 
   // PluginFinder::GetInstance() is the only method that's allowed to call
64
 
@@ -162,23 +195,13 @@
65
 
 }
66
 
 
67
 
 // static
68
 
+DictionaryValue* PluginFinder::LoadPlatformPluginList() {
69
 
+  return LoadPlatformPluginListWithId(IDR_PLATFORM_PLUGIN_DB_JSON);
70
 
+}
71
 
+
72
 
+// static
73
 
 DictionaryValue* PluginFinder::LoadBuiltInPluginList() {
74
 
-  base::StringPiece json_resource(
75
 
-      ResourceBundle::GetSharedInstance().GetRawDataResource(
76
 
-          IDR_PLUGIN_DB_JSON));
77
 
-  std::string error_str;
78
 
-  scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
79
 
-      json_resource,
80
 
-      base::JSON_PARSE_RFC,
81
 
-      NULL,
82
 
-      &error_str));
83
 
-  if (!value.get()) {
84
 
-    DLOG(ERROR) << error_str;
85
 
-    return NULL;
86
 
-  }
87
 
-  if (value->GetType() != base::Value::TYPE_DICTIONARY)
88
 
-    return NULL;
89
 
-  return static_cast<base::DictionaryValue*>(value.release());
90
 
+  return LoadPlatformPluginListWithId(IDR_PLUGIN_DB_JSON);
91
 
 }
92
 
 
93
 
 PluginFinder::~PluginFinder() {
94
 
@@ -244,16 +267,21 @@
95
 
   if (version <= version_)
96
 
     return;
97
 
 
98
 
+  // Load the platform specific plugins (if any)
99
 
+  scoped_ptr<DictionaryValue> final_plugin_list(plugin_list->DeepCopy());
100
 
+  MergePlatformSpecifiPlugins(final_plugin_list.get());
101
 
+
102
 
   version_ = version;
103
 
 
104
 
   STLDeleteValues(&identifier_plugin_);
105
 
   identifier_plugin_.clear();
106
 
 
107
 
-  for (DictionaryValue::Iterator plugin_it(*plugin_list);
108
 
+  for (DictionaryValue::Iterator plugin_it(*final_plugin_list);
109
 
       !plugin_it.IsAtEnd(); plugin_it.Advance()) {
110
 
     const DictionaryValue* plugin = NULL;
111
 
     const std::string& identifier = plugin_it.key();
112
 
-    if (plugin_list->GetDictionaryWithoutPathExpansion(identifier, &plugin)) {
113
 
+    if (final_plugin_list->GetDictionaryWithoutPathExpansion(
114
 
+          identifier, &plugin)) {
115
 
       DCHECK(!identifier_plugin_[identifier]);
116
 
       identifier_plugin_[identifier] = CreatePluginMetadata(identifier, plugin);
117
 
 
118
 
Index: src/chrome/browser/plugins/plugin_finder.h
119
 
===================================================================
120
 
--- src/chrome/browser/plugins/plugin_finder.h  (revision 205727)
121
 
+++ src/chrome/browser/plugins/plugin_finder.h  (working copy)
122
 
@@ -80,6 +80,15 @@
123
 
   // Returns NULL if the plug-in list couldn't be parsed.
124
 
   static base::DictionaryValue* LoadBuiltInPluginList();
125
 
 
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();
130
 
+
131
 
+  // Merges the platform specific plugins to the list of plugins
132
 
+  // passed as parameters.
133
 
+  static void MergePlatformSpecifiPlugins(base::DictionaryValue * plugin_list);
134
 
+
135
 
 #if defined(ENABLE_PLUGIN_INSTALLATION)
136
 
   std::map<std::string, PluginInstaller*> installers_;
137
 
 #endif
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)
142
 
@@ -0,0 +1,18 @@
143
 
+{
144
 
+  "libunity_npapi_plugin.so": {
145
 
+    "mime_types": [
146
 
+      "application/x-unity-webapps-npapi"
147
 
+    ],
148
 
+    "versions": [
149
 
+      {
150
 
+        "version": "0",
151
 
+        "status": "up_to_date",
152
 
+        "reference": "https://launchpad.net/unity-chromium-extension/12.10"
153
 
+      }
154
 
+    ],
155
 
+    "lang": "en-US",
156
 
+    "name": "Unity WebApps plugin",
157
 
+    "url": "https://launchpad.net/ubuntu/quantal/+source/unity-chromium-extension",
158
 
+    "group_name_matcher": "Unity WebApps plugin"
159
 
+  }
160
 
+}