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

Side by Side Diff: webkit/glue/plugins/pepper_plugin_instance.cc

Issue 2842036: Add support for HandleDocumentLoad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months 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/glue/plugins/pepper_plugin_instance.h ('k') | webkit/glue/plugins/pepper_url_loader.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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_instance.h" 5 #include "webkit/glue/plugins/pepper_plugin_instance.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "gfx/rect.h" 9 #include "gfx/rect.h"
10 #include "third_party/ppapi/c/pp_instance.h" 10 #include "third_party/ppapi/c/pp_instance.h"
11 #include "third_party/ppapi/c/pp_event.h" 11 #include "third_party/ppapi/c/pp_event.h"
12 #include "third_party/ppapi/c/pp_rect.h" 12 #include "third_party/ppapi/c/pp_rect.h"
13 #include "third_party/ppapi/c/pp_resource.h" 13 #include "third_party/ppapi/c/pp_resource.h"
14 #include "third_party/ppapi/c/pp_var.h" 14 #include "third_party/ppapi/c/pp_var.h"
15 #include "third_party/ppapi/c/ppb_instance.h" 15 #include "third_party/ppapi/c/ppb_instance.h"
16 #include "third_party/ppapi/c/ppp_instance.h" 16 #include "third_party/ppapi/c/ppp_instance.h"
17 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" 17 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
18 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" 18 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
19 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" 19 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
20 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" 20 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
21 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" 21 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h"
22 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" 22 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
23 #include "webkit/glue/plugins/pepper_device_context_2d.h" 23 #include "webkit/glue/plugins/pepper_device_context_2d.h"
24 #include "webkit/glue/plugins/pepper_plugin_delegate.h" 24 #include "webkit/glue/plugins/pepper_plugin_delegate.h"
25 #include "webkit/glue/plugins/pepper_plugin_module.h" 25 #include "webkit/glue/plugins/pepper_plugin_module.h"
26 #include "webkit/glue/plugins/pepper_url_loader.h"
26 #include "webkit/glue/plugins/pepper_var.h" 27 #include "webkit/glue/plugins/pepper_var.h"
27 28
28 using WebKit::WebFrame; 29 using WebKit::WebFrame;
29 using WebKit::WebInputEvent; 30 using WebKit::WebInputEvent;
30 using WebKit::WebPluginContainer; 31 using WebKit::WebPluginContainer;
31 32
32 namespace pepper { 33 namespace pepper {
33 34
34 namespace { 35 namespace {
35 36
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 for (size_t i = 0; i < arg_names.size(); ++i) { 247 for (size_t i = 0; i < arg_names.size(); ++i) {
247 argn[argc] = arg_names[i].c_str(); 248 argn[argc] = arg_names[i].c_str();
248 argv[argc] = arg_values[i].c_str(); 249 argv[argc] = arg_values[i].c_str();
249 argc++; 250 argc++;
250 } 251 }
251 252
252 return instance_interface_->Initialize(GetPPInstance(), 253 return instance_interface_->Initialize(GetPPInstance(),
253 argc, argn.get(), argv.get()); 254 argc, argn.get(), argv.get());
254 } 255 }
255 256
257 bool PluginInstance::HandleDocumentLoad(URLLoader* loader) {
258 return instance_interface_->HandleDocumentLoad(GetPPInstance(),
259 loader->GetResource());
260 }
261
256 bool PluginInstance::HandleInputEvent(const WebKit::WebInputEvent& event, 262 bool PluginInstance::HandleInputEvent(const WebKit::WebInputEvent& event,
257 WebKit::WebCursorInfo* cursor_info) { 263 WebKit::WebCursorInfo* cursor_info) {
258 PP_Event pp_event; 264 PP_Event pp_event;
259 265
260 pp_event.type = ConvertEventTypes(event.type); 266 pp_event.type = ConvertEventTypes(event.type);
261 pp_event.size = sizeof(pp_event); 267 pp_event.size = sizeof(pp_event);
262 pp_event.time_stamp_seconds = event.timeStampSeconds; 268 pp_event.time_stamp_seconds = event.timeStampSeconds;
263 switch (pp_event.type) { 269 switch (pp_event.type) {
264 case PP_Event_Type_Undefined: 270 case PP_Event_Type_Undefined:
265 return false; 271 return false;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if (device_context_2d_) 318 if (device_context_2d_)
313 device_context_2d_->ViewInitiatedPaint(); 319 device_context_2d_->ViewInitiatedPaint();
314 } 320 }
315 321
316 void PluginInstance::ViewFlushedPaint() { 322 void PluginInstance::ViewFlushedPaint() {
317 if (device_context_2d_) 323 if (device_context_2d_)
318 device_context_2d_->ViewFlushedPaint(); 324 device_context_2d_->ViewFlushedPaint();
319 } 325 }
320 326
321 } // namespace pepper 327 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_instance.h ('k') | webkit/glue/plugins/pepper_url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698