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/plugins/plugin_info_message_filter.h" | 5 #include "chrome/browser/plugins/plugin_info_message_filter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 #if defined(ENABLE_EXTENSIONS) | 40 #if defined(ENABLE_EXTENSIONS) |
41 #include "components/guest_view/browser/guest_view_base.h" | 41 #include "components/guest_view/browser/guest_view_base.h" |
42 #include "extensions/browser/extension_registry.h" | 42 #include "extensions/browser/extension_registry.h" |
43 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 43 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
44 #include "extensions/common/constants.h" | 44 #include "extensions/common/constants.h" |
45 #include "extensions/common/extension.h" | 45 #include "extensions/common/extension.h" |
46 #include "extensions/common/manifest_handlers/webview_info.h" | 46 #include "extensions/common/manifest_handlers/webview_info.h" |
47 #endif | 47 #endif |
48 | 48 |
49 #if defined(OS_WIN) | |
50 #include "base/win/metro.h" | |
51 #endif | |
52 | |
53 #if !defined(DISABLE_NACL) | 49 #if !defined(DISABLE_NACL) |
54 #include "components/nacl/common/nacl_constants.h" | 50 #include "components/nacl/common/nacl_constants.h" |
55 #endif | 51 #endif |
56 | 52 |
57 using content::PluginService; | 53 using content::PluginService; |
58 using content::WebPluginInfo; | 54 using content::WebPluginInfo; |
59 | 55 |
60 namespace { | 56 namespace { |
61 | 57 |
62 #if defined(OS_WIN) || defined(OS_MACOSX) | 58 #if defined(OS_WIN) || defined(OS_MACOSX) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 mime_type, is_plugin_disabled ? PLUGIN_DISABLED : PLUGIN_NOT_REGISTERED); | 336 mime_type, is_plugin_disabled ? PLUGIN_DISABLED : PLUGIN_NOT_REGISTERED); |
341 } | 337 } |
342 | 338 |
343 #endif // defined(ENABLE_PEPPER_CDMS) | 339 #endif // defined(ENABLE_PEPPER_CDMS) |
344 | 340 |
345 void PluginInfoMessageFilter::Context::DecidePluginStatus( | 341 void PluginInfoMessageFilter::Context::DecidePluginStatus( |
346 const GetPluginInfo_Params& params, | 342 const GetPluginInfo_Params& params, |
347 const WebPluginInfo& plugin, | 343 const WebPluginInfo& plugin, |
348 const PluginMetadata* plugin_metadata, | 344 const PluginMetadata* plugin_metadata, |
349 ChromeViewHostMsg_GetPluginInfo_Status* status) const { | 345 ChromeViewHostMsg_GetPluginInfo_Status* status) const { |
350 #if defined(OS_WIN) | |
351 if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI && | |
352 base::win::IsMetroProcess()) { | |
353 *status = ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; | |
354 return; | |
355 } | |
356 #endif | |
357 if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) { | 346 if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) { |
358 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 347 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
359 // NPAPI plugins are not supported inside <webview> guests. | 348 // NPAPI plugins are not supported inside <webview> guests. |
360 #if defined(ENABLE_EXTENSIONS) | 349 #if defined(ENABLE_EXTENSIONS) |
361 if (extensions::WebViewRendererState::GetInstance()->IsGuest( | 350 if (extensions::WebViewRendererState::GetInstance()->IsGuest( |
362 render_process_id_)) { | 351 render_process_id_)) { |
363 *status = ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; | 352 *status = ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; |
364 return; | 353 return; |
365 } | 354 } |
366 #endif | 355 #endif |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 status == ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { | 589 status == ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent) { |
601 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( | 590 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( |
602 render_process_id_, path); | 591 render_process_id_, path); |
603 } | 592 } |
604 } | 593 } |
605 | 594 |
606 bool PluginInfoMessageFilter::Context::IsPluginEnabled( | 595 bool PluginInfoMessageFilter::Context::IsPluginEnabled( |
607 const content::WebPluginInfo& plugin) const { | 596 const content::WebPluginInfo& plugin) const { |
608 return plugin_prefs_->IsPluginEnabled(plugin); | 597 return plugin_prefs_->IsPluginEnabled(plugin); |
609 } | 598 } |
OLD | NEW |