~justinmcp/unity-chromium-extension/native-messaging-base

« back to all changes in this revision

Viewing changes to chromium-patches/stable-25.0.1364/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 179520)
4
 
+++ src/chrome/browser/browser_resources.grd    (working copy)
5
 
@@ -168,6 +168,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 179520)
16
 
+++ src/chrome/browser/plugins/plugin_finder.cc (working copy)
17
 
@@ -132,6 +132,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
 
@@ -140,6 +163,17 @@
48
 
 }
49
 
 
50
 
 // static
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
 
   // Singleton<PluginFinder>::get().
65
 
@@ -153,6 +187,9 @@
66
 
 void PluginFinder::Init() {
67
 
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
68
 
   plugin_list_.reset(ComputePluginList());
69
 
+
70
 
+  MergePlatformSpecifiPlugins(plugin_list_.get());
71
 
+
72
 
   DCHECK(plugin_list_.get());
73
 
 
74
 
   InitInternal();
75
 
@@ -173,27 +210,13 @@
76
 
 }
77
 
 
78
 
 // static
79
 
+DictionaryValue* PluginFinder::LoadPlatformPluginList() {
80
 
+  return LoadPlatformPluginListWithId(IDR_PLATFORM_PLUGIN_DB_JSON);
81
 
+}
82
 
+
83
 
+// static
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(
91
 
-      json_resource,
92
 
-      base::JSON_PARSE_RFC,
93
 
-      NULL,
94
 
-      &error_str));
95
 
-  if (!value.get()) {
96
 
-    DLOG(ERROR) << error_str;
97
 
-    return NULL;
98
 
-  }
99
 
-  if (value->GetType() != base::Value::TYPE_DICTIONARY)
100
 
-    return NULL;
101
 
-  return static_cast<base::DictionaryValue*>(value.release());
102
 
-#else
103
 
-  return new DictionaryValue();
104
 
-#endif
105
 
+  return LoadPlatformPluginListWithId(IDR_PLUGIN_DB_JSON);
106
 
 }
107
 
 
108
 
 PluginFinder::~PluginFinder() {
109
 
@@ -256,6 +279,8 @@
110
 
   identifier_plugin_.clear();
111
 
 
112
 
   plugin_list_.reset(json_metadata.DeepCopy());
113
 
+  MergePlatformSpecifiPlugins(plugin_list_.get());
114
 
+
115
 
   InitInternal();
116
 
 }
117
 
 #endif
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)
122
 
@@ -82,6 +82,15 @@
123
 
   // Returns NULL if the plug-in list couldn't be parsed.
124
 
   static base::DictionaryValue* LoadPluginList();
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
 
   void InitInternal();
136
 
 
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)
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
 
+}