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

Side by Side Diff: ppapi/proxy/ppp_mouse_lock_proxy.cc

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppp_mouse_lock_proxy.h ('k') | ppapi/proxy/ppp_video_decoder_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/proxy/ppp_mouse_lock_proxy.h" 5 #include "ppapi/proxy/ppp_mouse_lock_proxy.h"
6 6
7 #include "ppapi/c/dev/ppp_mouse_lock_dev.h" 7 #include "ppapi/c/dev/ppp_mouse_lock_dev.h"
8 #include "ppapi/proxy/host_dispatcher.h" 8 #include "ppapi/proxy/host_dispatcher.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 10
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 dispatcher->Send(new PpapiMsg_PPPMouseLock_MouseLockLost( 24 dispatcher->Send(new PpapiMsg_PPPMouseLock_MouseLockLost(
25 INTERFACE_ID_PPP_MOUSE_LOCK_DEV, instance)); 25 INTERFACE_ID_PPP_MOUSE_LOCK_DEV, instance));
26 } 26 }
27 27
28 static const PPP_MouseLock_Dev mouse_lock_interface = { 28 static const PPP_MouseLock_Dev mouse_lock_interface = {
29 &MouseLockLost 29 &MouseLockLost
30 }; 30 };
31 31
32 InterfaceProxy* CreateMouseLockProxy(Dispatcher* dispatcher) { 32 InterfaceProxy* CreateMouseLockProxy(Dispatcher* dispatcher,
33 return new PPP_MouseLock_Proxy(dispatcher); 33 const void* target_interface) {
34 return new PPP_MouseLock_Proxy(dispatcher, target_interface);
34 } 35 }
35 36
36 } // namespace 37 } // namespace
37 38
38 PPP_MouseLock_Proxy::PPP_MouseLock_Proxy(Dispatcher* dispatcher) 39 PPP_MouseLock_Proxy::PPP_MouseLock_Proxy(Dispatcher* dispatcher,
39 : InterfaceProxy(dispatcher) { 40 const void* target_interface)
40 if (dispatcher->IsPlugin()) { 41 : InterfaceProxy(dispatcher, target_interface) {
41 ppp_mouse_lock_impl_ = static_cast<const PPP_MouseLock_Dev*>(
42 dispatcher->local_get_interface()(PPP_MOUSELOCK_DEV_INTERFACE));
43 }
44 } 42 }
45 43
46 PPP_MouseLock_Proxy::~PPP_MouseLock_Proxy() { 44 PPP_MouseLock_Proxy::~PPP_MouseLock_Proxy() {
47 } 45 }
48 46
49 // static 47 // static
50 const InterfaceProxy::Info* PPP_MouseLock_Proxy::GetInfo() { 48 const InterfaceProxy::Info* PPP_MouseLock_Proxy::GetInfo() {
51 static const Info info = { 49 static const Info info = {
52 &mouse_lock_interface, 50 &mouse_lock_interface,
53 PPP_MOUSELOCK_DEV_INTERFACE, 51 PPP_MOUSELOCK_DEV_INTERFACE,
54 INTERFACE_ID_PPP_MOUSE_LOCK_DEV, 52 INTERFACE_ID_PPP_MOUSE_LOCK_DEV,
55 false, 53 false,
56 &CreateMouseLockProxy, 54 &CreateMouseLockProxy,
57 }; 55 };
58 return &info; 56 return &info;
59 } 57 }
60 58
61 bool PPP_MouseLock_Proxy::OnMessageReceived(const IPC::Message& msg) { 59 bool PPP_MouseLock_Proxy::OnMessageReceived(const IPC::Message& msg) {
62 bool handled = true; 60 bool handled = true;
63 IPC_BEGIN_MESSAGE_MAP(PPP_MouseLock_Proxy, msg) 61 IPC_BEGIN_MESSAGE_MAP(PPP_MouseLock_Proxy, msg)
64 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMouseLock_MouseLockLost, 62 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMouseLock_MouseLockLost,
65 OnMsgMouseLockLost) 63 OnMsgMouseLockLost)
66 IPC_MESSAGE_UNHANDLED(handled = false) 64 IPC_MESSAGE_UNHANDLED(handled = false)
67 IPC_END_MESSAGE_MAP() 65 IPC_END_MESSAGE_MAP()
68 return handled; 66 return handled;
69 } 67 }
70 68
71 void PPP_MouseLock_Proxy::OnMsgMouseLockLost(PP_Instance instance) { 69 void PPP_MouseLock_Proxy::OnMsgMouseLockLost(PP_Instance instance) {
72 if (ppp_mouse_lock_impl_) 70 if (ppp_mouse_lock_target())
73 ppp_mouse_lock_impl_->MouseLockLost(instance); 71 ppp_mouse_lock_target()->MouseLockLost(instance);
74 } 72 }
75 73
76 } // namespace proxy 74 } // namespace proxy
77 } // namespace ppapi 75 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_mouse_lock_proxy.h ('k') | ppapi/proxy/ppp_video_decoder_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698