| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 void GetPlugins(bool refresh, | 152 void GetPlugins(bool refresh, |
| 153 std::vector<webkit::WebPluginInfo>* plugins) { | 153 std::vector<webkit::WebPluginInfo>* plugins) { |
| 154 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) | 154 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) |
| 155 refresh = false; | 155 refresh = false; |
| 156 RenderThreadImpl::current()->Send( | 156 RenderThreadImpl::current()->Send( |
| 157 new ViewHostMsg_GetPlugins(refresh, plugins)); | 157 new ViewHostMsg_GetPlugins(refresh, plugins)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool IsProtocolSupportedForMedia(const GURL& url) { | |
| 161 // If new protocol is to be added here, we need to make sure the response is | |
| 162 // validated accordingly in the media engine. | |
| 163 if (url.SchemeIsFile() || url.SchemeIs(chrome::kHttpScheme) || | |
| 164 url.SchemeIs(chrome::kHttpsScheme) || | |
| 165 url.SchemeIs(chrome::kDataScheme) || | |
| 166 url.SchemeIs(chrome::kFileSystemScheme) || | |
| 167 url.SchemeIs(chrome::kBlobScheme)) | |
| 168 return true; | |
| 169 return | |
| 170 content::GetContentClient()->renderer()->IsProtocolSupportedForMedia(url); | |
| 171 } | |
| 172 | |
| 173 // static factory function | 160 // static factory function |
| 174 ResourceLoaderBridge* ResourceLoaderBridge::Create( | 161 ResourceLoaderBridge* ResourceLoaderBridge::Create( |
| 175 const ResourceLoaderBridge::RequestInfo& request_info) { | 162 const ResourceLoaderBridge::RequestInfo& request_info) { |
| 176 return ChildThread::current()->CreateBridge(request_info); | 163 return ChildThread::current()->CreateBridge(request_info); |
| 177 } | 164 } |
| 178 | 165 |
| 179 // static factory function | 166 // static factory function |
| 180 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( | 167 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( |
| 181 WebKit::WebSocketStreamHandle* handle, | 168 WebKit::WebSocketStreamHandle* handle, |
| 182 WebSocketStreamHandleDelegate* delegate) { | 169 WebSocketStreamHandleDelegate* delegate) { |
| 183 SocketStreamDispatcher* dispatcher = | 170 SocketStreamDispatcher* dispatcher = |
| 184 ChildThread::current()->socket_stream_dispatcher(); | 171 ChildThread::current()->socket_stream_dispatcher(); |
| 185 return dispatcher->CreateBridge(handle, delegate); | 172 return dispatcher->CreateBridge(handle, delegate); |
| 186 } | 173 } |
| 187 | 174 |
| 188 string16 GetLocalizedString(int message_id) { | 175 string16 GetLocalizedString(int message_id) { |
| 189 return content::GetContentClient()->GetLocalizedString(message_id); | 176 return content::GetContentClient()->GetLocalizedString(message_id); |
| 190 } | 177 } |
| 191 | 178 |
| 192 base::StringPiece GetDataResource(int resource_id) { | 179 base::StringPiece GetDataResource(int resource_id) { |
| 193 return content::GetContentClient()->GetDataResource(resource_id); | 180 return content::GetContentClient()->GetDataResource(resource_id); |
| 194 } | 181 } |
| 195 | 182 |
| 196 } // namespace webkit_glue | 183 } // namespace webkit_glue |
| OLD | NEW |