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

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

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: Address CL comments. Created 8 years, 4 months 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
OLDNEW
(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 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_GUEST_ROLE_H_
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_GUEST_ROLE_H_
7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "content/browser/browser_plugin/browser_plugin_host_guest_delegate.h"
12 #include "content/browser/browser_plugin/browser_plugin_host_role.h"
13 #include "content/public/browser/render_view_host_observer.h"
14 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/web_contents_observer.h"
16 #include "content/public/browser/notification_registrar.h"
17 #include "ipc/ipc_channel_handle.h"
18 #include "ipc/ipc_sync_message.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
20 #include "ui/surface/transport_dib.h"
21 #include "webkit/glue/webcursor.h"
22
23 namespace gfx {
24 class Size;
25 }
26
27 struct BrowserPluginHostMsg_ResizeGuest_Params;
28 struct ViewHostMsg_UpdateRect_Params;
29
30 namespace content {
31
32 class RenderViewHost;
33
34 // Role for browser plugin guest.
35 // A class having such a role means it is assuming the role of a guest, i.e.
36 // it is contained in an embedder. It overrides different WebContents messages
37 // that require special treatment for a WebContents to act as a guest. All
38 // functionalities are handled by its delegate, this class exists so we have
39 // separation of messages it handles, which can be move to a message filter (IPC
40 // thread) for future optimization.
41 class BrowserPluginHostGuestRole : public BrowserPluginHostRole,
42 public RenderViewHostObserver,
43 public WebContentsObserver {
44 public:
45 BrowserPluginHostGuestRole(int instance_id, WebContentsImpl* web_contents,
46 RenderViewHost* render_view_host);
47 virtual ~BrowserPluginHostGuestRole();
48 BrowserPluginHostGuestDelegate* GetDelegate();
49
50 private:
51 // Message handlers
52 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
53 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type,
54 bool processed);
55 void OnTakeFocus(bool reverse);
56 void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
57 void OnSetCursor(const WebCursor& cursor);
58
59 // RenderViewHostObserver implementation.
60 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
61
62 scoped_ptr<BrowserPluginHostGuestDelegate> delegate_;
63 // A scoped container for notification registries.
64 NotificationRegistrar registrar_;
65
66 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostGuestRole);
67 };
68
69 } // namespace content
70
71 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_GUEST_ROLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698