OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 : public base::RefCounted<PepperPluginInstanceImpl>, | 118 : public base::RefCounted<PepperPluginInstanceImpl>, |
119 public NON_EXPORTED_BASE(PepperPluginInstance), | 119 public NON_EXPORTED_BASE(PepperPluginInstance), |
120 public ppapi::PPB_Instance_Shared, | 120 public ppapi::PPB_Instance_Shared, |
121 public NON_EXPORTED_BASE(cc::TextureLayerClient), | 121 public NON_EXPORTED_BASE(cc::TextureLayerClient), |
122 public RenderFrameObserver { | 122 public RenderFrameObserver { |
123 public: | 123 public: |
124 // Create and return a PepperPluginInstanceImpl object which supports the most | 124 // Create and return a PepperPluginInstanceImpl object which supports the most |
125 // recent version of PPP_Instance possible by querying the given | 125 // recent version of PPP_Instance possible by querying the given |
126 // get_plugin_interface function. If the plugin does not support any valid | 126 // get_plugin_interface function. If the plugin does not support any valid |
127 // PPP_Instance interface, returns NULL. | 127 // PPP_Instance interface, returns NULL. |
128 static PepperPluginInstanceImpl* Create( | 128 static PepperPluginInstanceImpl* Create(RenderFrameImpl* render_frame, |
129 RenderFrameImpl* render_frame, | 129 PluginModule* module, |
130 PluginModule* module, | 130 blink::WebPluginContainer* container, |
131 blink::WebPluginContainer* container, | 131 const GURL& plugin_url); |
132 const GURL& plugin_url); | |
133 RenderFrameImpl* render_frame() const { return render_frame_; } | 132 RenderFrameImpl* render_frame() const { return render_frame_; } |
134 PluginModule* module() const { return module_.get(); } | 133 PluginModule* module() const { return module_.get(); } |
135 MessageChannel& message_channel() { return *message_channel_; } | 134 MessageChannel& message_channel() { return *message_channel_; } |
136 | 135 |
137 blink::WebPluginContainer* container() const { return container_; } | 136 blink::WebPluginContainer* container() const { return container_; } |
138 | 137 |
139 // Returns the PP_Instance uniquely identifying this instance. Guaranteed | 138 // Returns the PP_Instance uniquely identifying this instance. Guaranteed |
140 // nonzero. | 139 // nonzero. |
141 PP_Instance pp_instance() const { return pp_instance_; } | 140 PP_Instance pp_instance() const { return pp_instance_; } |
142 | 141 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 const ppapi::ViewData& view_data() const { return view_data_; } | 180 const ppapi::ViewData& view_data() const { return view_data_; } |
182 | 181 |
183 // PPP_Instance and PPP_Instance_Private. | 182 // PPP_Instance and PPP_Instance_Private. |
184 bool Initialize(const std::vector<std::string>& arg_names, | 183 bool Initialize(const std::vector<std::string>& arg_names, |
185 const std::vector<std::string>& arg_values, | 184 const std::vector<std::string>& arg_values, |
186 bool full_frame); | 185 bool full_frame); |
187 bool HandleDocumentLoad(const blink::WebURLResponse& response); | 186 bool HandleDocumentLoad(const blink::WebURLResponse& response); |
188 bool HandleInputEvent(const blink::WebInputEvent& event, | 187 bool HandleInputEvent(const blink::WebInputEvent& event, |
189 blink::WebCursorInfo* cursor_info); | 188 blink::WebCursorInfo* cursor_info); |
190 PP_Var GetInstanceObject(); | 189 PP_Var GetInstanceObject(); |
191 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip, | 190 void ViewChanged(const gfx::Rect& position, |
| 191 const gfx::Rect& clip, |
192 const std::vector<gfx::Rect>& cut_outs_rects); | 192 const std::vector<gfx::Rect>& cut_outs_rects); |
193 | 193 |
194 // Handlers for composition events. | 194 // Handlers for composition events. |
195 bool HandleCompositionStart(const base::string16& text); | 195 bool HandleCompositionStart(const base::string16& text); |
196 bool HandleCompositionUpdate( | 196 bool HandleCompositionUpdate( |
197 const base::string16& text, | 197 const base::string16& text, |
198 const std::vector<blink::WebCompositionUnderline>& underlines, | 198 const std::vector<blink::WebCompositionUnderline>& underlines, |
199 int selection_start, | 199 int selection_start, |
200 int selection_end); | 200 int selection_end); |
201 bool HandleCompositionEnd(const base::string16& text); | 201 bool HandleCompositionEnd(const base::string16& text); |
(...skipping 15 matching lines...) Expand all Loading... |
217 // Notifications that the view has started painting, and has flushed the | 217 // Notifications that the view has started painting, and has flushed the |
218 // painted content to the screen. These messages are used to send Flush | 218 // painted content to the screen. These messages are used to send Flush |
219 // callbacks to the plugin for DeviceContext2D/3D. | 219 // callbacks to the plugin for DeviceContext2D/3D. |
220 void ViewInitiatedPaint(); | 220 void ViewInitiatedPaint(); |
221 void ViewFlushedPaint(); | 221 void ViewFlushedPaint(); |
222 | 222 |
223 // If this plugin can be painted merely by copying the backing store to the | 223 // If this plugin can be painted merely by copying the backing store to the |
224 // screen, and the plugin bounds encloses the given paint bounds, returns | 224 // screen, and the plugin bounds encloses the given paint bounds, returns |
225 // true. In this case, the location, clipping, and ID of the backing store | 225 // true. In this case, the location, clipping, and ID of the backing store |
226 // will be filled into the given output parameters. | 226 // will be filled into the given output parameters. |
227 bool GetBitmapForOptimizedPluginPaint( | 227 bool GetBitmapForOptimizedPluginPaint(const gfx::Rect& paint_bounds, |
228 const gfx::Rect& paint_bounds, | 228 TransportDIB** dib, |
229 TransportDIB** dib, | 229 gfx::Rect* dib_bounds, |
230 gfx::Rect* dib_bounds, | 230 gfx::Rect* clip, |
231 gfx::Rect* clip, | 231 float* scale_factor); |
232 float* scale_factor); | |
233 | 232 |
234 // Tracks all live PluginObjects. | 233 // Tracks all live PluginObjects. |
235 void AddPluginObject(PluginObject* plugin_object); | 234 void AddPluginObject(PluginObject* plugin_object); |
236 void RemovePluginObject(PluginObject* plugin_object); | 235 void RemovePluginObject(PluginObject* plugin_object); |
237 | 236 |
238 base::string16 GetSelectedText(bool html); | 237 base::string16 GetSelectedText(bool html); |
239 base::string16 GetLinkAtPosition(const gfx::Point& point); | 238 base::string16 GetLinkAtPosition(const gfx::Point& point); |
240 void RequestSurroundingText(size_t desired_number_of_characters); | 239 void RequestSurroundingText(size_t desired_number_of_characters); |
241 void Zoom(double factor, bool text_only); | 240 void Zoom(double factor, bool text_only); |
242 bool StartFind(const base::string16& search_text, | 241 bool StartFind(const base::string16& search_text, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // A mouse lock is enabled and mouse events are being delivered. | 324 // A mouse lock is enabled and mouse events are being delivered. |
326 void HandleMouseLockedInputEvent(const blink::WebMouseEvent& event); | 325 void HandleMouseLockedInputEvent(const blink::WebMouseEvent& event); |
327 | 326 |
328 // Simulates an input event to the plugin by passing it down to WebKit, | 327 // Simulates an input event to the plugin by passing it down to WebKit, |
329 // which sends it back up to the plugin as if it came from the user. | 328 // which sends it back up to the plugin as if it came from the user. |
330 void SimulateInputEvent(const ppapi::InputEventData& input_event); | 329 void SimulateInputEvent(const ppapi::InputEventData& input_event); |
331 | 330 |
332 // Simulates an IME event at the level of RenderView which sends it back up to | 331 // Simulates an IME event at the level of RenderView which sends it back up to |
333 // the plugin as if it came from the user. | 332 // the plugin as if it came from the user. |
334 bool SimulateIMEEvent(const ppapi::InputEventData& input_event); | 333 bool SimulateIMEEvent(const ppapi::InputEventData& input_event); |
335 void SimulateImeSetCompositionEvent( | 334 void SimulateImeSetCompositionEvent(const ppapi::InputEventData& input_event); |
336 const ppapi::InputEventData& input_event); | |
337 | 335 |
338 // The document loader is valid when the plugin is "full-frame" and in this | 336 // The document loader is valid when the plugin is "full-frame" and in this |
339 // case is non-NULL as long as the corresponding loader resource is alive. | 337 // case is non-NULL as long as the corresponding loader resource is alive. |
340 // This pointer is non-owning, so the loader must use set_document_loader to | 338 // This pointer is non-owning, so the loader must use set_document_loader to |
341 // clear itself when it is destroyed. | 339 // clear itself when it is destroyed. |
342 blink::WebURLLoaderClient* document_loader() const { | 340 blink::WebURLLoaderClient* document_loader() const { |
343 return document_loader_; | 341 return document_loader_; |
344 } | 342 } |
345 void set_document_loader(blink::WebURLLoaderClient* loader) { | 343 void set_document_loader(blink::WebURLLoaderClient* loader) { |
346 document_loader_ = loader; | 344 document_loader_ = loader; |
(...skipping 16 matching lines...) Expand all Loading... |
363 const IPC::ChannelHandle& channel_handle, | 361 const IPC::ChannelHandle& channel_handle, |
364 base::ProcessId plugin_pid, | 362 base::ProcessId plugin_pid, |
365 int plugin_child_id) OVERRIDE; | 363 int plugin_child_id) OVERRIDE; |
366 virtual void SetAlwaysOnTop(bool on_top) OVERRIDE; | 364 virtual void SetAlwaysOnTop(bool on_top) OVERRIDE; |
367 virtual bool IsFullPagePlugin() OVERRIDE; | 365 virtual bool IsFullPagePlugin() OVERRIDE; |
368 virtual bool FlashSetFullscreen(bool fullscreen, bool delay_report) OVERRIDE; | 366 virtual bool FlashSetFullscreen(bool fullscreen, bool delay_report) OVERRIDE; |
369 virtual bool IsRectTopmost(const gfx::Rect& rect) OVERRIDE; | 367 virtual bool IsRectTopmost(const gfx::Rect& rect) OVERRIDE; |
370 virtual int32_t Navigate(const ppapi::URLRequestInfoData& request, | 368 virtual int32_t Navigate(const ppapi::URLRequestInfoData& request, |
371 const char* target, | 369 const char* target, |
372 bool from_user_action) OVERRIDE; | 370 bool from_user_action) OVERRIDE; |
373 virtual int MakePendingFileRefRendererHost( | 371 virtual int MakePendingFileRefRendererHost(const base::FilePath& path) |
374 const base::FilePath& path) OVERRIDE; | 372 OVERRIDE; |
375 virtual void SetEmbedProperty(PP_Var key, PP_Var value) OVERRIDE; | 373 virtual void SetEmbedProperty(PP_Var key, PP_Var value) OVERRIDE; |
376 virtual void SetSelectedText(const base::string16& selected_text) OVERRIDE; | 374 virtual void SetSelectedText(const base::string16& selected_text) OVERRIDE; |
377 virtual void SetLinkUnderCursor(const std::string& url) OVERRIDE; | 375 virtual void SetLinkUnderCursor(const std::string& url) OVERRIDE; |
378 | 376 |
379 // PPB_Instance_API implementation. | 377 // PPB_Instance_API implementation. |
380 virtual PP_Bool BindGraphics(PP_Instance instance, | 378 virtual PP_Bool BindGraphics(PP_Instance instance, |
381 PP_Resource device) OVERRIDE; | 379 PP_Resource device) OVERRIDE; |
382 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; | 380 virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE; |
383 virtual const ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE; | 381 virtual const ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE; |
384 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; | 382 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
397 int32_t total, | 395 int32_t total, |
398 PP_Bool final_result) OVERRIDE; | 396 PP_Bool final_result) OVERRIDE; |
399 virtual void SelectedFindResultChanged(PP_Instance instance, | 397 virtual void SelectedFindResultChanged(PP_Instance instance, |
400 int32_t index) OVERRIDE; | 398 int32_t index) OVERRIDE; |
401 virtual void SetTickmarks(PP_Instance instance, | 399 virtual void SetTickmarks(PP_Instance instance, |
402 const PP_Rect* tickmarks, | 400 const PP_Rect* tickmarks, |
403 uint32_t count) OVERRIDE; | 401 uint32_t count) OVERRIDE; |
404 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; | 402 virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE; |
405 virtual PP_Bool SetFullscreen(PP_Instance instance, | 403 virtual PP_Bool SetFullscreen(PP_Instance instance, |
406 PP_Bool fullscreen) OVERRIDE; | 404 PP_Bool fullscreen) OVERRIDE; |
407 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) | 405 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; |
| 406 virtual ppapi::Resource* GetSingletonResource(PP_Instance instance, |
| 407 ppapi::SingletonResourceID id) |
408 OVERRIDE; | 408 OVERRIDE; |
409 virtual ppapi::Resource* GetSingletonResource(PP_Instance instance, | |
410 ppapi::SingletonResourceID id) OVERRIDE; | |
411 virtual int32_t RequestInputEvents(PP_Instance instance, | 409 virtual int32_t RequestInputEvents(PP_Instance instance, |
412 uint32_t event_classes) OVERRIDE; | 410 uint32_t event_classes) OVERRIDE; |
413 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, | 411 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, |
414 uint32_t event_classes) OVERRIDE; | 412 uint32_t event_classes) OVERRIDE; |
415 virtual void ClearInputEventRequest(PP_Instance instance, | 413 virtual void ClearInputEventRequest(PP_Instance instance, |
416 uint32_t event_classes) OVERRIDE; | 414 uint32_t event_classes) OVERRIDE; |
417 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; | 415 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
418 virtual void ZoomLimitsChanged(PP_Instance instance, | 416 virtual void ZoomLimitsChanged(PP_Instance instance, |
419 double minimum_factor, | 417 double minimum_factor, |
420 double maximum_factor) OVERRIDE; | 418 double maximum_factor) OVERRIDE; |
421 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 419 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
422 virtual PP_Bool SetCursor(PP_Instance instance, | 420 virtual PP_Bool SetCursor(PP_Instance instance, |
423 PP_MouseCursor_Type type, | 421 PP_MouseCursor_Type type, |
424 PP_Resource image, | 422 PP_Resource image, |
425 const PP_Point* hot_spot) OVERRIDE; | 423 const PP_Point* hot_spot) OVERRIDE; |
426 virtual int32_t LockMouse( | 424 virtual int32_t LockMouse(PP_Instance instance, |
427 PP_Instance instance, | 425 scoped_refptr<ppapi::TrackedCallback> callback) |
428 scoped_refptr<ppapi::TrackedCallback> callback) OVERRIDE; | 426 OVERRIDE; |
429 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 427 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
430 virtual void SetTextInputType(PP_Instance instance, | 428 virtual void SetTextInputType(PP_Instance instance, |
431 PP_TextInput_Type type) OVERRIDE; | 429 PP_TextInput_Type type) OVERRIDE; |
432 virtual void UpdateCaretPosition(PP_Instance instance, | 430 virtual void UpdateCaretPosition(PP_Instance instance, |
433 const PP_Rect& caret, | 431 const PP_Rect& caret, |
434 const PP_Rect& bounding_box) OVERRIDE; | 432 const PP_Rect& bounding_box) OVERRIDE; |
435 virtual void CancelCompositionText(PP_Instance instance) OVERRIDE; | 433 virtual void CancelCompositionText(PP_Instance instance) OVERRIDE; |
436 virtual void SelectionChanged(PP_Instance instance) OVERRIDE; | 434 virtual void SelectionChanged(PP_Instance instance) OVERRIDE; |
437 virtual void UpdateSurroundingText(PP_Instance instance, | 435 virtual void UpdateSurroundingText(PP_Instance instance, |
438 const char* text, | 436 const char* text, |
439 uint32_t caret, | 437 uint32_t caret, |
440 uint32_t anchor) OVERRIDE; | 438 uint32_t anchor) OVERRIDE; |
441 virtual PP_Var ResolveRelativeToDocument( | 439 virtual PP_Var ResolveRelativeToDocument(PP_Instance instance, |
442 PP_Instance instance, | 440 PP_Var relative, |
443 PP_Var relative, | 441 PP_URLComponents_Dev* components) |
444 PP_URLComponents_Dev* components) OVERRIDE; | 442 OVERRIDE; |
445 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE; | 443 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE; |
446 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, | 444 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, |
447 PP_Instance target) OVERRIDE; | 445 PP_Instance target) OVERRIDE; |
448 virtual PP_Var GetDocumentURL(PP_Instance instance, | 446 virtual PP_Var GetDocumentURL(PP_Instance instance, |
449 PP_URLComponents_Dev* components) OVERRIDE; | 447 PP_URLComponents_Dev* components) OVERRIDE; |
450 virtual PP_Var GetPluginInstanceURL( | 448 virtual PP_Var GetPluginInstanceURL(PP_Instance instance, |
451 PP_Instance instance, | 449 PP_URLComponents_Dev* components) |
452 PP_URLComponents_Dev* components) OVERRIDE; | 450 OVERRIDE; |
453 virtual PP_Var GetPluginReferrerURL( | 451 virtual PP_Var GetPluginReferrerURL(PP_Instance instance, |
454 PP_Instance instance, | 452 PP_URLComponents_Dev* components) |
455 PP_URLComponents_Dev* components) OVERRIDE; | 453 OVERRIDE; |
456 | 454 |
457 // PPB_ContentDecryptor_Private implementation. | 455 // PPB_ContentDecryptor_Private implementation. |
458 virtual void SessionCreated(PP_Instance instance, | 456 virtual void SessionCreated(PP_Instance instance, |
459 uint32_t session_id, | 457 uint32_t session_id, |
460 PP_Var web_session_id_var) OVERRIDE; | 458 PP_Var web_session_id_var) OVERRIDE; |
461 virtual void SessionMessage(PP_Instance instance, | 459 virtual void SessionMessage(PP_Instance instance, |
462 uint32_t session_id, | 460 uint32_t session_id, |
463 PP_Var message, | 461 PP_Var message, |
464 PP_Var destination_url) OVERRIDE; | 462 PP_Var destination_url) OVERRIDE; |
465 virtual void SessionReady(PP_Instance instance, uint32_t session_id) OVERRIDE; | 463 virtual void SessionReady(PP_Instance instance, uint32_t session_id) OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
478 PP_Bool success) OVERRIDE; | 476 PP_Bool success) OVERRIDE; |
479 virtual void DecoderDeinitializeDone(PP_Instance instance, | 477 virtual void DecoderDeinitializeDone(PP_Instance instance, |
480 PP_DecryptorStreamType decoder_type, | 478 PP_DecryptorStreamType decoder_type, |
481 uint32_t request_id) OVERRIDE; | 479 uint32_t request_id) OVERRIDE; |
482 virtual void DecoderResetDone(PP_Instance instance, | 480 virtual void DecoderResetDone(PP_Instance instance, |
483 PP_DecryptorStreamType decoder_type, | 481 PP_DecryptorStreamType decoder_type, |
484 uint32_t request_id) OVERRIDE; | 482 uint32_t request_id) OVERRIDE; |
485 virtual void DeliverFrame(PP_Instance instance, | 483 virtual void DeliverFrame(PP_Instance instance, |
486 PP_Resource decrypted_frame, | 484 PP_Resource decrypted_frame, |
487 const PP_DecryptedFrameInfo* frame_info) OVERRIDE; | 485 const PP_DecryptedFrameInfo* frame_info) OVERRIDE; |
488 virtual void DeliverSamples( | 486 virtual void DeliverSamples(PP_Instance instance, |
489 PP_Instance instance, | 487 PP_Resource audio_frames, |
490 PP_Resource audio_frames, | 488 const PP_DecryptedSampleInfo* sample_info) |
491 const PP_DecryptedSampleInfo* sample_info) OVERRIDE; | 489 OVERRIDE; |
492 | 490 |
493 // Reset this instance as proxied. Assigns the instance a new module, resets | 491 // Reset this instance as proxied. Assigns the instance a new module, resets |
494 // cached interfaces to point to the out-of-process proxy and re-sends | 492 // cached interfaces to point to the out-of-process proxy and re-sends |
495 // DidCreate, DidChangeView, and HandleDocumentLoad (if necessary). | 493 // DidCreate, DidChangeView, and HandleDocumentLoad (if necessary). |
496 // This should be used only when switching an in-process instance to an | 494 // This should be used only when switching an in-process instance to an |
497 // external out-of-process instance. | 495 // external out-of-process instance. |
498 PP_ExternalPluginResult ResetAsProxied(scoped_refptr<PluginModule> module); | 496 PP_ExternalPluginResult ResetAsProxied(scoped_refptr<PluginModule> module); |
499 | 497 |
500 // Checks whether this is a valid instance of the given module. After calling | 498 // Checks whether this is a valid instance of the given module. After calling |
501 // ResetAsProxied above, a NaCl plugin instance's module changes, so external | 499 // ResetAsProxied above, a NaCl plugin instance's module changes, so external |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // Implements PPB_Gamepad_API. This is just to avoid having an excessive | 552 // Implements PPB_Gamepad_API. This is just to avoid having an excessive |
555 // number of interfaces implemented by PepperPluginInstanceImpl. | 553 // number of interfaces implemented by PepperPluginInstanceImpl. |
556 class GamepadImpl : public ppapi::thunk::PPB_Gamepad_API, | 554 class GamepadImpl : public ppapi::thunk::PPB_Gamepad_API, |
557 public ppapi::Resource { | 555 public ppapi::Resource { |
558 public: | 556 public: |
559 GamepadImpl(); | 557 GamepadImpl(); |
560 // Resource implementation. | 558 // Resource implementation. |
561 virtual ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE; | 559 virtual ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE; |
562 virtual void Sample(PP_Instance instance, | 560 virtual void Sample(PP_Instance instance, |
563 PP_GamepadsSampleData* data) OVERRIDE; | 561 PP_GamepadsSampleData* data) OVERRIDE; |
| 562 |
564 private: | 563 private: |
565 virtual ~GamepadImpl(); | 564 virtual ~GamepadImpl(); |
566 }; | 565 }; |
567 | 566 |
568 // See the static Create functions above for creating PepperPluginInstanceImpl | 567 // See the static Create functions above for creating PepperPluginInstanceImpl |
569 // objects. This constructor is private so that we can hide the | 568 // objects. This constructor is private so that we can hide the |
570 // PPP_Instance_Combined details while still having 1 constructor to maintain | 569 // PPP_Instance_Combined details while still having 1 constructor to maintain |
571 // for member initialization. | 570 // for member initialization. |
572 PepperPluginInstanceImpl(RenderFrameImpl* render_frame, | 571 PepperPluginInstanceImpl(RenderFrameImpl* render_frame, |
573 PluginModule* module, | 572 PluginModule* module, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 void UpdateLayer(); | 622 void UpdateLayer(); |
624 | 623 |
625 // Internal helper function for PrintPage(). | 624 // Internal helper function for PrintPage(). |
626 bool PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, | 625 bool PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, |
627 int num_ranges, | 626 int num_ranges, |
628 blink::WebCanvas* canvas); | 627 blink::WebCanvas* canvas); |
629 | 628 |
630 void DoSetCursor(blink::WebCursorInfo* cursor); | 629 void DoSetCursor(blink::WebCursorInfo* cursor); |
631 | 630 |
632 // Internal helper functions for HandleCompositionXXX(). | 631 // Internal helper functions for HandleCompositionXXX(). |
633 bool SendCompositionEventToPlugin( | 632 bool SendCompositionEventToPlugin(PP_InputEvent_Type type, |
634 PP_InputEvent_Type type, | 633 const base::string16& text); |
635 const base::string16& text); | |
636 bool SendCompositionEventWithUnderlineInformationToPlugin( | 634 bool SendCompositionEventWithUnderlineInformationToPlugin( |
637 PP_InputEvent_Type type, | 635 PP_InputEvent_Type type, |
638 const base::string16& text, | 636 const base::string16& text, |
639 const std::vector<blink::WebCompositionUnderline>& underlines, | 637 const std::vector<blink::WebCompositionUnderline>& underlines, |
640 int selection_start, | 638 int selection_start, |
641 int selection_end); | 639 int selection_end); |
642 | 640 |
643 // Internal helper function for XXXInputEvents(). | 641 // Internal helper function for XXXInputEvents(). |
644 void RequestInputEventsHelper(uint32_t event_classes); | 642 void RequestInputEventsHelper(uint32_t event_classes); |
645 | 643 |
(...skipping 10 matching lines...) Expand all Loading... |
656 void KeepSizeAttributesBeforeFullscreen(); | 654 void KeepSizeAttributesBeforeFullscreen(); |
657 void SetSizeAttributesForFullscreen(); | 655 void SetSizeAttributesForFullscreen(); |
658 void ResetSizeAttributesAfterFullscreen(); | 656 void ResetSizeAttributesAfterFullscreen(); |
659 | 657 |
660 bool IsMouseLocked(); | 658 bool IsMouseLocked(); |
661 bool LockMouse(); | 659 bool LockMouse(); |
662 MouseLockDispatcher* GetMouseLockDispatcher(); | 660 MouseLockDispatcher* GetMouseLockDispatcher(); |
663 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); | 661 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); |
664 void UnSetAndDeleteLockTargetAdapter(); | 662 void UnSetAndDeleteLockTargetAdapter(); |
665 | 663 |
666 void DidDataFromWebURLResponse( | 664 void DidDataFromWebURLResponse(const blink::WebURLResponse& response, |
667 const blink::WebURLResponse& response, | 665 int pending_host_id, |
668 int pending_host_id, | 666 const ppapi::URLResponseInfoData& data); |
669 const ppapi::URLResponseInfoData& data); | |
670 | 667 |
671 RenderFrameImpl* render_frame_; | 668 RenderFrameImpl* render_frame_; |
672 base::Closure instance_deleted_callback_; | 669 base::Closure instance_deleted_callback_; |
673 scoped_refptr<PluginModule> module_; | 670 scoped_refptr<PluginModule> module_; |
674 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; | 671 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; |
675 // If this is the NaCl plugin, we create a new module when we switch to the | 672 // If this is the NaCl plugin, we create a new module when we switch to the |
676 // IPC-based PPAPI proxy. Store the original module and instance interface | 673 // IPC-based PPAPI proxy. Store the original module and instance interface |
677 // so we can shut down properly. | 674 // so we can shut down properly. |
678 scoped_refptr<PluginModule> original_module_; | 675 scoped_refptr<PluginModule> original_module_; |
679 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; | 676 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; | 884 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; |
888 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; | 885 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; |
889 | 886 |
890 friend class PpapiPluginInstanceTest; | 887 friend class PpapiPluginInstanceTest; |
891 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 888 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
892 }; | 889 }; |
893 | 890 |
894 } // namespace content | 891 } // namespace content |
895 | 892 |
896 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 893 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
OLD | NEW |