Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / webkit / plugins / ppapi / mock_plugin_delegate.cc
blob07c963e61f6004db1ed88a77269e4d78b9017ca3
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
3 // found in the LICENSE file.
5 #include "webkit/plugins/ppapi/mock_plugin_delegate.h"
7 #include "base/logging.h"
8 #include "base/message_loop_proxy.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/shared_impl/ppapi_preferences.h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h"
12 #include "webkit/plugins/ppapi/mock_platform_image_2d.h"
13 #include "webkit/plugins/ppapi/plugin_delegate.h"
14 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
16 namespace webkit {
17 namespace ppapi {
19 MockPluginDelegate::MockPluginDelegate() {
22 MockPluginDelegate::~MockPluginDelegate() {
25 void MockPluginDelegate::PluginFocusChanged(PluginInstance* instance,
26 bool focused) {
29 void MockPluginDelegate::PluginTextInputTypeChanged(PluginInstance* instance) {
32 void MockPluginDelegate::PluginCaretPositionChanged(PluginInstance* instance) {
35 void MockPluginDelegate::PluginRequestedCancelComposition(
36 PluginInstance* instance) {
39 void MockPluginDelegate::PluginSelectionChanged(PluginInstance* instance) {
42 void MockPluginDelegate::SimulateImeSetComposition(
43 const base::string16& text,
44 const std::vector<WebKit::WebCompositionUnderline>& underlines,
45 int selection_start,
46 int selection_end) {
49 void MockPluginDelegate::SimulateImeConfirmComposition(
50 const base::string16& text) {
53 void MockPluginDelegate::PluginCrashed(PluginInstance* instance) {
56 void MockPluginDelegate::InstanceCreated(PluginInstance* instance) {
59 void MockPluginDelegate::InstanceDeleted(PluginInstance* instance) {
62 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
63 MockPluginDelegate::CreateResourceCreationAPI(PluginInstance* instance) {
64 return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>();
67 SkBitmap* MockPluginDelegate::GetSadPluginBitmap() {
68 return NULL;
71 WebKit::WebPlugin* MockPluginDelegate::CreatePluginReplacement(
72 const base::FilePath& file_path) {
73 return NULL;
76 MockPluginDelegate::PlatformImage2D* MockPluginDelegate::CreateImage2D(
77 int width,
78 int height) {
79 return new MockPlatformImage2D(width, height);
82 PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D(
83 PluginInstance* instance,
84 PP_Resource graphics_2d) {
85 return NULL;
88 MockPluginDelegate::PlatformContext3D* MockPluginDelegate::CreateContext3D() {
89 return NULL;
91 void MockPluginDelegate::ReparentContext(
92 MockPluginDelegate::PlatformContext3D* context) {
95 MockPluginDelegate::PlatformVideoDecoder*
96 MockPluginDelegate::CreateVideoDecoder(
97 media::VideoDecodeAccelerator::Client* client,
98 int32 command_buffer_route_id) {
99 return NULL;
102 MockPluginDelegate::PlatformVideoCapture*
103 MockPluginDelegate::CreateVideoCapture(
104 const std::string& device_id,
105 PlatformVideoCaptureEventHandler* handler){
106 return NULL;
109 uint32_t MockPluginDelegate::GetAudioHardwareOutputSampleRate() {
110 return 0;
113 uint32_t MockPluginDelegate::GetAudioHardwareOutputBufferSize() {
114 return 0;
117 MockPluginDelegate::PlatformAudioOutput* MockPluginDelegate::CreateAudioOutput(
118 uint32_t sample_rate,
119 uint32_t sample_count,
120 PlatformAudioOutputClient* client) {
121 return NULL;
124 MockPluginDelegate::PlatformAudioInput* MockPluginDelegate::CreateAudioInput(
125 const std::string& device_id,
126 uint32_t sample_rate,
127 uint32_t sample_count,
128 PlatformAudioInputClient* client) {
129 return NULL;
132 MockPluginDelegate::Broker* MockPluginDelegate::ConnectToBroker(
133 PPB_Broker_Impl* client) {
134 return NULL;
137 void MockPluginDelegate::NumberOfFindResultsChanged(int identifier,
138 int total,
139 bool final_result) {
142 void MockPluginDelegate::SelectedFindResultChanged(int identifier, int index) {
145 bool MockPluginDelegate::AsyncOpenFile(const base::FilePath& path,
146 int flags,
147 const AsyncOpenFileCallback& callback) {
148 return false;
151 bool MockPluginDelegate::AsyncOpenFileSystemURL(
152 const GURL& path,
153 int flags,
154 const AsyncOpenFileSystemURLCallback& callback) {
155 return false;
158 bool MockPluginDelegate::OpenFileSystem(
159 const GURL& origin_url,
160 fileapi::FileSystemType type,
161 long long size,
162 fileapi::FileSystemCallbackDispatcher* dispatcher) {
163 return false;
166 bool MockPluginDelegate::MakeDirectory(
167 const GURL& path,
168 bool recursive,
169 fileapi::FileSystemCallbackDispatcher* dispatcher) {
170 return false;
173 bool MockPluginDelegate::Query(
174 const GURL& path,
175 fileapi::FileSystemCallbackDispatcher* dispatcher) {
176 return false;
179 bool MockPluginDelegate::Touch(
180 const GURL& path,
181 const base::Time& last_access_time,
182 const base::Time& last_modified_time,
183 fileapi::FileSystemCallbackDispatcher* dispatcher) {
184 return false;
187 bool MockPluginDelegate::SetLength(
188 const GURL& path,
189 int64_t length,
190 fileapi::FileSystemCallbackDispatcher* dispatcher) {
191 return false;
194 bool MockPluginDelegate::Delete(
195 const GURL& path,
196 fileapi::FileSystemCallbackDispatcher* dispatcher) {
197 return false;
200 bool MockPluginDelegate::Rename(
201 const GURL& file_path,
202 const GURL& new_file_path,
203 fileapi::FileSystemCallbackDispatcher* dispatcher) {
204 return false;
207 bool MockPluginDelegate::ReadDirectory(
208 const GURL& directory_path,
209 fileapi::FileSystemCallbackDispatcher* dispatcher) {
210 return false;
213 void MockPluginDelegate::QueryAvailableSpace(
214 const GURL& origin, quota::StorageType type,
215 const AvailableSpaceCallback& callback) {
218 void MockPluginDelegate::WillUpdateFile(const GURL& file_path) {
221 void MockPluginDelegate::DidUpdateFile(const GURL& file_path, int64_t delta) {
224 void MockPluginDelegate::SyncGetFileSystemPlatformPath(
225 const GURL& url,
226 base::FilePath* platform_path) {
227 DCHECK(platform_path);
228 *platform_path = base::FilePath();
231 scoped_refptr<base::MessageLoopProxy>
232 MockPluginDelegate::GetFileThreadMessageLoopProxy() {
233 return scoped_refptr<base::MessageLoopProxy>();
236 uint32 MockPluginDelegate::TCPSocketCreate() {
237 return 0;
240 void MockPluginDelegate::TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket,
241 uint32 socket_id,
242 const std::string& host,
243 uint16_t port) {
246 void MockPluginDelegate::TCPSocketConnectWithNetAddress(
247 PPB_TCPSocket_Private_Impl* socket,
248 uint32 socket_id,
249 const PP_NetAddress_Private& addr) {
252 void MockPluginDelegate::TCPSocketSSLHandshake(
253 uint32 socket_id,
254 const std::string& server_name,
255 uint16_t server_port,
256 const std::vector<std::vector<char> >& trusted_certs,
257 const std::vector<std::vector<char> >& untrusted_certs) {
260 void MockPluginDelegate::TCPSocketRead(uint32 socket_id,
261 int32_t bytes_to_read) {
264 void MockPluginDelegate::TCPSocketWrite(uint32 socket_id,
265 const std::string& buffer) {
268 void MockPluginDelegate::TCPSocketSetBoolOption(uint32 socket_id,
269 PP_TCPSocketOption_Private name,
270 bool value) {
273 void MockPluginDelegate::TCPSocketDisconnect(uint32 socket_id) {
276 void MockPluginDelegate::RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket,
277 uint32 socket_id) {
280 void MockPluginDelegate::TCPServerSocketListen(
281 PP_Resource socket_resource,
282 const PP_NetAddress_Private& addr,
283 int32_t backlog) {
286 void MockPluginDelegate::TCPServerSocketAccept(uint32 server_socket_id) {
289 void MockPluginDelegate::TCPServerSocketStopListening(
290 PP_Resource socket_resource,
291 uint32 socket_id) {
294 bool MockPluginDelegate::AddNetworkListObserver(
295 webkit_glue::NetworkListObserver* observer) {
296 return false;
299 void MockPluginDelegate::RemoveNetworkListObserver(
300 webkit_glue::NetworkListObserver* observer) {
303 bool MockPluginDelegate::X509CertificateParseDER(
304 const std::vector<char>& der,
305 ::ppapi::PPB_X509Certificate_Fields* fields) {
306 return false;
309 FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer(
310 PluginInstance* instance) {
311 return NULL;
314 gfx::Size MockPluginDelegate::GetScreenSize() {
315 return gfx::Size(1024, 768);
318 std::string MockPluginDelegate::GetDefaultEncoding() {
319 return "iso-8859-1";
322 void MockPluginDelegate::ZoomLimitsChanged(double minimum_factor,
323 double maximum_factor) {
326 void MockPluginDelegate::DidStartLoading() {
329 void MockPluginDelegate::DidStopLoading() {
332 void MockPluginDelegate::SetContentRestriction(int restrictions) {
335 void MockPluginDelegate::SaveURLAs(const GURL& url) {
338 base::SharedMemory* MockPluginDelegate::CreateAnonymousSharedMemory(
339 size_t size) {
340 return NULL;
343 ::ppapi::Preferences MockPluginDelegate::GetPreferences() {
344 return ::ppapi::Preferences();
347 bool MockPluginDelegate::LockMouse(PluginInstance* instance) {
348 return false;
351 void MockPluginDelegate::UnlockMouse(PluginInstance* instance) {
354 bool MockPluginDelegate::IsMouseLocked(PluginInstance* instance) {
355 return false;
358 void MockPluginDelegate::DidChangeCursor(PluginInstance* instance,
359 const WebKit::WebCursorInfo& cursor) {
362 void MockPluginDelegate::DidReceiveMouseEvent(PluginInstance* instance) {
365 void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) {
366 data->length = 0;
369 bool MockPluginDelegate::IsInFullscreenMode() {
370 return false;
373 bool MockPluginDelegate::IsPageVisible() const {
374 return true;
377 int MockPluginDelegate::EnumerateDevices(
378 PP_DeviceType_Dev type,
379 const EnumerateDevicesCallback& callback) {
380 return -1;
383 void MockPluginDelegate::StopEnumerateDevices(int request_id) {
386 IPC::PlatformFileForTransit MockPluginDelegate::ShareHandleWithRemote(
387 base::PlatformFile handle,
388 base::ProcessId target_process_id,
389 bool should_close_source) const {
390 return IPC::InvalidPlatformFileForTransit();
393 } // namespace ppapi
394 } // namespace webkit