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

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

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: @tott + Address comments + fix win_rel trybot flakiness Created 8 years, 3 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 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
6
7 #include "base/time.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/browser/web_contents/web_contents_impl.h"
11 #include "content/common/browser_plugin_messages.h"
12 #include "content/common/view_messages.h"
13 #include "content/public/browser/notification_details.h"
14 #include "content/public/browser/notification_service.h"
15 #include "content/public/browser/notification_source.h"
16 #include "content/public/browser/notification_types.h"
17 #include "content/public/browser/render_process_host.h"
18 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/render_widget_host_view.h"
20 #include "ui/gfx/size.h"
21
22 namespace content {
23
24 BrowserPluginGuestHelper::BrowserPluginGuestHelper(
25 BrowserPluginGuest* guest,
26 RenderViewHost* render_view_host)
27 : RenderViewHostObserver(render_view_host),
28 guest_(guest) {
29 }
30
31 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() {
32 }
33
34 bool BrowserPluginGuestHelper::OnMessageReceived(
35 const IPC::Message& message) {
36 bool handled = true;
37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
38 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
39 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck)
40 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
41 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
42 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
43 IPC_MESSAGE_UNHANDLED(handled = false)
44 IPC_END_MESSAGE_MAP()
45 return handled;
46 }
47
48 void BrowserPluginGuestHelper::OnUpdateRect(
49 const ViewHostMsg_UpdateRect_Params& params) {
50 guest_->UpdateRect(render_view_host(), params);
51 }
52
53 void BrowserPluginGuestHelper::OnHandleInputEventAck(
54 WebKit::WebInputEvent::Type event_type,
55 bool processed) {
56 guest_->HandleInputEventAck(render_view_host(), processed);
57 }
58
59 void BrowserPluginGuestHelper::OnTakeFocus(bool reverse) {
60 guest_->ViewTakeFocus(reverse);
61 }
62
63 void BrowserPluginGuestHelper::OnShowWidget(int route_id,
64 const gfx::Rect& initial_pos) {
65 guest_->ShowWidget(render_view_host(), route_id, initial_pos);
66 }
67
68 void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) {
69 guest_->SetCursor(cursor);
70 }
71
72 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698