OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/pepper_broker_infobar_delegate.h" | 5 #include "chrome/browser/pepper_broker_infobar_delegate.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
10 #include "chrome/browser/infobars/infobar.h" | 10 #include "chrome/browser/infobars/infobar.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 39 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
40 // TODO(wad): Add ephemeral device ID support for broker in guest mode. | 40 // TODO(wad): Add ephemeral device ID support for broker in guest mode. |
41 if (profile->IsGuestSession()) { | 41 if (profile->IsGuestSession()) { |
42 callback.Run(false); | 42 callback.Run(false); |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 TabSpecificContentSettings* tab_content_settings = | 46 TabSpecificContentSettings* tab_content_settings = |
47 TabSpecificContentSettings::FromWebContents(web_contents); | 47 TabSpecificContentSettings::FromWebContents(web_contents); |
48 | 48 |
49 #if defined(OS_CHROMEOS) | |
50 // On ChromeOS, we're ok with granting broker access to the Netflix and | |
51 // Widevine plugins, since they can only come installed with the OS. | |
52 const char kWidevinePluginFileName[] = "libwidevinecdmadapter.so"; | |
53 const char kNetflixDomain[] = "netflix.com"; | |
54 | |
55 base::FilePath plugin_file_name = plugin_path.BaseName(); | |
56 if (plugin_file_name.value() == FILE_PATH_LITERAL(kWidevinePluginFileName) && | |
57 url.DomainIs(kNetflixDomain)) { | |
58 tab_content_settings->SetPepperBrokerAllowed(true); | |
59 callback.Run(true); | |
60 return; | |
61 } | |
62 #endif | |
63 | |
64 #if defined(GOOGLE_TV) | 49 #if defined(GOOGLE_TV) |
65 // On GoogleTV, Netflix crypto/mdx plugin and DRM server adapter plugin can | 50 // On GoogleTV, Netflix crypto/mdx plugin and DRM server adapter plugin can |
66 // only come pre-installed with the OS, so we're willing to auto-grant access | 51 // only come pre-installed with the OS, so we're willing to auto-grant access |
67 // to them. PluginRootName should be matched with PEPPER_PLUGIN_ROOT | 52 // to them. PluginRootName should be matched with PEPPER_PLUGIN_ROOT |
68 // in PepperPluginManager.java. | 53 // in PepperPluginManager.java. |
69 const char kPluginRootName[] = "/system/lib/pepperplugin"; | 54 const char kPluginRootName[] = "/system/lib/pepperplugin"; |
70 const char kNetflixCryptoPluginFileName[] = "libnrddpicrypto.so"; | 55 const char kNetflixCryptoPluginFileName[] = "libnrddpicrypto.so"; |
71 const char kNetflixMdxPluginFileName[] = "libnrdmdx.so"; | 56 const char kNetflixMdxPluginFileName[] = "libnrdmdx.so"; |
72 const char kDrmServerAdapterPluginFileName[] = "libdrmserveradapter.so"; | 57 const char kDrmServerAdapterPluginFileName[] = "libdrmserveradapter.so"; |
73 base::FilePath::StringType plugin_dir_name = plugin_path.DirName().value(); | 58 base::FilePath::StringType plugin_dir_name = plugin_path.DirName().value(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); | 172 content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); |
188 callback_.Run(result); | 173 callback_.Run(result); |
189 callback_ = base::Callback<void(bool)>(); | 174 callback_ = base::Callback<void(bool)>(); |
190 content_settings_->SetContentSetting( | 175 content_settings_->SetContentSetting( |
191 ContentSettingsPattern::FromURLNoWildcard(url_), | 176 ContentSettingsPattern::FromURLNoWildcard(url_), |
192 ContentSettingsPattern::Wildcard(), | 177 ContentSettingsPattern::Wildcard(), |
193 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, | 178 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, |
194 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); | 179 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); |
195 tab_content_settings_->SetPepperBrokerAllowed(result); | 180 tab_content_settings_->SetPepperBrokerAllowed(result); |
196 } | 181 } |
OLD | NEW |