| 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 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "ui/gfx/rect.h" | 37 #include "ui/gfx/rect.h" |
| 38 #include "webkit/plugins/ppapi/plugin_delegate.h" | 38 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 39 | 39 |
| 40 struct PP_Var; | 40 struct PP_Var; |
| 41 struct PPP_Find_Dev; | 41 struct PPP_Find_Dev; |
| 42 struct PPP_InputEvent; | 42 struct PPP_InputEvent; |
| 43 struct PPP_Instance_Private; | 43 struct PPP_Instance_Private; |
| 44 struct PPP_Messaging; | 44 struct PPP_Messaging; |
| 45 struct PPP_MouseLock; | 45 struct PPP_MouseLock; |
| 46 struct PPP_Pdf; | 46 struct PPP_Pdf; |
| 47 struct PPP_PolicyUpdate_Dev; | |
| 48 struct PPP_Selection_Dev; | 47 struct PPP_Selection_Dev; |
| 49 struct PPP_Zoom_Dev; | 48 struct PPP_Zoom_Dev; |
| 50 | 49 |
| 51 class SkBitmap; | 50 class SkBitmap; |
| 52 class TransportDIB; | 51 class TransportDIB; |
| 53 | 52 |
| 54 namespace WebKit { | 53 namespace WebKit { |
| 55 class WebInputEvent; | 54 class WebInputEvent; |
| 56 class WebPluginContainer; | 55 class WebPluginContainer; |
| 57 struct WebCompositionUnderline; | 56 struct WebCompositionUnderline; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 155 |
| 157 // PPP_Instance and PPP_Instance_Private pass-through. | 156 // PPP_Instance and PPP_Instance_Private pass-through. |
| 158 bool Initialize(WebKit::WebPluginContainer* container, | 157 bool Initialize(WebKit::WebPluginContainer* container, |
| 159 const std::vector<std::string>& arg_names, | 158 const std::vector<std::string>& arg_names, |
| 160 const std::vector<std::string>& arg_values, | 159 const std::vector<std::string>& arg_values, |
| 161 const GURL& plugin_url, | 160 const GURL& plugin_url, |
| 162 bool full_frame); | 161 bool full_frame); |
| 163 bool HandleDocumentLoad(PPB_URLLoader_Impl* loader); | 162 bool HandleDocumentLoad(PPB_URLLoader_Impl* loader); |
| 164 bool HandleInputEvent(const WebKit::WebInputEvent& event, | 163 bool HandleInputEvent(const WebKit::WebInputEvent& event, |
| 165 WebKit::WebCursorInfo* cursor_info); | 164 WebKit::WebCursorInfo* cursor_info); |
| 166 void HandlePolicyUpdate(const std::string& policy_json); | |
| 167 PP_Var GetInstanceObject(); | 165 PP_Var GetInstanceObject(); |
| 168 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip); | 166 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip); |
| 169 | 167 |
| 170 // Handlers for composition events. | 168 // Handlers for composition events. |
| 171 bool HandleCompositionStart(const string16& text); | 169 bool HandleCompositionStart(const string16& text); |
| 172 bool HandleCompositionUpdate( | 170 bool HandleCompositionUpdate( |
| 173 const string16& text, | 171 const string16& text, |
| 174 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 172 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
| 175 int selection_start, | 173 int selection_start, |
| 176 int selection_end); | 174 int selection_end); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 virtual void ClearInputEventRequest(PP_Instance instance, | 340 virtual void ClearInputEventRequest(PP_Instance instance, |
| 343 uint32_t event_classes) OVERRIDE; | 341 uint32_t event_classes) OVERRIDE; |
| 344 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; | 342 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; |
| 345 virtual void ZoomLimitsChanged(PP_Instance instance, | 343 virtual void ZoomLimitsChanged(PP_Instance instance, |
| 346 double minimum_factor, | 344 double minimum_factor, |
| 347 double maximium_factor) OVERRIDE; | 345 double maximium_factor) OVERRIDE; |
| 348 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 346 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
| 349 virtual int32_t LockMouse(PP_Instance instance, | 347 virtual int32_t LockMouse(PP_Instance instance, |
| 350 PP_CompletionCallback callback) OVERRIDE; | 348 PP_CompletionCallback callback) OVERRIDE; |
| 351 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 349 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
| 352 virtual void SubscribeToPolicyUpdates(PP_Instance instance) OVERRIDE; | |
| 353 virtual PP_Var ResolveRelativeToDocument( | 350 virtual PP_Var ResolveRelativeToDocument( |
| 354 PP_Instance instance, | 351 PP_Instance instance, |
| 355 PP_Var relative, | 352 PP_Var relative, |
| 356 PP_URLComponents_Dev* components) OVERRIDE; | 353 PP_URLComponents_Dev* components) OVERRIDE; |
| 357 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE; | 354 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE; |
| 358 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, | 355 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, |
| 359 PP_Instance target) OVERRIDE; | 356 PP_Instance target) OVERRIDE; |
| 360 virtual PP_Var GetDocumentURL(PP_Instance instance, | 357 virtual PP_Var GetDocumentURL(PP_Instance instance, |
| 361 PP_URLComponents_Dev* components) OVERRIDE; | 358 PP_URLComponents_Dev* components) OVERRIDE; |
| 362 virtual PP_Var GetPluginInstanceURL( | 359 virtual PP_Var GetPluginInstanceURL( |
| 363 PP_Instance instance, | 360 PP_Instance instance, |
| 364 PP_URLComponents_Dev* components) OVERRIDE; | 361 PP_URLComponents_Dev* components) OVERRIDE; |
| 365 | 362 |
| 366 private: | 363 private: |
| 367 // See the static Create functions above for creating PluginInstance objects. | 364 // See the static Create functions above for creating PluginInstance objects. |
| 368 // This constructor is private so that we can hide the PPP_Instance_Combined | 365 // This constructor is private so that we can hide the PPP_Instance_Combined |
| 369 // details while still having 1 constructor to maintain for member | 366 // details while still having 1 constructor to maintain for member |
| 370 // initialization. | 367 // initialization. |
| 371 PluginInstance(PluginDelegate* delegate, | 368 PluginInstance(PluginDelegate* delegate, |
| 372 PluginModule* module, | 369 PluginModule* module, |
| 373 ::ppapi::PPP_Instance_Combined* instance_interface); | 370 ::ppapi::PPP_Instance_Combined* instance_interface); |
| 374 | 371 |
| 375 bool LoadFindInterface(); | 372 bool LoadFindInterface(); |
| 376 bool LoadInputEventInterface(); | 373 bool LoadInputEventInterface(); |
| 377 bool LoadMessagingInterface(); | 374 bool LoadMessagingInterface(); |
| 378 bool LoadMouseLockInterface(); | 375 bool LoadMouseLockInterface(); |
| 379 bool LoadPdfInterface(); | 376 bool LoadPdfInterface(); |
| 380 bool LoadPolicyUpdateInterface(); | |
| 381 bool LoadPrintInterface(); | 377 bool LoadPrintInterface(); |
| 382 bool LoadPrivateInterface(); | 378 bool LoadPrivateInterface(); |
| 383 bool LoadSelectionInterface(); | 379 bool LoadSelectionInterface(); |
| 384 bool LoadZoomInterface(); | 380 bool LoadZoomInterface(); |
| 385 | 381 |
| 386 // Determines if we think the plugin has focus, both content area and webkit | 382 // Determines if we think the plugin has focus, both content area and webkit |
| 387 // (see has_webkit_focus_ below). | 383 // (see has_webkit_focus_ below). |
| 388 bool PluginHasFocus() const; | 384 bool PluginHasFocus() const; |
| 389 | 385 |
| 390 // Reports the current plugin geometry to the plugin by calling | 386 // Reports the current plugin geometry to the plugin by calling |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 // The id of the current find operation, or -1 if none is in process. | 501 // The id of the current find operation, or -1 if none is in process. |
| 506 int find_identifier_; | 502 int find_identifier_; |
| 507 | 503 |
| 508 // The plugin-provided interfaces. | 504 // The plugin-provided interfaces. |
| 509 const PPP_Find_Dev* plugin_find_interface_; | 505 const PPP_Find_Dev* plugin_find_interface_; |
| 510 const PPP_Messaging* plugin_messaging_interface_; | 506 const PPP_Messaging* plugin_messaging_interface_; |
| 511 const PPP_MouseLock* plugin_mouse_lock_interface_; | 507 const PPP_MouseLock* plugin_mouse_lock_interface_; |
| 512 const PPP_InputEvent* plugin_input_event_interface_; | 508 const PPP_InputEvent* plugin_input_event_interface_; |
| 513 const PPP_Instance_Private* plugin_private_interface_; | 509 const PPP_Instance_Private* plugin_private_interface_; |
| 514 const PPP_Pdf* plugin_pdf_interface_; | 510 const PPP_Pdf* plugin_pdf_interface_; |
| 515 const PPP_PolicyUpdate_Dev* plugin_policy_updated_interface_; | |
| 516 const PPP_Selection_Dev* plugin_selection_interface_; | 511 const PPP_Selection_Dev* plugin_selection_interface_; |
| 517 const PPP_Zoom_Dev* plugin_zoom_interface_; | 512 const PPP_Zoom_Dev* plugin_zoom_interface_; |
| 518 | 513 |
| 519 // Flags indicating whether we have asked this plugin instance for the | 514 // Flags indicating whether we have asked this plugin instance for the |
| 520 // corresponding interfaces, so that we can ask only once. | 515 // corresponding interfaces, so that we can ask only once. |
| 521 bool checked_for_plugin_input_event_interface_; | 516 bool checked_for_plugin_input_event_interface_; |
| 522 bool checked_for_plugin_messaging_interface_; | 517 bool checked_for_plugin_messaging_interface_; |
| 523 | 518 |
| 524 // This is only valid between a successful PrintBegin call and a PrintEnd | 519 // This is only valid between a successful PrintBegin call and a PrintEnd |
| 525 // call. | 520 // call. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 608 |
| 614 PP_CompletionCallback lock_mouse_callback_; | 609 PP_CompletionCallback lock_mouse_callback_; |
| 615 | 610 |
| 616 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 611 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 617 }; | 612 }; |
| 618 | 613 |
| 619 } // namespace ppapi | 614 } // namespace ppapi |
| 620 } // namespace webkit | 615 } // namespace webkit |
| 621 | 616 |
| 622 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 617 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |