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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 19894003: Move webplugininfo.h to content/public. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 103 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
104 104
105 #if defined(ENABLE_WEBRTC) 105 #if defined(ENABLE_WEBRTC)
106 #include "chrome/renderer/media/webrtc_logging_message_filter.h" 106 #include "chrome/renderer/media/webrtc_logging_message_filter.h"
107 #endif 107 #endif
108 108
109 using autofill::AutofillAgent; 109 using autofill::AutofillAgent;
110 using autofill::PasswordAutofillAgent; 110 using autofill::PasswordAutofillAgent;
111 using autofill::PasswordGenerationManager; 111 using autofill::PasswordGenerationManager;
112 using content::RenderThread; 112 using content::RenderThread;
113 using content::WebPluginInfo;
113 using extensions::Extension; 114 using extensions::Extension;
114 using WebKit::WebCache; 115 using WebKit::WebCache;
115 using WebKit::WebConsoleMessage; 116 using WebKit::WebConsoleMessage;
116 using WebKit::WebDataSource; 117 using WebKit::WebDataSource;
117 using WebKit::WebDocument; 118 using WebKit::WebDocument;
118 using WebKit::WebFrame; 119 using WebKit::WebFrame;
119 using WebKit::WebPlugin; 120 using WebKit::WebPlugin;
120 using webkit::WebPluginInfo;
121 using webkit::WebPluginMimeType;
122 using WebKit::WebPluginParams; 121 using WebKit::WebPluginParams;
123 using WebKit::WebSecurityOrigin; 122 using WebKit::WebSecurityOrigin;
124 using WebKit::WebSecurityPolicy; 123 using WebKit::WebSecurityPolicy;
125 using WebKit::WebString; 124 using WebKit::WebString;
126 using WebKit::WebURL; 125 using WebKit::WebURL;
127 using WebKit::WebURLError; 126 using WebKit::WebURLError;
128 using WebKit::WebURLRequest; 127 using WebKit::WebURLRequest;
129 using WebKit::WebURLResponse; 128 using WebKit::WebURLResponse;
130 using WebKit::WebVector; 129 using WebKit::WebVector;
131 130
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 !frame->parent() && 548 !frame->parent() &&
550 !frame->opener() && 549 !frame->opener() &&
551 frame->document().isPluginDocument()) { 550 frame->document().isPluginDocument()) {
552 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; 551 status_value = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed;
553 } 552 }
554 553
555 #if defined(USE_AURA) && defined(OS_WIN) 554 #if defined(USE_AURA) && defined(OS_WIN)
556 // In Aura for Windows we need to check if we can load NPAPI plugins. 555 // In Aura for Windows we need to check if we can load NPAPI plugins.
557 // For example, if the render view is in the Ash desktop, we should not. 556 // For example, if the render view is in the Ash desktop, we should not.
558 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed && 557 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed &&
559 plugin.type == webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI) { 558 plugin.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) {
560 if (observer->AreNPAPIPluginsBlocked()) 559 if (observer->AreNPAPIPluginsBlocked())
561 status_value = 560 status_value =
562 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; 561 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported;
563 } 562 }
564 #endif 563 #endif
565 564
566 switch (status_value) { 565 switch (status_value) {
567 case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: { 566 case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: {
568 NOTREACHED(); 567 NOTREACHED();
569 break; 568 break;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 734 }
736 placeholder->SetStatus(status); 735 placeholder->SetStatus(status);
737 return placeholder->plugin(); 736 return placeholder->plugin();
738 } 737 }
739 738
740 // For NaCl content handling plugins, the NaCl manifest is stored in an 739 // For NaCl content handling plugins, the NaCl manifest is stored in an
741 // additonal 'nacl' param associated with the MIME type. 740 // additonal 'nacl' param associated with the MIME type.
742 // static 741 // static
743 GURL ChromeContentRendererClient::GetNaClContentHandlerURL( 742 GURL ChromeContentRendererClient::GetNaClContentHandlerURL(
744 const std::string& actual_mime_type, 743 const std::string& actual_mime_type,
745 const WebPluginInfo& plugin) { 744 const content::WebPluginInfo& plugin) {
746 // Look for the manifest URL among the MIME type's additonal parameters. 745 // Look for the manifest URL among the MIME type's additonal parameters.
747 const char* kNaClPluginManifestAttribute = "nacl"; 746 const char* kNaClPluginManifestAttribute = "nacl";
748 string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute); 747 string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute);
749 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { 748 for (size_t i = 0; i < plugin.mime_types.size(); ++i) {
750 if (plugin.mime_types[i].mime_type == actual_mime_type) { 749 if (plugin.mime_types[i].mime_type == actual_mime_type) {
751 const WebPluginMimeType& content_type = plugin.mime_types[i]; 750 const content::WebPluginMimeType& content_type = plugin.mime_types[i];
752 for (size_t i = 0; i < content_type.additional_param_names.size(); ++i) { 751 for (size_t i = 0; i < content_type.additional_param_names.size(); ++i) {
753 if (content_type.additional_param_names[i] == nacl_attr) 752 if (content_type.additional_param_names[i] == nacl_attr)
754 return GURL(content_type.additional_param_values[i]); 753 return GURL(content_type.additional_param_values[i]);
755 } 754 }
756 break; 755 break;
757 } 756 }
758 } 757 }
759 return GURL(); 758 return GURL();
760 } 759 }
761 760
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 if (CommandLine::ForCurrentProcess()->HasSwitch( 1275 if (CommandLine::ForCurrentProcess()->HasSwitch(
1277 switches::kEnablePepperTesting)) { 1276 switches::kEnablePepperTesting)) {
1278 return true; 1277 return true;
1279 } 1278 }
1280 #endif // !defined(OS_ANDROID) 1279 #endif // !defined(OS_ANDROID)
1281 return false; 1280 return false;
1282 } 1281 }
1283 1282
1284 1283
1285 } // namespace chrome 1284 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698