Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 
| 3 * | 3 * | 
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without | 
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are | 
| 6 * met: | 6 * met: | 
| 7 * | 7 * | 
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright | 
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. | 
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #include "MouseEvent.h" | 46 #include "MouseEvent.h" | 
| 47 #include "Page.h" | 47 #include "Page.h" | 
| 48 #include "PlatformString.h" | 48 #include "PlatformString.h" | 
| 49 #include "PluginData.h" | 49 #include "PluginData.h" | 
| 50 #include "StringExtras.h" | 50 #include "StringExtras.h" | 
| 51 #include "WebForm.h" | 51 #include "WebForm.h" | 
| 52 #include "WebFrameClient.h" | 52 #include "WebFrameClient.h" | 
| 53 #include "WebFrameImpl.h" | 53 #include "WebFrameImpl.h" | 
| 54 #include "WebKit.h" | 54 #include "WebKit.h" | 
| 55 #include "WebKitClient.h" | 55 #include "WebKitClient.h" | 
| 56 #include "WebMimeRegistry.h" | |
| 56 #include "WebNode.h" | 57 #include "WebNode.h" | 
| 57 #include "WebPlugin.h" | 58 #include "WebPlugin.h" | 
| 58 #include "WebPluginParams.h" | 59 #include "WebPluginParams.h" | 
| 59 #include "WebSecurityOrigin.h" | 60 #include "WebSecurityOrigin.h" | 
| 60 #include "WebURL.h" | 61 #include "WebURL.h" | 
| 61 #include "WebURLError.h" | 62 #include "WebURLError.h" | 
| 62 #include "WebVector.h" | 63 #include "WebVector.h" | 
| 63 #include "WebViewClient.h" | 64 #include "WebViewClient.h" | 
| 64 #include "WebViewImpl.h" | 65 #include "WebViewImpl.h" | 
| 65 #include "WebDataSourceImpl.h" | 66 #include "WebDataSourceImpl.h" | 
| 66 #include "WebPluginContainerImpl.h" | 67 #include "WebPluginContainerImpl.h" | 
| 67 #include "WebPluginLoadObserver.h" | 68 #include "WebPluginLoadObserver.h" | 
| 68 #include "WindowFeatures.h" | 69 #include "WindowFeatures.h" | 
| 69 #include "WrappedResourceRequest.h" | 70 #include "WrappedResourceRequest.h" | 
| 70 #include "WrappedResourceResponse.h" | 71 #include "WrappedResourceResponse.h" | 
| 71 | 72 | 
| 72 // FIXME: remove these | 73 // FIXME: remove these | 
| 73 #include "net/base/mime_util.h" | |
| 74 #include "webkit/glue/webdevtoolsagent_impl.h" | 74 #include "webkit/glue/webdevtoolsagent_impl.h" | 
| 75 | 75 | 
| 76 using namespace WebCore; | 76 using namespace WebCore; | 
| 77 | 77 | 
| 78 namespace WebKit { | 78 namespace WebKit { | 
| 79 | 79 | 
| 80 // Domain for internal error codes. | 80 // Domain for internal error codes. | 
| 81 static const char internalErrorDomain[] = "WebKit"; | 81 static const char internalErrorDomain[] = "WebKit"; | 
| 82 | 82 | 
| 83 // An internal error code. Used to note a policy change error resulting from | 83 // An internal error code. Used to note a policy change error resulting from | 
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1111 | 1111 | 
| 1112 bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const | 1112 bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const | 
| 1113 { | 1113 { | 
| 1114 // This method is called to determine if the media type can be shown | 1114 // This method is called to determine if the media type can be shown | 
| 1115 // "internally" (i.e. inside the browser) regardless of whether or not the | 1115 // "internally" (i.e. inside the browser) regardless of whether or not the | 
| 1116 // browser or a plugin is doing the rendering. | 1116 // browser or a plugin is doing the rendering. | 
| 1117 | 1117 | 
| 1118 // mimeType strings are supposed to be ASCII, but if they are not for some | 1118 // mimeType strings are supposed to be ASCII, but if they are not for some | 
| 1119 // reason, then it just means that the mime type will fail all of these "is | 1119 // reason, then it just means that the mime type will fail all of these "is | 
| 1120 // supported" checks and go down the path of an unhandled mime type. | 1120 // supported" checks and go down the path of an unhandled mime type. | 
| 1121 if (net::IsSupportedMimeType(mimeType.latin1().data())) | 1121 if (WebKit::webKitClient()->mimeRegistry()->supportsMIMEType(mimeType) == | 
| 
 
darin (slow to review)
2009/10/31 22:35:49
feel free to not line wrap here since webkit style
 
 | |
| 1122 WebMimeRegistry::IsSupported) | |
| 1122 return true; | 1123 return true; | 
| 1123 | 1124 | 
| 1124 // If Chrome is started with the --disable-plugins switch, pluginData is null. | 1125 // If Chrome is started with the --disable-plugins switch, pluginData is null. | 
| 1125 PluginData* pluginData = m_webFrame->frame()->page()->pluginData(); | 1126 PluginData* pluginData = m_webFrame->frame()->page()->pluginData(); | 
| 1126 | 1127 | 
| 1127 // See if the type is handled by an installed plugin, if so, we can show it. | 1128 // See if the type is handled by an installed plugin, if so, we can show it. | 
| 1128 // FIXME: (http://b/1085524) This is the place to stick a preference to | 1129 // FIXME: (http://b/1085524) This is the place to stick a preference to | 
| 1129 // disable full page plugins (optionally for certain types!) | 1130 // disable full page plugins (optionally for certain types!) | 
| 1130 return !mimeType.isEmpty() && pluginData && pluginData->supportsMimeType(mimeType); | 1131 return !mimeType.isEmpty() && pluginData && pluginData->supportsMimeType(mimeType); | 
| 1131 } | 1132 } | 
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1393 } | 1394 } | 
| 1394 | 1395 | 
| 1395 PassOwnPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadObserver() | 1396 PassOwnPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadObserver() | 
| 1396 { | 1397 { | 
| 1397 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( | 1398 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( | 
| 1398 m_webFrame->frame()->loader()->activeDocumentLoader()); | 1399 m_webFrame->frame()->loader()->activeDocumentLoader()); | 
| 1399 return ds->releasePluginLoadObserver(); | 1400 return ds->releasePluginLoadObserver(); | 
| 1400 } | 1401 } | 
| 1401 | 1402 | 
| 1402 } // namespace WebKit | 1403 } // namespace WebKit | 
| OLD | NEW |