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

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

Issue 6286070: Remove all uses of the global Dispatcher Get function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/ppb_cursor_control_proxy.h ('k') | ppapi/proxy/ppb_flash_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/ppb_cursor_control_proxy.h" 5 #include "ppapi/proxy/ppb_cursor_control_proxy.h"
6 6
7 #include "ppapi/c/dev/pp_cursor_type_dev.h" 7 #include "ppapi/c/dev/pp_cursor_type_dev.h"
8 #include "ppapi/c/dev/ppb_cursor_control_dev.h" 8 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
9 #include "ppapi/proxy/plugin_dispatcher.h" 9 #include "ppapi/proxy/plugin_dispatcher.h"
10 #include "ppapi/proxy/plugin_resource.h" 10 #include "ppapi/proxy/plugin_resource.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 const PPB_CursorControl_Dev cursor_control_interface = { 93 const PPB_CursorControl_Dev cursor_control_interface = {
94 &SetCursor, 94 &SetCursor,
95 &LockCursor, 95 &LockCursor,
96 &UnlockCursor, 96 &UnlockCursor,
97 &HasCursorLock, 97 &HasCursorLock,
98 &CanLockCursor 98 &CanLockCursor
99 }; 99 };
100 100
101 InterfaceProxy* CreateCursorControlProxy(Dispatcher* dispatcher,
102 const void* target_interface) {
103 return new PPB_CursorControl_Proxy(dispatcher, target_interface);
104 }
105
101 } // namespace 106 } // namespace
102 107
103 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher, 108 PPB_CursorControl_Proxy::PPB_CursorControl_Proxy(Dispatcher* dispatcher,
104 const void* target_interface) 109 const void* target_interface)
105 : InterfaceProxy(dispatcher, target_interface) { 110 : InterfaceProxy(dispatcher, target_interface) {
106 } 111 }
107 112
108 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() { 113 PPB_CursorControl_Proxy::~PPB_CursorControl_Proxy() {
109 } 114 }
110 115
111 const void* PPB_CursorControl_Proxy::GetSourceInterface() const { 116 // static
112 return &cursor_control_interface; 117 const InterfaceProxy::Info* PPB_CursorControl_Proxy::GetInfo() {
113 } 118 static const Info info = {
114 119 &cursor_control_interface,
115 InterfaceID PPB_CursorControl_Proxy::GetInterfaceId() const { 120 PPB_CURSOR_CONTROL_DEV_INTERFACE,
116 return INTERFACE_ID_PPB_CURSORCONTROL; 121 INTERFACE_ID_PPB_CURSORCONTROL,
122 false,
123 &CreateCursorControlProxy,
124 };
125 return &info;
117 } 126 }
118 127
119 bool PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) { 128 bool PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) {
120 bool handled = true; 129 bool handled = true;
121 IPC_BEGIN_MESSAGE_MAP(PPB_CursorControl_Proxy, msg) 130 IPC_BEGIN_MESSAGE_MAP(PPB_CursorControl_Proxy, msg)
122 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_SetCursor, 131 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_SetCursor,
123 OnMsgSetCursor) 132 OnMsgSetCursor)
124 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_LockCursor, 133 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_LockCursor,
125 OnMsgLockCursor) 134 OnMsgLockCursor)
126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_UnlockCursor, 135 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_UnlockCursor,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 *result = ppb_cursor_control_target()->HasCursorLock(instance); 169 *result = ppb_cursor_control_target()->HasCursorLock(instance);
161 } 170 }
162 171
163 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance, 172 void PPB_CursorControl_Proxy::OnMsgCanLockCursor(PP_Instance instance,
164 PP_Bool* result) { 173 PP_Bool* result) {
165 *result = ppb_cursor_control_target()->CanLockCursor(instance); 174 *result = ppb_cursor_control_target()->CanLockCursor(instance);
166 } 175 }
167 176
168 } // namespace proxy 177 } // namespace proxy
169 } // namespace pp 178 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_cursor_control_proxy.h ('k') | ppapi/proxy/ppb_flash_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698