Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest_helper.h

Issue 11606005: Browser Plugin: Simplify BrowserPluginGuestHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_
7 7
8 #include "content/port/common/input_event_ack_state.h" 8 #include "content/port/common/input_event_ack_state.h"
9 #include "content/public/browser/render_view_host_observer.h" 9 #include "content/public/browser/render_view_host_observer.h"
10 #include "content/public/browser/notification_registrar.h" 10 #include "content/public/browser/notification_registrar.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
13 13
14 class WebCursor; 14 class WebCursor;
15 #if defined(OS_MACOSX) 15 #if defined(OS_MACOSX)
16 struct ViewHostMsg_ShowPopup_Params; 16 struct ViewHostMsg_ShowPopup_Params;
17 #endif 17 #endif
18 struct ViewHostMsg_UpdateRect_Params; 18 struct ViewHostMsg_UpdateRect_Params;
19 19
20 namespace gfx { 20 namespace gfx {
21 class Size; 21 class Size;
22 } 22 }
23 23
24 namespace content { 24 namespace content {
25 class BrowserPluginGuest; 25 class BrowserPluginGuest;
26 class RenderViewHost; 26 class RenderViewHost;
27 27
28 // Helper for browser plugin guest. 28 // Helper for BrowserPluginGuest.
29 // 29 //
30 // It overrides different WebContents messages that require special treatment 30 // The purpose of this class is to intercept messages from the guest RenderView
31 // for a WebContents to act as a guest. All functionality is handled by its 31 // before they are handled by the standard message handlers in the browser
32 // delegate. This class exists so we have separation of messages requiring 32 // process. This permits overriding standard behavior with BrowserPlugin-
33 // special handling, which can be moved to a message filter (IPC thread) for 33 // specific behavior.
34 // future optimization.
35 // 34 //
36 // The lifetime of this class is managed by the associated RenderViewHost. A 35 // The lifetime of this class is managed by the associated RenderViewHost. A
37 // BrowserPluginGuestHelper is created whenever a BrowserPluginGuest is created. 36 // BrowserPluginGuestHelper is created whenever a BrowserPluginGuest is created.
38 class BrowserPluginGuestHelper : public RenderViewHostObserver { 37 class BrowserPluginGuestHelper : public RenderViewHostObserver {
39 public: 38 public:
40 BrowserPluginGuestHelper(BrowserPluginGuest* guest, 39 BrowserPluginGuestHelper(BrowserPluginGuest* guest,
41 RenderViewHost* render_view_host); 40 RenderViewHost* render_view_host);
42 virtual ~BrowserPluginGuestHelper(); 41 virtual ~BrowserPluginGuestHelper();
43 42
44 protected: 43 protected:
45 // RenderViewHostObserver implementation. 44 // RenderViewHostObserver implementation.
46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
47 46
48 private: 47 private:
49 // Message handlers 48 // Returns whether a message should be forward to the helper's associated
50 void OnUpdateDragCursor(WebKit::WebDragOperation current_op); 49 // BrowserPluginGuest.
51 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); 50 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message);
52 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type,
53 InputEventAckState ack_result);
54 void OnTakeFocus(bool reverse);
55 void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
56 void OnMsgHasTouchEventHandlers(bool has_handlers);
57 void OnSetCursor(const WebCursor& cursor);
58 #if defined(OS_MACOSX)
59 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params);
60 #endif
61 51
62 BrowserPluginGuest* guest_; 52 BrowserPluginGuest* guest_;
63 // A scoped container for notification registries.
64 NotificationRegistrar registrar_;
65 53
66 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper); 54 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper);
67 }; 55 };
68 56
69 } // namespace content 57 } // namespace content
70 58
71 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ 59 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/browser/browser_plugin/browser_plugin_guest_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698