Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1239 if (net::IsSupportedMimeType( | 1239 if (net::IsSupportedMimeType( |
| 1240 webkit_glue::CStringToStdString(mime_type.latin1()))) | 1240 webkit_glue::CStringToStdString(mime_type.latin1()))) |
| 1241 return true; | 1241 return true; |
| 1242 | 1242 |
| 1243 // If Chrome is started with the --disable-plugins switch, pluginData is null. | 1243 // If Chrome is started with the --disable-plugins switch, pluginData is null. |
| 1244 WebCore::PluginData* plugin_data = webframe_->frame()->page()->pluginData(); | 1244 WebCore::PluginData* plugin_data = webframe_->frame()->page()->pluginData(); |
| 1245 | 1245 |
| 1246 // See if the type is handled by an installed plugin, if so, we can show it. | 1246 // See if the type is handled by an installed plugin, if so, we can show it. |
| 1247 // TODO(beng): (http://b/1085524) This is the place to stick a preference to | 1247 // TODO(beng): (http://b/1085524) This is the place to stick a preference to |
| 1248 // disable full page plugins (optionally for certain types!) | 1248 // disable full page plugins (optionally for certain types!) |
| 1249 return plugin_data && plugin_data->supportsMimeType(mime_type); | 1249 return !mime_type.isEmpty() && plugin_data && plugin_data->supportsMimeType(mi me_type); |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLSch eme) const { | 1252 bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLSch eme) const { |
| 1253 // FIXME | 1253 // FIXME |
| 1254 return false; | 1254 return false; |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche me) const { | 1257 String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche me) const { |
| 1258 // This appears to generate MIME types for protocol handlers that are handled | 1258 // This appears to generate MIME types for protocol handlers that are handled |
| 1259 // internally. The only place I can find in the WebKit code that uses this | 1259 // internally. The only place I can find in the WebKit code that uses this |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 | 1533 |
| 1534 if (mime_type.isEmpty()) | 1534 if (mime_type.isEmpty()) |
| 1535 return ObjectContentFrame; | 1535 return ObjectContentFrame; |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 if (MIMETypeRegistry::isSupportedImageMIMEType(mime_type)) | 1538 if (MIMETypeRegistry::isSupportedImageMIMEType(mime_type)) |
| 1539 return ObjectContentImage; | 1539 return ObjectContentImage; |
| 1540 | 1540 |
| 1541 // If Chrome is started with the --disable-plugins switch, pluginData is null. | 1541 // If Chrome is started with the --disable-plugins switch, pluginData is null. |
| 1542 PluginData* plugin_data = webframe_->frame()->page()->pluginData(); | 1542 PluginData* plugin_data = webframe_->frame()->page()->pluginData(); |
| 1543 if (plugin_data && plugin_data->supportsMimeType(mime_type)) | 1543 if (!mime_type.isEmpty() && plugin_data && plugin_data->supportsMimeType(mime_ type)) |
|
jam
2009/04/02 20:31:34
I believe this one isn't needed because of line 15
Pam (message me for reviews)
2009/04/02 20:34:07
Right. Removed.
| |
| 1544 return ObjectContentNetscapePlugin; | 1544 return ObjectContentNetscapePlugin; |
| 1545 | 1545 |
| 1546 if (MIMETypeRegistry::isSupportedNonImageMIMEType(mime_type)) | 1546 if (MIMETypeRegistry::isSupportedNonImageMIMEType(mime_type)) |
| 1547 return ObjectContentFrame; | 1547 return ObjectContentFrame; |
| 1548 | 1548 |
| 1549 return ObjectContentNone; | 1549 return ObjectContentNone; |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 String WebFrameLoaderClient::overrideMediaType() const { | 1552 String WebFrameLoaderClient::overrideMediaType() const { |
| 1553 // FIXME | 1553 // FIXME |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 1582 if (!web_view) { | 1582 if (!web_view) { |
| 1583 return NULL; | 1583 return NULL; |
| 1584 } | 1584 } |
| 1585 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); | 1585 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); |
| 1586 if (tools_agent) { | 1586 if (tools_agent) { |
| 1587 return tools_agent->net_agent_impl(); | 1587 return tools_agent->net_agent_impl(); |
| 1588 } else { | 1588 } else { |
| 1589 return NULL; | 1589 return NULL; |
| 1590 } | 1590 } |
| 1591 } | 1591 } |
| OLD | NEW |