diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 23:22:30 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 23:22:30 +0000 |
commit | a240fd6bb0683f319541155ccddd3e422e180c82 (patch) | |
tree | f764aadadddaffff0d360b3ed0fcd9cedd2d5678 /ppapi/cpp | |
parent | f1c2c71fcc78a5f1740d59b3b5cd8fb7c8018026 (diff) | |
download | chromium_src-a240fd6bb0683f319541155ccddd3e422e180c82.zip chromium_src-a240fd6bb0683f319541155ccddd3e422e180c82.tar.gz chromium_src-a240fd6bb0683f319541155ccddd3e422e180c82.tar.bz2 |
Pepper and WebKit API change to support a plugin knowing if a scrollbar is an overlay one.
BUG=90530
Review URL: http://codereview.chromium.org/7538006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r-- | ppapi/cpp/dev/scrollbar_dev.cc | 7 | ||||
-rw-r--r-- | ppapi/cpp/dev/scrollbar_dev.h | 1 | ||||
-rw-r--r-- | ppapi/cpp/dev/widget_client_dev.cc | 12 | ||||
-rw-r--r-- | ppapi/cpp/dev/widget_client_dev.h | 7 | ||||
-rw-r--r-- | ppapi/cpp/instance.h | 1 |
5 files changed, 27 insertions, 1 deletions
diff --git a/ppapi/cpp/dev/scrollbar_dev.cc b/ppapi/cpp/dev/scrollbar_dev.cc index 1f873c0..dc133a9 100644 --- a/ppapi/cpp/dev/scrollbar_dev.cc +++ b/ppapi/cpp/dev/scrollbar_dev.cc @@ -41,6 +41,13 @@ uint32_t Scrollbar_Dev::GetThickness() { return get_interface<PPB_Scrollbar_Dev>()->GetThickness(pp_resource()); } +bool Scrollbar_Dev::IsOverlay() { + if (!has_interface<PPB_Scrollbar_Dev>()) + return false; + return + PP_ToBool(get_interface<PPB_Scrollbar_Dev>()->IsOverlay(pp_resource())); +} + uint32_t Scrollbar_Dev::GetValue() { if (!has_interface<PPB_Scrollbar_Dev>()) return 0; diff --git a/ppapi/cpp/dev/scrollbar_dev.h b/ppapi/cpp/dev/scrollbar_dev.h index c742a9b..f7944e9 100644 --- a/ppapi/cpp/dev/scrollbar_dev.h +++ b/ppapi/cpp/dev/scrollbar_dev.h @@ -26,6 +26,7 @@ class Scrollbar_Dev : public Widget_Dev { // PPB_Scrollbar methods: uint32_t GetThickness(); + bool IsOverlay(); uint32_t GetValue(); void SetValue(uint32_t value); void SetDocumentSize(uint32_t size); diff --git a/ppapi/cpp/dev/widget_client_dev.cc b/ppapi/cpp/dev/widget_client_dev.cc index 8407810..9f53983 100644 --- a/ppapi/cpp/dev/widget_client_dev.cc +++ b/ppapi/cpp/dev/widget_client_dev.cc @@ -51,8 +51,20 @@ void Scrollbar_ValueChanged(PP_Instance instance, Scrollbar_Dev(scrollbar_id), value); } +void Scrollbar_OverlayChanged(PP_Instance instance, + PP_Resource scrollbar_id, + PP_Bool overlay) { + void* object = + pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface); + if (!object) + return; + return static_cast<WidgetClient_Dev*>(object)->ScrollbarOverlayChanged( + Scrollbar_Dev(scrollbar_id), PP_ToBool(overlay)); +} + static PPP_Scrollbar_Dev scrollbar_interface = { &Scrollbar_ValueChanged, + &Scrollbar_OverlayChanged, }; } // namespace diff --git a/ppapi/cpp/dev/widget_client_dev.h b/ppapi/cpp/dev/widget_client_dev.h index a8910e8..c865621 100644 --- a/ppapi/cpp/dev/widget_client_dev.h +++ b/ppapi/cpp/dev/widget_client_dev.h @@ -35,6 +35,13 @@ class WidgetClient_Dev { virtual void ScrollbarValueChanged(Scrollbar_Dev scrollbar, uint32_t value) = 0; + /** + * Notification that the given scrollbar's overlay type has changed. This is + * the implementation for PPP_Scrollbar_Dev. + */ + virtual void ScrollbarOverlayChanged(Scrollbar_Dev scrollbar, + bool type) = 0; + private: Instance* associated_instance_; }; diff --git a/ppapi/cpp/instance.h b/ppapi/cpp/instance.h index 1f4bba4..caeb669 100644 --- a/ppapi/cpp/instance.h +++ b/ppapi/cpp/instance.h @@ -31,7 +31,6 @@ class Resource; class Surface3D_Dev; class URLLoader; class Var; -class Widget_Dev; class Instance { public: |