| 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 pepper plugin delegate. | |
| 6 #ifndef CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H | |
| 7 #define CONTENT_RENDERER_RENDER_VIEW_PEPPER_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 "base/process/process.h" | |
| 16 #include "content/common/content_export.h" | |
| 17 #include "ui/base/ime/text_input_type.h" | |
| 18 | |
| 19 class TransportDIB; | |
| 20 | |
| 21 namespace gfx { | |
| 22 class Rect; | |
| 23 } | |
| 24 | |
| 25 namespace IPC { | |
| 26 struct ChannelHandle; | |
| 27 } | |
| 28 | |
| 29 namespace ui { | |
| 30 class Range; | |
| 31 } | |
| 32 | |
| 33 namespace WebKit { | |
| 34 struct WebCompositionUnderline; | |
| 35 struct WebPluginParams; | |
| 36 class WebPlugin; | |
| 37 } | |
| 38 | |
| 39 namespace content { | |
| 40 class PepperPluginInstanceImpl; | |
| 41 struct WebPluginInfo; | |
| 42 | |
| 43 class CONTENT_EXPORT RenderViewPepperHelper { | |
| 44 public: | |
| 45 RenderViewPepperHelper() {} | |
| 46 virtual ~RenderViewPepperHelper(); | |
| 47 | |
| 48 virtual WebKit::WebPlugin* CreatePepperWebPlugin( | |
| 49 const WebPluginInfo& webplugin_info, | |
| 50 const WebKit::WebPluginParams& params); | |
| 51 | |
| 52 // Called by RenderView to implement the corresponding function in its base | |
| 53 // class RenderWidget (see that for more). | |
| 54 virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( | |
| 55 const gfx::Rect& paint_bounds, | |
| 56 TransportDIB** dib, | |
| 57 gfx::Rect* location, | |
| 58 gfx::Rect* clip, | |
| 59 float* scale_factor); | |
| 60 | |
| 61 // Called by RenderView to tell us about painting events, these two functions | |
| 62 // just correspond to the WillInitiatePaint, DidInitiatePaint and | |
| 63 // DidFlushPaint hooks in RenderView. | |
| 64 virtual void ViewWillInitiatePaint() {} | |
| 65 virtual void ViewInitiatedPaint() {} | |
| 66 virtual void ViewFlushedPaint() {} | |
| 67 | |
| 68 // Notification that the render view has been focused or defocused. This | |
| 69 // notifies all of the plugins. | |
| 70 virtual void OnSetFocus(bool has_focus) {} | |
| 71 | |
| 72 // Notification that the page visibility has changed. The default is visible. | |
| 73 virtual void PageVisibilityChanged(bool is_visible) {} | |
| 74 | |
| 75 // IME status. | |
| 76 virtual bool IsPluginFocused() const; | |
| 77 virtual gfx::Rect GetCaretBounds() const; | |
| 78 virtual ui::TextInputType GetTextInputType() const; | |
| 79 virtual bool IsPluginAcceptingCompositionEvents() const; | |
| 80 virtual bool CanComposeInline() const; | |
| 81 virtual void GetSurroundingText(string16* text, ui::Range* range) const {} | |
| 82 | |
| 83 // IME events. | |
| 84 virtual void OnImeSetComposition( | |
| 85 const string16& text, | |
| 86 const std::vector<WebKit::WebCompositionUnderline>& underlines, | |
| 87 int selection_start, | |
| 88 int selection_end) {} | |
| 89 virtual void OnImeConfirmComposition(const string16& text) {} | |
| 90 | |
| 91 // Notification that a mouse event has arrived at the render view. | |
| 92 virtual void WillHandleMouseEvent() {} | |
| 93 | |
| 94 private: | |
| 95 DISALLOW_COPY_AND_ASSIGN(RenderViewPepperHelper); | |
| 96 }; | |
| 97 | |
| 98 } // namespace content | |
| 99 | |
| 100 #endif // CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H | |
| OLD | NEW |