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

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

Issue 8333004: Rename InterfaceID to ApiID and move the file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 years, 2 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_messaging_proxy.cc ('k') | ppapi/proxy/ppp_video_decoder_proxy.cc » ('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/ppp_mouse_lock.h" 7 #include "ppapi/c/ppp_mouse_lock.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
11 namespace ppapi { 11 namespace ppapi {
12 namespace proxy { 12 namespace proxy {
13 13
14 namespace { 14 namespace {
15 15
16 void MouseLockLost(PP_Instance instance) { 16 void MouseLockLost(PP_Instance instance) {
17 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); 17 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
18 if (!dispatcher) { 18 if (!dispatcher) {
19 // The dispatcher should always be valid. 19 // The dispatcher should always be valid.
20 NOTREACHED(); 20 NOTREACHED();
21 return; 21 return;
22 } 22 }
23 23
24 dispatcher->Send(new PpapiMsg_PPPMouseLock_MouseLockLost( 24 dispatcher->Send(new PpapiMsg_PPPMouseLock_MouseLockLost(
25 INTERFACE_ID_PPP_MOUSE_LOCK, instance)); 25 API_ID_PPP_MOUSE_LOCK, instance));
26 } 26 }
27 27
28 static const PPP_MouseLock mouse_lock_interface = { 28 static const PPP_MouseLock 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 return new PPP_MouseLock_Proxy(dispatcher);
34 } 34 }
35 35
36 } // namespace 36 } // namespace
37 37
38 PPP_MouseLock_Proxy::PPP_MouseLock_Proxy(Dispatcher* dispatcher) 38 PPP_MouseLock_Proxy::PPP_MouseLock_Proxy(Dispatcher* dispatcher)
39 : InterfaceProxy(dispatcher) { 39 : InterfaceProxy(dispatcher) {
40 if (dispatcher->IsPlugin()) { 40 if (dispatcher->IsPlugin()) {
41 ppp_mouse_lock_impl_ = static_cast<const PPP_MouseLock*>( 41 ppp_mouse_lock_impl_ = static_cast<const PPP_MouseLock*>(
42 dispatcher->local_get_interface()(PPP_MOUSELOCK_INTERFACE)); 42 dispatcher->local_get_interface()(PPP_MOUSELOCK_INTERFACE));
43 } 43 }
44 } 44 }
45 45
46 PPP_MouseLock_Proxy::~PPP_MouseLock_Proxy() { 46 PPP_MouseLock_Proxy::~PPP_MouseLock_Proxy() {
47 } 47 }
48 48
49 // static 49 // static
50 const InterfaceProxy::Info* PPP_MouseLock_Proxy::GetInfo() { 50 const InterfaceProxy::Info* PPP_MouseLock_Proxy::GetInfo() {
51 static const Info info = { 51 static const Info info = {
52 &mouse_lock_interface, 52 &mouse_lock_interface,
53 PPP_MOUSELOCK_INTERFACE, 53 PPP_MOUSELOCK_INTERFACE,
54 INTERFACE_ID_PPP_MOUSE_LOCK, 54 API_ID_PPP_MOUSE_LOCK,
55 false, 55 false,
56 &CreateMouseLockProxy, 56 &CreateMouseLockProxy,
57 }; 57 };
58 return &info; 58 return &info;
59 } 59 }
60 60
61 bool PPP_MouseLock_Proxy::OnMessageReceived(const IPC::Message& msg) { 61 bool PPP_MouseLock_Proxy::OnMessageReceived(const IPC::Message& msg) {
62 bool handled = true; 62 bool handled = true;
63 IPC_BEGIN_MESSAGE_MAP(PPP_MouseLock_Proxy, msg) 63 IPC_BEGIN_MESSAGE_MAP(PPP_MouseLock_Proxy, msg)
64 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMouseLock_MouseLockLost, 64 IPC_MESSAGE_HANDLER(PpapiMsg_PPPMouseLock_MouseLockLost,
65 OnMsgMouseLockLost) 65 OnMsgMouseLockLost)
66 IPC_MESSAGE_UNHANDLED(handled = false) 66 IPC_MESSAGE_UNHANDLED(handled = false)
67 IPC_END_MESSAGE_MAP() 67 IPC_END_MESSAGE_MAP()
68 return handled; 68 return handled;
69 } 69 }
70 70
71 void PPP_MouseLock_Proxy::OnMsgMouseLockLost(PP_Instance instance) { 71 void PPP_MouseLock_Proxy::OnMsgMouseLockLost(PP_Instance instance) {
72 if (ppp_mouse_lock_impl_) 72 if (ppp_mouse_lock_impl_)
73 ppp_mouse_lock_impl_->MouseLockLost(instance); 73 ppp_mouse_lock_impl_->MouseLockLost(instance);
74 } 74 }
75 75
76 } // namespace proxy 76 } // namespace proxy
77 } // namespace ppapi 77 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_messaging_proxy.cc ('k') | ppapi/proxy/ppp_video_decoder_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698