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

Side by Side Diff: webkit/api/src/FrameLoaderClientImpl.cpp

Issue 342104: Eliminate mime_util dependency in FrameLoaderClientImpl.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « webkit/api/public/WebMimeRegistry.h ('k') | webkit/glue/simple_webmimeregistry_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "WebDevToolsAgentPrivate.h" 67 #include "WebDevToolsAgentPrivate.h"
67 #include "WebPluginContainerImpl.h" 68 #include "WebPluginContainerImpl.h"
68 #include "WebPluginLoadObserver.h" 69 #include "WebPluginLoadObserver.h"
69 #include "WindowFeatures.h" 70 #include "WindowFeatures.h"
70 #include "WrappedResourceRequest.h" 71 #include "WrappedResourceRequest.h"
71 #include "WrappedResourceResponse.h" 72 #include "WrappedResourceResponse.h"
72 73
73 // FIXME: remove these
74 #include "net/base/mime_util.h"
75
76 using namespace WebCore; 74 using namespace WebCore;
77 75
78 namespace WebKit { 76 namespace WebKit {
79 77
80 // Domain for internal error codes. 78 // Domain for internal error codes.
81 static const char internalErrorDomain[] = "WebKit"; 79 static const char internalErrorDomain[] = "WebKit";
82 80
83 // An internal error code. Used to note a policy change error resulting from 81 // An internal error code. Used to note a policy change error resulting from
84 // dispatchDecidePolicyForMIMEType not passing the PolicyUse option. 82 // dispatchDecidePolicyForMIMEType not passing the PolicyUse option.
85 enum { 83 enum {
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1113
1116 bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const 1114 bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const
1117 { 1115 {
1118 // This method is called to determine if the media type can be shown 1116 // This method is called to determine if the media type can be shown
1119 // "internally" (i.e. inside the browser) regardless of whether or not the 1117 // "internally" (i.e. inside the browser) regardless of whether or not the
1120 // browser or a plugin is doing the rendering. 1118 // browser or a plugin is doing the rendering.
1121 1119
1122 // mimeType strings are supposed to be ASCII, but if they are not for some 1120 // mimeType strings are supposed to be ASCII, but if they are not for some
1123 // reason, then it just means that the mime type will fail all of these "is 1121 // reason, then it just means that the mime type will fail all of these "is
1124 // supported" checks and go down the path of an unhandled mime type. 1122 // supported" checks and go down the path of an unhandled mime type.
1125 if (net::IsSupportedMimeType(mimeType.latin1().data())) 1123 if (webKitClient()->mimeRegistry()->supportsMIMEType(mimeType) == WebMimeRegistry::IsSupported)
1126 return true; 1124 return true;
1127 1125
1128 // If Chrome is started with the --disable-plugins switch, pluginData is null. 1126 // If Chrome is started with the --disable-plugins switch, pluginData is null.
1129 PluginData* pluginData = m_webFrame->frame()->page()->pluginData(); 1127 PluginData* pluginData = m_webFrame->frame()->page()->pluginData();
1130 1128
1131 // See if the type is handled by an installed plugin, if so, we can show it. 1129 // See if the type is handled by an installed plugin, if so, we can show it.
1132 // FIXME: (http://b/1085524) This is the place to stick a preference to 1130 // FIXME: (http://b/1085524) This is the place to stick a preference to
1133 // disable full page plugins (optionally for certain types!) 1131 // disable full page plugins (optionally for certain types!)
1134 return !mimeType.isEmpty() && pluginData && pluginData->supportsMimeType(mimeType); 1132 return !mimeType.isEmpty() && pluginData && pluginData->supportsMimeType(mimeType);
1135 } 1133 }
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 } 1395 }
1398 1396
1399 PassOwnPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadObserver() 1397 PassOwnPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadObserver()
1400 { 1398 {
1401 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( 1399 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(
1402 m_webFrame->frame()->loader()->activeDocumentLoader()); 1400 m_webFrame->frame()->loader()->activeDocumentLoader());
1403 return ds->releasePluginLoadObserver(); 1401 return ds->releasePluginLoadObserver();
1404 } 1402 }
1405 1403
1406 } // namespace WebKit 1404 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/api/public/WebMimeRegistry.h ('k') | webkit/glue/simple_webmimeregistry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698