summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ppapi/c/dev/ppb_scrollbar_dev.h30
-rw-r--r--ppapi/c/dev/ppp_scrollbar_dev.h10
-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
-rw-r--r--ppapi/tests/test_scrollbar.cc4
-rw-r--r--ppapi/tests/test_scrollbar.h2
-rw-r--r--ppapi/thunk/ppb_scrollbar_api.h1
-rw-r--r--ppapi/thunk/ppb_scrollbar_thunk.cc12
-rw-r--r--ppapi/thunk/thunk.h4
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc4
-rw-r--r--webkit/plugins/ppapi/ppb_scrollbar_impl.cc83
-rw-r--r--webkit/plugins/ppapi/ppb_scrollbar_impl.h15
-rw-r--r--webkit/plugins/ppapi/resource_creation_impl.cc2
16 files changed, 174 insertions, 21 deletions
diff --git a/ppapi/c/dev/ppb_scrollbar_dev.h b/ppapi/c/dev/ppb_scrollbar_dev.h
index be51b58..bf892a5 100644
--- a/ppapi/c/dev/ppb_scrollbar_dev.h
+++ b/ppapi/c/dev/ppb_scrollbar_dev.h
@@ -23,11 +23,12 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ScrollBy_Dev, 4);
#define PPB_SCROLLBAR_DEV_INTERFACE_0_3 "PPB_Scrollbar(Dev);0.3"
#define PPB_SCROLLBAR_DEV_INTERFACE_0_4 "PPB_Scrollbar(Dev);0.4"
-#define PPB_SCROLLBAR_DEV_INTERFACE PPB_SCROLLBAR_DEV_INTERFACE_0_4
+#define PPB_SCROLLBAR_DEV_INTERFACE_0_5 "PPB_Scrollbar(Dev);0.5"
+#define PPB_SCROLLBAR_DEV_INTERFACE PPB_SCROLLBAR_DEV_INTERFACE_0_5
// The interface for a scrollbar. A scrollbar is a widget, so the functions
// in PPB_Widget can also be used with scrollbar objects.
-struct PPB_Scrollbar_0_4_Dev {
+struct PPB_Scrollbar_0_5_Dev {
// Create a new scrollbar. Returns 0 if the instance is invalid.
PP_Resource (*Create)(PP_Instance instance,
PP_Bool vertical);
@@ -39,6 +40,9 @@ struct PPB_Scrollbar_0_4_Dev {
// Gets the thickness of a scrollbar.
uint32_t (*GetThickness)(PP_Resource resource);
+ // Returns PP_TRUE if the system scrollbar style is an overlap scrollbar.
+ PP_Bool (*IsOverlay)(PP_Resource scrollbar);
+
// Get/set the value of the scrollbar.
uint32_t (*GetValue)(PP_Resource scrollbar);
@@ -64,6 +68,25 @@ struct PPB_Scrollbar_0_4_Dev {
int32_t multiplier);
};
+// Old version without IsOverlay.
+struct PPB_Scrollbar_0_4_Dev {
+ PP_Resource (*Create)(PP_Instance instance,
+ PP_Bool vertical);
+ PP_Bool (*IsScrollbar)(PP_Resource resource);
+ uint32_t (*GetThickness)(PP_Resource resource);
+ uint32_t (*GetValue)(PP_Resource scrollbar);
+ void (*SetValue)(PP_Resource scrollbar,
+ uint32_t value);
+ void (*SetDocumentSize)(PP_Resource scrollbar,
+ uint32_t size);
+ void (*SetTickMarks)(PP_Resource scrollbar,
+ const struct PP_Rect* tick_marks,
+ uint32_t count);
+ void (*ScrollBy)(PP_Resource scrollbar,
+ PP_ScrollBy_Dev unit,
+ int32_t multiplier);
+};
+
// Old version with no resource argument to GetThickness.
struct PPB_Scrollbar_0_3_Dev {
PP_Resource (*Create)(PP_Instance instance,
@@ -83,7 +106,6 @@ struct PPB_Scrollbar_0_3_Dev {
int32_t multiplier);
};
-typedef struct PPB_Scrollbar_0_4_Dev PPB_Scrollbar_Dev;
+typedef struct PPB_Scrollbar_0_5_Dev PPB_Scrollbar_Dev;
#endif /* PPAPI_C_DEV_PPB_SCROLLBAR_DEV_H_ */
-
diff --git a/ppapi/c/dev/ppp_scrollbar_dev.h b/ppapi/c/dev/ppp_scrollbar_dev.h
index 2a8483e..ce0a8f6 100644
--- a/ppapi/c/dev/ppp_scrollbar_dev.h
+++ b/ppapi/c/dev/ppp_scrollbar_dev.h
@@ -5,18 +5,26 @@
#ifndef PPAPI_C_DEV_PPP_SCROLLBAR_DEV_H_
#define PPAPI_C_DEV_PPP_SCROLLBAR_DEV_H_
+#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
// Interface for the plugin to implement when using a scrollbar widget.
-#define PPP_SCROLLBAR_DEV_INTERFACE "PPP_Scrollbar(Dev);0.2"
+#define PPP_SCROLLBAR_DEV_INTERFACE_0_2 "PPP_Scrollbar(Dev);0.2"
+#define PPP_SCROLLBAR_DEV_INTERFACE_0_3 "PPP_Scrollbar(Dev);0.3"
+#define PPP_SCROLLBAR_DEV_INTERFACE PPP_SCROLLBAR_DEV_INTERFACE_0_3
struct PPP_Scrollbar_Dev {
// Informs the instance that the scrollbar's value has changed.
void (*ValueChanged)(PP_Instance instance,
PP_Resource scrollbar,
uint32_t value);
+
+ // Informs the instance that the user has changed the system scrollbar style.
+ void (*OverlayChanged)(PP_Instance instance,
+ PP_Resource scrollbar,
+ PP_Bool overlay);
};
#endif /* PPAPI_C_DEV_PPP_SCROLLBAR_DEV_H_ */
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:
diff --git a/ppapi/tests/test_scrollbar.cc b/ppapi/tests/test_scrollbar.cc
index 2aa658a..3b38dd8 100644
--- a/ppapi/tests/test_scrollbar.cc
+++ b/ppapi/tests/test_scrollbar.cc
@@ -60,3 +60,7 @@ void TestScrollbar::ScrollbarValueChanged(pp::Scrollbar_Dev scrollbar,
if (scrollbar == scrollbar_)
scrollbar_value_changed_ = true;
}
+
+void TestScrollbar::ScrollbarOverlayChanged(pp::Scrollbar_Dev scrollbar,
+ bool type) {
+}
diff --git a/ppapi/tests/test_scrollbar.h b/ppapi/tests/test_scrollbar.h
index 5211f97..a83194d 100644
--- a/ppapi/tests/test_scrollbar.h
+++ b/ppapi/tests/test_scrollbar.h
@@ -26,6 +26,8 @@ class TestScrollbar : public TestCase,
const pp::Rect& dirty_rect);
virtual void ScrollbarValueChanged(pp::Scrollbar_Dev scrollbar,
uint32_t value);
+ virtual void ScrollbarOverlayChanged(pp::Scrollbar_Dev scrollbar,
+ bool type);
pp::Scrollbar_Dev scrollbar_;
bool scrollbar_value_changed_;
diff --git a/ppapi/thunk/ppb_scrollbar_api.h b/ppapi/thunk/ppb_scrollbar_api.h
index 05b3c17..042eec8 100644
--- a/ppapi/thunk/ppb_scrollbar_api.h
+++ b/ppapi/thunk/ppb_scrollbar_api.h
@@ -15,6 +15,7 @@ class PPB_Scrollbar_API {
virtual ~PPB_Scrollbar_API() {}
virtual uint32_t GetThickness() = 0;
+ virtual bool IsOverlay() = 0;
virtual uint32_t GetValue() = 0;
virtual void SetValue(uint32_t value) = 0;
virtual void SetDocumentSize(uint32_t size) = 0;
diff --git a/ppapi/thunk/ppb_scrollbar_thunk.cc b/ppapi/thunk/ppb_scrollbar_thunk.cc
index 7b67db2..6e66483 100644
--- a/ppapi/thunk/ppb_scrollbar_thunk.cc
+++ b/ppapi/thunk/ppb_scrollbar_thunk.cc
@@ -33,6 +33,13 @@ uint32_t GetThickness(PP_Resource scrollbar) {
return enter.object()->GetThickness();
}
+PP_Bool IsOverlay(PP_Resource scrollbar) {
+ EnterScrollbar enter(scrollbar, true);
+ if (enter.failed())
+ return PP_FALSE;
+ return PP_FromBool(enter.object()->IsOverlay());
+}
+
uint32_t GetValue(PP_Resource scrollbar) {
EnterScrollbar enter(scrollbar, true);
if (enter.failed())
@@ -66,10 +73,11 @@ void ScrollBy(PP_Resource scrollbar, PP_ScrollBy_Dev unit, int32_t multiplier) {
enter.object()->ScrollBy(unit, multiplier);
}
-const PPB_Scrollbar_0_4_Dev g_ppb_scrollbar_thunk = {
+const PPB_Scrollbar_0_5_Dev g_ppb_scrollbar_thunk = {
&Create,
&IsScrollbar,
&GetThickness,
+ &IsOverlay,
&GetValue,
&SetValue,
&SetDocumentSize,
@@ -79,7 +87,7 @@ const PPB_Scrollbar_0_4_Dev g_ppb_scrollbar_thunk = {
} // namespace
-const PPB_Scrollbar_0_4_Dev* GetPPB_Scrollbar_Thunk() {
+const PPB_Scrollbar_0_5_Dev* GetPPB_Scrollbar_Thunk() {
return &g_ppb_scrollbar_thunk;
}
diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h
index ac0008e..c7ac742 100644
--- a/ppapi/thunk/thunk.h
+++ b/ppapi/thunk/thunk.h
@@ -40,7 +40,7 @@ struct PPB_LayerCompositor_Dev;
struct PPB_Messaging;
struct PPB_MouseInputEvent;
struct PPB_QueryPolicy_Dev;
-struct PPB_Scrollbar_0_4_Dev;
+struct PPB_Scrollbar_0_5_Dev;
struct PPB_Surface3D_Dev;
struct PPB_Transport_Dev;
struct PPB_URLLoader;
@@ -95,7 +95,7 @@ const PPB_LayerCompositor_Dev* GetPPB_LayerCompositor_Thunk();
const PPB_QueryPolicy_Dev* GetPPB_QueryPolicy_Thunk();
const PPB_Messaging* GetPPB_Messaging_Thunk();
const PPB_MouseInputEvent* GetPPB_MouseInputEvent_Thunk();
-const PPB_Scrollbar_0_4_Dev* GetPPB_Scrollbar_Thunk();
+const PPB_Scrollbar_0_5_Dev* GetPPB_Scrollbar_Thunk();
const PPB_Surface3D_Dev* GetPPB_Surface3D_Thunk();
const PPB_Transport_Dev* GetPPB_Transport_Thunk();
const PPB_URLLoader* GetPPB_URLLoader_Thunk();
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index b33c3a2..a7d7ab3 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -303,9 +303,11 @@ const void* GetInterface(const char* name) {
if (strcmp(name, PPB_QUERY_POLICY_DEV_INTERFACE_0_1) == 0)
return ::ppapi::thunk::GetPPB_QueryPolicy_Thunk();
if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE_0_4) == 0)
- return ::ppapi::thunk::GetPPB_Scrollbar_Thunk();
+ return PPB_Scrollbar_Impl::Get0_4Interface();
if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE_0_3) == 0)
return PPB_Scrollbar_Impl::Get0_3Interface();
+ if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE_0_5) == 0)
+ return ::ppapi::thunk::GetPPB_Scrollbar_Thunk();
if (strcmp(name, PPB_UMA_PRIVATE_INTERFACE) == 0)
return PPB_UMA_Private_Impl::GetInterface();
if (strcmp(name, PPB_URLLOADER_INTERFACE_1_0) == 0)
diff --git a/webkit/plugins/ppapi/ppb_scrollbar_impl.cc b/webkit/plugins/ppapi/ppb_scrollbar_impl.cc
index 1f80c06..92ee61b 100644
--- a/webkit/plugins/ppapi/ppb_scrollbar_impl.cc
+++ b/webkit/plugins/ppapi/ppb_scrollbar_impl.cc
@@ -48,10 +48,14 @@ PP_Bool IsScrollbar(PP_Resource resource) {
return ::ppapi::thunk::GetPPB_Scrollbar_Thunk()->IsScrollbar(resource);
}
-uint32_t GetThickness() {
+uint32_t GetThickness3() {
return WebScrollbar::defaultThickness();
}
+uint32_t GetThickness4(PP_Resource resource) {
+ return ::ppapi::thunk::GetPPB_Scrollbar_Thunk()->GetThickness(resource);
+}
+
uint32_t GetValue(PP_Resource resource) {
return ::ppapi::thunk::GetPPB_Scrollbar_Thunk()->GetValue(resource);
}
@@ -82,7 +86,18 @@ void ScrollBy(PP_Resource resource, PP_ScrollBy_Dev unit, int32_t multiplier) {
const PPB_Scrollbar_0_3_Dev ppb_scrollbar_0_3 = {
&Create,
&IsScrollbar,
- &GetThickness,
+ &GetThickness3,
+ &GetValue,
+ &SetValue,
+ &SetDocumentSize,
+ &SetTickMarks,
+ &ScrollBy
+};
+
+const PPB_Scrollbar_0_4_Dev ppb_scrollbar_0_4 = {
+ &Create,
+ &IsScrollbar,
+ &GetThickness4,
&GetValue,
&SetValue,
&SetDocumentSize,
@@ -92,16 +107,35 @@ const PPB_Scrollbar_0_3_Dev ppb_scrollbar_0_3 = {
} // namespace
-PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PluginInstance* instance, bool vertical)
+// static
+PP_Resource PPB_Scrollbar_Impl::Create(PluginInstance* instance,
+ bool vertical) {
+ scoped_refptr<PPB_Scrollbar_Impl> scrollbar(
+ new PPB_Scrollbar_Impl(instance));
+ scrollbar->Init(vertical);
+ return scrollbar->GetReference();
+}
+
+PPB_Scrollbar_Impl::PPB_Scrollbar_Impl(PluginInstance* instance)
: PPB_Widget_Impl(instance) {
- scrollbar_.reset(WebScrollbar::create(
- static_cast<WebKit::WebScrollbarClient*>(this),
- vertical ? WebScrollbar::Vertical : WebScrollbar::Horizontal));
}
PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() {
}
+void PPB_Scrollbar_Impl::Init(bool vertical) {
+#if defined(WEBSCROLLBAR_SUPPORTS_OVERLAY)
+ scrollbar_.reset(WebScrollbar::createForPlugin(
+ vertical ? WebScrollbar::Vertical : WebScrollbar::Horizontal,
+ instance()->container(),
+ static_cast<WebKit::WebScrollbarClient*>(this)));
+#else
+ scrollbar_.reset(WebScrollbar::create(
+ static_cast<WebKit::WebScrollbarClient*>(this),
+ vertical ? WebScrollbar::Vertical : WebScrollbar::Horizontal));
+#endif
+}
+
PPB_Scrollbar_API* PPB_Scrollbar_Impl::AsPPB_Scrollbar_API() {
return this;
}
@@ -111,10 +145,24 @@ const PPB_Scrollbar_0_3_Dev* PPB_Scrollbar_Impl::Get0_3Interface() {
return &ppb_scrollbar_0_3;
}
+// static
+const PPB_Scrollbar_0_4_Dev* PPB_Scrollbar_Impl::Get0_4Interface() {
+ return &ppb_scrollbar_0_4;
+}
+
uint32_t PPB_Scrollbar_Impl::GetThickness() {
return WebScrollbar::defaultThickness();
}
+bool PPB_Scrollbar_Impl::IsOverlay() {
+// TODO(jam): take this out once WebKit is rolled.
+#if defined(WEBSCROLLBAR_SUPPORTS_OVERLAY)
+ return scrollbar_->isOverlay();
+#else
+ return false;
+#endif
+}
+
uint32_t PPB_Scrollbar_Impl::GetValue() {
return scrollbar_->value();
}
@@ -197,13 +245,32 @@ void PPB_Scrollbar_Impl::valueChanged(WebKit::WebScrollbar* scrollbar) {
const PPP_Scrollbar_Dev* ppp_scrollbar =
static_cast<const PPP_Scrollbar_Dev*>(instance()->module()->
GetPluginInterface(PPP_SCROLLBAR_DEV_INTERFACE));
- if (!ppp_scrollbar)
- return;
+ if (!ppp_scrollbar) {
+ // Try the old version. This is ok because the old interface is a subset of
+ // the new one, and ValueChanged didn't change.
+ ppp_scrollbar =
+ static_cast<const PPP_Scrollbar_Dev*>(instance()->module()->
+ GetPluginInterface(PPP_SCROLLBAR_DEV_INTERFACE_0_2));
+ if (!ppp_scrollbar)
+ return;
+ }
ScopedResourceId resource(this);
ppp_scrollbar->ValueChanged(
instance()->pp_instance(), resource.id, scrollbar_->value());
}
+void PPB_Scrollbar_Impl::overlayChanged(WebScrollbar* scrollbar) {
+ const PPP_Scrollbar_Dev* ppp_scrollbar =
+ static_cast<const PPP_Scrollbar_Dev*>(instance()->module()->
+ GetPluginInterface(PPP_SCROLLBAR_DEV_INTERFACE));
+ if (!ppp_scrollbar)
+ return;
+ ScopedResourceId resource(this);
+ ppp_scrollbar->OverlayChanged(
+ instance()->pp_instance(), resource.id,
+ PP_FromBool(IsOverlay()));
+}
+
void PPB_Scrollbar_Impl::invalidateScrollbarRect(
WebKit::WebScrollbar* scrollbar,
const WebKit::WebRect& rect) {
diff --git a/webkit/plugins/ppapi/ppb_scrollbar_impl.h b/webkit/plugins/ppapi/ppb_scrollbar_impl.h
index 5712a02..81011b5 100644
--- a/webkit/plugins/ppapi/ppb_scrollbar_impl.h
+++ b/webkit/plugins/ppapi/ppb_scrollbar_impl.h
@@ -22,7 +22,9 @@ class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
public ::ppapi::thunk::PPB_Scrollbar_API,
public WebKit::WebScrollbarClient {
public:
- PPB_Scrollbar_Impl(PluginInstance* instance, bool vertical);
+ static PP_Resource Create(PluginInstance* instance,
+ bool vertical);
+
virtual ~PPB_Scrollbar_Impl();
// ResourceObjectBase override.
@@ -33,8 +35,14 @@ class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
// version of this API.
static const PPB_Scrollbar_0_3_Dev* Get0_3Interface();
+ // Returns a pointer to the interface implementing PPB_Scrollbar_0_4 that is
+ // exposed to the plugin. New code should use the thunk system for the new
+ // version of this API.
+ static const PPB_Scrollbar_0_4_Dev* Get0_4Interface();
+
// PPB_Scrollbar_API implementation.
virtual uint32_t GetThickness() OVERRIDE;
+ virtual bool IsOverlay() OVERRIDE;
virtual uint32_t GetValue() OVERRIDE;
virtual void SetValue(uint32_t value) OVERRIDE;
virtual void SetDocumentSize(uint32_t size) OVERRIDE;
@@ -42,6 +50,9 @@ class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
virtual void ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) OVERRIDE;
private:
+ PPB_Scrollbar_Impl(PluginInstance* instance);
+ void Init(bool vertical);
+
// PPB_Widget private implementation.
virtual PP_Bool PaintInternal(const gfx::Rect& rect,
PPB_ImageData_Impl* image) OVERRIDE;
@@ -51,6 +62,8 @@ class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
// WebKit::WebScrollbarClient implementation.
virtual void valueChanged(WebKit::WebScrollbar* scrollbar) OVERRIDE;
+ // TODO(jam): add OVERRIDE once WebKit is rolled
+ virtual void overlayChanged(WebKit::WebScrollbar* scrollbar);
virtual void invalidateScrollbarRect(WebKit::WebScrollbar* scrollbar,
const WebKit::WebRect& rect) OVERRIDE;
virtual void getTickmarks(
diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc
index 42251fdf..472d043 100644
--- a/webkit/plugins/ppapi/resource_creation_impl.cc
+++ b/webkit/plugins/ppapi/resource_creation_impl.cc
@@ -261,7 +261,7 @@ PP_Resource ResourceCreationImpl::CreateMouseInputEvent(
PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance,
PP_Bool vertical) {
- return ReturnResource(new PPB_Scrollbar_Impl(instance_, PP_ToBool(vertical)));
+ return PPB_Scrollbar_Impl::Create(instance_, PP_ToBool(vertical));
}
PP_Resource ResourceCreationImpl::CreateSurface3D(