| OLD | NEW |
| 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 #ifdef _MSC_VER | 5 #ifdef _MSC_VER |
| 6 // Do not warn about use of std::copy with raw pointers. | 6 // Do not warn about use of std::copy with raw pointers. |
| 7 #pragma warning(disable : 4996) | 7 #pragma warning(disable : 4996) |
| 8 #endif | 8 #endif |
| 9 | 9 |
| 10 #include "native_client/src/trusted/plugin/plugin.h" | 10 #include "native_client/src/trusted/plugin/plugin.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "native_client/src/trusted/plugin/nexe_arch.h" | 46 #include "native_client/src/trusted/plugin/nexe_arch.h" |
| 47 #include "native_client/src/trusted/plugin/plugin_error.h" | 47 #include "native_client/src/trusted/plugin/plugin_error.h" |
| 48 #include "native_client/src/trusted/plugin/scriptable_handle.h" | 48 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
| 49 #include "native_client/src/trusted/plugin/service_runtime.h" | 49 #include "native_client/src/trusted/plugin/service_runtime.h" |
| 50 #include "native_client/src/trusted/plugin/string_encoding.h" | 50 #include "native_client/src/trusted/plugin/string_encoding.h" |
| 51 #include "native_client/src/trusted/plugin/utility.h" | 51 #include "native_client/src/trusted/plugin/utility.h" |
| 52 #include "native_client/src/trusted/service_runtime/include/sys/fcntl.h" | 52 #include "native_client/src/trusted/service_runtime/include/sys/fcntl.h" |
| 53 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" | 53 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
| 54 | 54 |
| 55 #include "ppapi/c/dev/ppp_find_dev.h" | 55 #include "ppapi/c/dev/ppp_find_dev.h" |
| 56 #include "ppapi/c/dev/ppp_mouse_lock_dev.h" | |
| 57 #include "ppapi/c/dev/ppp_printing_dev.h" | 56 #include "ppapi/c/dev/ppp_printing_dev.h" |
| 58 #include "ppapi/c/dev/ppp_scrollbar_dev.h" | 57 #include "ppapi/c/dev/ppp_scrollbar_dev.h" |
| 59 #include "ppapi/c/dev/ppp_selection_dev.h" | 58 #include "ppapi/c/dev/ppp_selection_dev.h" |
| 60 #include "ppapi/c/dev/ppp_widget_dev.h" | 59 #include "ppapi/c/dev/ppp_widget_dev.h" |
| 61 #include "ppapi/c/dev/ppp_zoom_dev.h" | 60 #include "ppapi/c/dev/ppp_zoom_dev.h" |
| 62 #include "ppapi/c/pp_errors.h" | 61 #include "ppapi/c/pp_errors.h" |
| 63 #include "ppapi/c/ppp_input_event.h" | 62 #include "ppapi/c/ppp_input_event.h" |
| 64 #include "ppapi/c/ppp_instance.h" | 63 #include "ppapi/c/ppp_instance.h" |
| 64 #include "ppapi/c/ppp_mouse_lock.h" |
| 65 #include "ppapi/c/private/ppb_uma_private.h" | 65 #include "ppapi/c/private/ppb_uma_private.h" |
| 66 #include "ppapi/cpp/dev/find_dev.h" | 66 #include "ppapi/cpp/dev/find_dev.h" |
| 67 #include "ppapi/cpp/dev/mouse_lock_dev.h" | |
| 68 #include "ppapi/cpp/dev/printing_dev.h" | 67 #include "ppapi/cpp/dev/printing_dev.h" |
| 69 #include "ppapi/cpp/dev/scrollbar_dev.h" | 68 #include "ppapi/cpp/dev/scrollbar_dev.h" |
| 70 #include "ppapi/cpp/dev/selection_dev.h" | 69 #include "ppapi/cpp/dev/selection_dev.h" |
| 71 #include "ppapi/cpp/dev/url_util_dev.h" | 70 #include "ppapi/cpp/dev/url_util_dev.h" |
| 72 #include "ppapi/cpp/dev/widget_client_dev.h" | 71 #include "ppapi/cpp/dev/widget_client_dev.h" |
| 73 #include "ppapi/cpp/dev/zoom_dev.h" | 72 #include "ppapi/cpp/dev/zoom_dev.h" |
| 74 #include "ppapi/cpp/image_data.h" | 73 #include "ppapi/cpp/image_data.h" |
| 75 #include "ppapi/cpp/input_event.h" | 74 #include "ppapi/cpp/input_event.h" |
| 76 #include "ppapi/cpp/module.h" | 75 #include "ppapi/cpp/module.h" |
| 76 #include "ppapi/cpp/mouse_lock.h" |
| 77 #include "ppapi/cpp/rect.h" | 77 #include "ppapi/cpp/rect.h" |
| 78 | 78 |
| 79 using ppapi_proxy::BrowserPpp; | 79 using ppapi_proxy::BrowserPpp; |
| 80 | 80 |
| 81 namespace plugin { | 81 namespace plugin { |
| 82 | 82 |
| 83 namespace { | 83 namespace { |
| 84 | 84 |
| 85 bool GetReadyStateProperty(void* obj, SrpcParams* params) { | 85 bool GetReadyStateProperty(void* obj, SrpcParams* params) { |
| 86 Plugin* plugin = static_cast<Plugin*>(obj); | 86 Plugin* plugin = static_cast<Plugin*>(obj); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 private: | 301 private: |
| 302 Plugin* plugin_; | 302 Plugin* plugin_; |
| 303 const PPP_Find_Dev* ppp_find_; | 303 const PPP_Find_Dev* ppp_find_; |
| 304 | 304 |
| 305 NACL_DISALLOW_COPY_AND_ASSIGN(FindAdapter); | 305 NACL_DISALLOW_COPY_AND_ASSIGN(FindAdapter); |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 | 308 |
| 309 // Derive a class from pp::MouseLock_Dev to forward PPP_MouseLock_Dev calls to | 309 // Derive a class from pp::MouseLock to forward PPP_MouseLock calls to |
| 310 // the plugin. | 310 // the plugin. |
| 311 class MouseLockAdapter : public pp::MouseLock_Dev { | 311 class MouseLockAdapter : public pp::MouseLock { |
| 312 public: | 312 public: |
| 313 explicit MouseLockAdapter(Plugin* plugin) | 313 explicit MouseLockAdapter(Plugin* plugin) |
| 314 : pp::MouseLock_Dev(plugin), | 314 : pp::MouseLock(plugin), |
| 315 plugin_(plugin) { | 315 plugin_(plugin) { |
| 316 BrowserPpp* proxy = plugin_->ppapi_proxy(); | 316 BrowserPpp* proxy = plugin_->ppapi_proxy(); |
| 317 CHECK(proxy != NULL); | 317 CHECK(proxy != NULL); |
| 318 ppp_mouse_lock_ = static_cast<const PPP_MouseLock_Dev*>( | 318 ppp_mouse_lock_ = static_cast<const PPP_MouseLock*>( |
| 319 proxy->GetPluginInterface(PPP_MOUSELOCK_DEV_INTERFACE)); | 319 proxy->GetPluginInterface(PPP_MOUSELOCK_INTERFACE)); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void MouseLockLost() { | 322 void MouseLockLost() { |
| 323 if (ppp_mouse_lock_ != NULL) | 323 if (ppp_mouse_lock_ != NULL) |
| 324 ppp_mouse_lock_->MouseLockLost(plugin_->pp_instance()); | 324 ppp_mouse_lock_->MouseLockLost(plugin_->pp_instance()); |
| 325 } | 325 } |
| 326 | 326 |
| 327 private: | 327 private: |
| 328 Plugin* plugin_; | 328 Plugin* plugin_; |
| 329 const PPP_MouseLock_Dev* ppp_mouse_lock_; | 329 const PPP_MouseLock* ppp_mouse_lock_; |
| 330 | 330 |
| 331 NACL_DISALLOW_COPY_AND_ASSIGN(MouseLockAdapter); | 331 NACL_DISALLOW_COPY_AND_ASSIGN(MouseLockAdapter); |
| 332 }; | 332 }; |
| 333 | 333 |
| 334 | 334 |
| 335 // Derive a class from pp::Printing_Dev to forward PPP_Printing_Dev calls to | 335 // Derive a class from pp::Printing_Dev to forward PPP_Printing_Dev calls to |
| 336 // the plugin. | 336 // the plugin. |
| 337 class PrintingAdapter : public pp::Printing_Dev { | 337 class PrintingAdapter : public pp::Printing_Dev { |
| 338 public: | 338 public: |
| 339 explicit PrintingAdapter(Plugin* plugin) | 339 explicit PrintingAdapter(Plugin* plugin) |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 std::string scheme = canonicalized.AsString().substr(comps.scheme.begin, | 2008 std::string scheme = canonicalized.AsString().substr(comps.scheme.begin, |
| 2009 comps.scheme.len); | 2009 comps.scheme.len); |
| 2010 if (scheme == kChromeExtensionUriScheme) | 2010 if (scheme == kChromeExtensionUriScheme) |
| 2011 return SCHEME_CHROME_EXTENSION; | 2011 return SCHEME_CHROME_EXTENSION; |
| 2012 if (scheme == kDataUriScheme) | 2012 if (scheme == kDataUriScheme) |
| 2013 return SCHEME_DATA; | 2013 return SCHEME_DATA; |
| 2014 return SCHEME_OTHER; | 2014 return SCHEME_OTHER; |
| 2015 } | 2015 } |
| 2016 | 2016 |
| 2017 } // namespace plugin | 2017 } // namespace plugin |
| OLD | NEW |