summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 23:22:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 23:22:30 +0000
commita240fd6bb0683f319541155ccddd3e422e180c82 (patch)
treef764aadadddaffff0d360b3ed0fcd9cedd2d5678 /ppapi/cpp
parentf1c2c71fcc78a5f1740d59b3b5cd8fb7c8018026 (diff)
downloadchromium_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.cc7
-rw-r--r--ppapi/cpp/dev/scrollbar_dev.h1
-rw-r--r--ppapi/cpp/dev/widget_client_dev.cc12
-rw-r--r--ppapi/cpp/dev/widget_client_dev.h7
-rw-r--r--ppapi/cpp/instance.h1
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: