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

Side by Side Diff: webkit/glue/plugins/pepper_plugin_instance.cc

Issue 3145024: Mouse capture. (Closed)
Patch Set: Fixed indent. Created 10 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
« no previous file with comments | « webkit/glue/plugins/pepper_cursor_control.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_instance.h" 5 #include "webkit/glue/plugins/pepper_plugin_instance.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return instance->BindGraphicsDeviceContext(device_id); 153 return instance->BindGraphicsDeviceContext(device_id);
154 } 154 }
155 155
156 bool IsFullFrame(PP_Instance instance_id) { 156 bool IsFullFrame(PP_Instance instance_id) {
157 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); 157 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id);
158 if (!instance) 158 if (!instance)
159 return false; 159 return false;
160 return instance->full_frame(); 160 return instance->full_frame();
161 } 161 }
162 162
163 bool SetCursor(PP_Instance instance_id,
164 PP_CursorType type,
165 PP_Resource custom_image_id,
166 const PP_Point* hot_spot) {
167 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id);
168 if (!instance)
169 return false;
170
171 scoped_refptr<ImageData> custom_image(
172 Resource::GetAs<ImageData>(custom_image_id));
173 if (custom_image.get()) {
174 // TODO: implement custom cursors.
175 NOTIMPLEMENTED();
176 return false;
177 }
178
179 return instance->SetCursor(type);
180 }
181
182 const PPB_Instance ppb_instance = { 163 const PPB_Instance ppb_instance = {
183 &GetWindowObject, 164 &GetWindowObject,
184 &GetOwnerElementObject, 165 &GetOwnerElementObject,
185 &BindGraphicsDeviceContext, 166 &BindGraphicsDeviceContext,
186 &IsFullFrame, 167 &IsFullFrame,
187 &SetCursor,
188 }; 168 };
189 169
190 void NumberOfFindResultsChanged(PP_Instance instance_id, 170 void NumberOfFindResultsChanged(PP_Instance instance_id,
191 int32_t total, 171 int32_t total,
192 bool final_result) { 172 bool final_result) {
193 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); 173 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id);
194 if (!instance) 174 if (!instance)
195 return; 175 return;
196 176
197 DCHECK_NE(instance->find_identifier(), -1); 177 DCHECK_NE(instance->find_identifier(), -1);
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 bounds.size.width = dest_rect.width(); 810 bounds.size.width = dest_rect.width();
831 bounds.size.height = dest_rect.height(); 811 bounds.size.height = dest_rect.height();
832 812
833 CGContextDrawImage(canvas, bounds, image); 813 CGContextDrawImage(canvas, bounds, image);
834 CGContextRestoreGState(canvas); 814 CGContextRestoreGState(canvas);
835 } 815 }
836 #endif // defined(OS_MACOSX) 816 #endif // defined(OS_MACOSX)
837 817
838 818
839 } // namespace pepper 819 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_cursor_control.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698