Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 // This interface is used by RenderView to talk to the plugin delegate. | |
| 6 #ifndef CONTENT_RENDERER_PLUGIN_DELEGATE_HELPER_H_ | |
| 7 #define CONTENT_RENDERER_PLUGIN_DELEGATE_HELPER_H_ | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "base/platform_file.h" | |
| 15 #include "ui/base/ime/text_input_type.h" | |
| 16 | |
| 17 class TransportDIB; | |
| 18 | |
| 19 namespace gfx { | |
| 20 class Rect; | |
| 21 } | |
| 22 | |
| 23 namespace IPC { | |
| 24 struct ChannelHandle; | |
| 25 } | |
| 26 | |
| 27 namespace ui { | |
| 28 class Range; | |
| 29 } | |
| 30 | |
| 31 namespace webkit { | |
| 32 struct WebPluginInfo; | |
| 33 namespace ppapi { | |
| 34 class PluginInstance; | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 namespace WebKit { | |
| 39 struct WebCompositionUnderline; | |
| 40 struct WebPluginParams; | |
| 41 class WebPlugin; | |
| 42 } | |
| 43 | |
| 44 namespace content { | |
| 45 | |
| 46 class PluginDelegateHelper { | |
|
brettw
2012/11/30 23:18:12
The name for this somehow seems wrong. It's not a
nilesh
2012/12/01 00:41:35
I agree RenderViewPepperHelper is a better name. I
| |
| 47 public: | |
| 48 PluginDelegateHelper() {} | |
| 49 virtual ~PluginDelegateHelper(); | |
| 50 | |
| 51 virtual WebKit::WebPlugin* CreatePepperWebPlugin( | |
| 52 const webkit::WebPluginInfo& webplugin_info, | |
| 53 const WebKit::WebPluginParams& params); | |
| 54 | |
| 55 // Called by RenderView to implement the corresponding function in its base | |
| 56 // class RenderWidget (see that for more). | |
| 57 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | |
| 58 const gfx::Rect& paint_bounds, | |
| 59 TransportDIB** dib, | |
| 60 gfx::Rect* location, | |
| 61 gfx::Rect* clip, | |
| 62 float* scale_factor); | |
| 63 | |
| 64 // Called by RenderView to tell us about painting events, these two functions | |
| 65 // just correspond to the WillInitiatePaint, DidInitiatePaint and | |
| 66 // DidFlushPaint hooks in RenderView. | |
| 67 virtual void ViewWillInitiatePaint() {} | |
| 68 virtual void ViewInitiatedPaint() {} | |
| 69 virtual void ViewFlushedPaint() {} | |
| 70 | |
| 71 // Called by RenderView when ViewMsg_AsyncOpenFile_ACK. | |
| 72 virtual void OnAsyncFileOpened(base::PlatformFileError error_code, | |
| 73 base::PlatformFile file, | |
| 74 int message_id) {} | |
| 75 | |
| 76 // Called by RenderView when ViewMsg_PpapiBrokerChannelCreated. | |
| 77 virtual void OnPpapiBrokerChannelCreated(int request_id, | |
| 78 const IPC::ChannelHandle& handle) {} | |
| 79 | |
| 80 // Called when we know whether permission to access the PPAPI broker was | |
| 81 // granted. | |
| 82 virtual void OnPpapiBrokerPermissionResult(int request_id, bool result) {} | |
| 83 | |
| 84 // Notification that the render view has been focused or defocused. This | |
| 85 // notifies all of the plugins. | |
| 86 virtual void OnSetFocus(bool has_focus) {} | |
| 87 | |
| 88 // Notification that the page visibility has changed. The default is visible. | |
| 89 virtual void PageVisibilityChanged(bool is_visible) {} | |
| 90 | |
| 91 // IME status. | |
| 92 virtual bool IsPluginFocused() const; | |
| 93 virtual gfx::Rect GetCaretBounds() const; | |
| 94 virtual ui::TextInputType GetTextInputType() const; | |
| 95 virtual bool IsPluginAcceptingCompositionEvents() const; | |
| 96 virtual bool CanComposeInline() const; | |
| 97 virtual void GetSurroundingText(string16* text, ui::Range* range) const {} | |
| 98 | |
| 99 // IME events. | |
| 100 virtual void OnImeSetComposition( | |
| 101 const string16& text, | |
| 102 const std::vector<WebKit::WebCompositionUnderline>& underlines, | |
| 103 int selection_start, | |
| 104 int selection_end) {} | |
| 105 virtual void OnImeConfirmComposition(const string16& text) {} | |
| 106 | |
| 107 // Notification that a mouse event has arrived at the render view. | |
| 108 virtual void WillHandleMouseEvent() {} | |
| 109 | |
| 110 private: | |
| 111 DISALLOW_COPY_AND_ASSIGN(PluginDelegateHelper); | |
| 112 }; | |
| 113 | |
| 114 } // namespace content | |
| 115 | |
| 116 #endif // CONTENT_RENDERER_PLUGIN_DELEGATE_HELPER_H_ | |
| OLD | NEW |