Disable ContentSettingBubbleModelTest.RPHAllow which is flaky.
[chromium-blink-merge.git] / content / renderer / render_view_pepper_helper.h
blob3449ccc9ec8b596c66faf5f58e11a6b80196223d
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.
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
9 #include <string>
10 #include <vector>
12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/platform_file.h"
15 #include "base/process.h"
16 #include "ui/base/ime/text_input_type.h"
18 class TransportDIB;
20 namespace gfx {
21 class Rect;
24 namespace IPC {
25 struct ChannelHandle;
28 namespace ui {
29 class Range;
32 namespace webkit {
33 struct WebPluginInfo;
34 namespace ppapi {
35 class PluginInstance;
39 namespace WebKit {
40 struct WebCompositionUnderline;
41 struct WebPluginParams;
42 class WebPlugin;
45 namespace content {
47 class RenderViewPepperHelper {
48 public:
49 RenderViewPepperHelper() {}
50 virtual ~RenderViewPepperHelper();
52 virtual WebKit::WebPlugin* CreatePepperWebPlugin(
53 const webkit::WebPluginInfo& webplugin_info,
54 const WebKit::WebPluginParams& params);
56 // Called by RenderView to implement the corresponding function in its base
57 // class RenderWidget (see that for more).
58 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint(
59 const gfx::Rect& paint_bounds,
60 TransportDIB** dib,
61 gfx::Rect* location,
62 gfx::Rect* clip,
63 float* scale_factor);
65 // Called by RenderView to tell us about painting events, these two functions
66 // just correspond to the WillInitiatePaint, DidInitiatePaint and
67 // DidFlushPaint hooks in RenderView.
68 virtual void ViewWillInitiatePaint() {}
69 virtual void ViewInitiatedPaint() {}
70 virtual void ViewFlushedPaint() {}
72 // Called by RenderView when ViewMsg_AsyncOpenFile_ACK.
73 virtual void OnAsyncFileOpened(base::PlatformFileError error_code,
74 base::PlatformFile file,
75 int message_id) {}
77 // Called by RenderView when ViewMsg_PpapiBrokerChannelCreated.
78 virtual void OnPpapiBrokerChannelCreated(int request_id,
79 base::ProcessId broker_pid,
80 const IPC::ChannelHandle& handle) {}
82 // Called when we know whether permission to access the PPAPI broker was
83 // granted.
84 virtual void OnPpapiBrokerPermissionResult(int request_id, bool result) {}
86 // Notification that the render view has been focused or defocused. This
87 // notifies all of the plugins.
88 virtual void OnSetFocus(bool has_focus) {}
90 // Notification that the page visibility has changed. The default is visible.
91 virtual void PageVisibilityChanged(bool is_visible) {}
93 // IME status.
94 virtual bool IsPluginFocused() const;
95 virtual gfx::Rect GetCaretBounds() const;
96 virtual ui::TextInputType GetTextInputType() const;
97 virtual bool IsPluginAcceptingCompositionEvents() const;
98 virtual bool CanComposeInline() const;
99 virtual void GetSurroundingText(string16* text, ui::Range* range) const {}
101 // IME events.
102 virtual void OnImeSetComposition(
103 const string16& text,
104 const std::vector<WebKit::WebCompositionUnderline>& underlines,
105 int selection_start,
106 int selection_end) {}
107 virtual void OnImeConfirmComposition(const string16& text) {}
109 // Notification that a mouse event has arrived at the render view.
110 virtual void WillHandleMouseEvent() {}
112 private:
113 DISALLOW_COPY_AND_ASSIGN(RenderViewPepperHelper);
116 } // namespace content
118 #endif // CONTENT_RENDERER_RENDER_VIEW_PEPPER_HELPER_H