 Chromium Code Reviews
 Chromium Code Reviews Issue 2927004:
  Hookup Pepper v2 GetSelectedText.  (Closed) 
  Base URL: svn://chrome-svn/chrome/trunk/src/
    
  
    Issue 2927004:
  Hookup Pepper v2 GetSelectedText.  (Closed) 
  Base URL: svn://chrome-svn/chrome/trunk/src/| OLD | NEW | 
|---|---|
| 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/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" | 
| 9 #include "base/utf_string_conversions.h" | |
| 9 #include "gfx/rect.h" | 10 #include "gfx/rect.h" | 
| 10 #include "third_party/ppapi/c/pp_instance.h" | 11 #include "third_party/ppapi/c/pp_instance.h" | 
| 11 #include "third_party/ppapi/c/pp_event.h" | 12 #include "third_party/ppapi/c/pp_event.h" | 
| 12 #include "third_party/ppapi/c/pp_rect.h" | 13 #include "third_party/ppapi/c/pp_rect.h" | 
| 13 #include "third_party/ppapi/c/pp_resource.h" | 14 #include "third_party/ppapi/c/pp_resource.h" | 
| 14 #include "third_party/ppapi/c/pp_var.h" | 15 #include "third_party/ppapi/c/pp_var.h" | 
| 15 #include "third_party/ppapi/c/ppb_instance.h" | 16 #include "third_party/ppapi/c/ppb_instance.h" | 
| 16 #include "third_party/ppapi/c/ppp_instance.h" | 17 #include "third_party/ppapi/c/ppp_instance.h" | 
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" | 
| 20 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 
| 21 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 
| 22 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" | 
| 23 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 24 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 
| 24 #include "webkit/glue/plugins/pepper_device_context_2d.h" | 25 #include "webkit/glue/plugins/pepper_device_context_2d.h" | 
| 25 #include "webkit/glue/plugins/pepper_event_conversion.h" | 26 #include "webkit/glue/plugins/pepper_event_conversion.h" | 
| 26 #include "webkit/glue/plugins/pepper_image_data.h" | 27 #include "webkit/glue/plugins/pepper_image_data.h" | 
| 27 #include "webkit/glue/plugins/pepper_plugin_delegate.h" | 28 #include "webkit/glue/plugins/pepper_plugin_delegate.h" | 
| 28 #include "webkit/glue/plugins/pepper_plugin_module.h" | 29 #include "webkit/glue/plugins/pepper_plugin_module.h" | 
| 30 #include "webkit/glue/plugins/pepper_string.h" | |
| 29 #include "webkit/glue/plugins/pepper_url_loader.h" | 31 #include "webkit/glue/plugins/pepper_url_loader.h" | 
| 30 #include "webkit/glue/plugins/pepper_var.h" | 32 #include "webkit/glue/plugins/pepper_var.h" | 
| 31 | 33 | 
| 32 using WebKit::WebCanvas; | 34 using WebKit::WebCanvas; | 
| 33 using WebKit::WebCursorInfo; | 35 using WebKit::WebCursorInfo; | 
| 34 using WebKit::WebFrame; | 36 using WebKit::WebFrame; | 
| 35 using WebKit::WebInputEvent; | 37 using WebKit::WebInputEvent; | 
| 36 using WebKit::WebPluginContainer; | 38 using WebKit::WebPluginContainer; | 
| 37 | 39 | 
| 38 namespace pepper { | 40 namespace pepper { | 
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 if (device_context_2d_) | 330 if (device_context_2d_) | 
| 329 device_context_2d_->ViewInitiatedPaint(); | 331 device_context_2d_->ViewInitiatedPaint(); | 
| 330 } | 332 } | 
| 331 | 333 | 
| 332 void PluginInstance::ViewFlushedPaint() { | 334 void PluginInstance::ViewFlushedPaint() { | 
| 333 if (device_context_2d_) | 335 if (device_context_2d_) | 
| 334 device_context_2d_->ViewFlushedPaint(); | 336 device_context_2d_->ViewFlushedPaint(); | 
| 335 } | 337 } | 
| 336 | 338 | 
| 337 string16 PluginInstance::GetSelectedText(bool html) { | 339 string16 PluginInstance::GetSelectedText(bool html) { | 
| 338 // TODO: implement me | 340 PP_Var rv = instance_interface_->GetSelectedText(GetPPInstance(), html); | 
| 339 return string16(); | 341 String* string = GetString(rv); | 
| 342 if (!string) | |
| 343 return string16(); | |
| 344 return string16(UTF8ToUTF16(string->value())); | |
| 
darin (slow to review)
2010/07/09 07:24:52
UTF8ToUTF16 already returns string16, so it should
 | |
| 340 } | 345 } | 
| 341 | 346 | 
| 342 void PluginInstance::Zoom(float factor, bool text_only) { | 347 void PluginInstance::Zoom(float factor, bool text_only) { | 
| 343 // TODO: implement me | 348 // TODO: implement me | 
| 344 } | 349 } | 
| 345 | 350 | 
| 346 bool PluginInstance::SupportsFind() { | 351 bool PluginInstance::SupportsFind() { | 
| 347 // TODO: implement me | 352 // TODO: implement me | 
| 348 return false; | 353 return false; | 
| 349 } | 354 } | 
| 350 | 355 | 
| 351 void PluginInstance::StartFind(const string16& search_text, | 356 void PluginInstance::StartFind(const string16& search_text, | 
| 352 bool case_sensitive, | 357 bool case_sensitive, | 
| 353 int identifier) { | 358 int identifier) { | 
| 354 find_identifier_ = identifier; | 359 find_identifier_ = identifier; | 
| 355 // TODO: implement me | 360 // TODO: implement me | 
| 356 } | 361 } | 
| 357 | 362 | 
| 358 void PluginInstance::SelectFindResult(bool forward) { | 363 void PluginInstance::SelectFindResult(bool forward) { | 
| 359 // TODO: implement me | 364 // TODO: implement me | 
| 360 } | 365 } | 
| 361 | 366 | 
| 362 void PluginInstance::StopFind() { | 367 void PluginInstance::StopFind() { | 
| 363 find_identifier_ = -1; | 368 find_identifier_ = -1; | 
| 364 // TODO: implement me | 369 // TODO: implement me | 
| 365 } | 370 } | 
| 366 | 371 | 
| 367 } // namespace pepper | 372 } // namespace pepper | 
| OLD | NEW |