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

Side by Side Diff: chrome/common/plugin_utils.cc

Issue 2356053002: [HBD] Only use Plugin Content Settings for Flash. (Closed)
Patch Set: fix prerender tests Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/plugin_utils.h" 5 #include "chrome/common/plugin_utils.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/common/content_constants.h"
8 #include "content/public/common/webplugininfo.h" 9 #include "content/public/common/webplugininfo.h"
9 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 10 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
10 11
11 #if !defined(DISABLE_NACL) 12 #if !defined(DISABLE_NACL)
12 #include "components/nacl/common/nacl_constants.h" 13 #include "components/nacl/common/nacl_constants.h"
13 #endif 14 #endif
14 15
15 bool ShouldUseJavaScriptSettingForPlugin(const content::WebPluginInfo& plugin) { 16 bool ShouldUseJavaScriptSettingForPlugin(const content::WebPluginInfo& plugin) {
16 if (plugin.type != content::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS && 17 if (plugin.name == base::ASCIIToUTF16(content::kFlashPluginName) &&
17 plugin.type != 18 plugin.type ==
18 content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) { 19 content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) {
xhwang 2016/09/26 23:44:51 how about in-process pepper, or it doesn't exist?
raymes 2016/09/27 01:31:18 There is no in-process flash. We want to make sure
tommycli 2016/09/27 18:51:07 Actually since it seems that PLUGINS is a stricter
19 return false; 20 return false;
20 } 21 }
21 22
xhwang 2016/09/26 23:44:51 Can we just return true here and remove all the co
tommycli 2016/09/27 18:51:07 Done.
22 #if !defined(DISABLE_NACL) 23 #if !defined(DISABLE_NACL)
23 // Treat Native Client invocations like JavaScript. 24 // Treat Native Client invocations like JavaScript.
24 if (plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName)) 25 if (plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName))
25 return true; 26 return true;
26 #endif 27 #endif
27 28
28 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) 29 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
29 // Treat CDM invocations like JavaScript. 30 // Treat CDM invocations like JavaScript.
30 if (plugin.name == base::ASCIIToUTF16(kWidevineCdmDisplayName)) { 31 if (plugin.name == base::ASCIIToUTF16(kWidevineCdmDisplayName)) {
31 DCHECK_EQ(content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS, 32 DCHECK_EQ(content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS,
32 plugin.type); 33 plugin.type);
33 return true; 34 return true;
34 } 35 }
35 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) 36 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
36 37
37 return false; 38 // Since all the UI surfaces for Plugin content settings display "Flash",
39 // treat all other plugins (loaded only via command-line), as JavaScript.
xhwang 2016/09/26 23:44:51 Do you mean "all other plugins that are loaded via
tommycli 2016/09/27 18:51:07 Done.
40 return true;
38 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698