Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 7538006: Pepper and WebKit API change to support a plugin knowing if a scrollbar is an overlay one. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Get rid of ScrollbarGroup's methods and the ResizeClient interface Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 95420)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -61,6 +61,7 @@
#include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h"
#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
#include "webkit/plugins/ppapi/ppb_input_event_impl.h"
+#include "webkit/plugins/ppapi/ppb_scrollbar_group_impl.h"
#include "webkit/plugins/ppapi/ppb_surface_3d_impl.h"
#include "webkit/plugins/ppapi/ppb_url_loader_impl.h"
#include "webkit/plugins/ppapi/ppb_url_request_info_impl.h"
@@ -235,7 +236,8 @@
message_channel_(NULL),
sad_plugin_(NULL),
input_event_mask_(0),
- filtered_input_event_mask_(0) {
+ filtered_input_event_mask_(0),
+ scrollbar_group_(NULL) {
pp_instance_ = ResourceTracker::Get()->AddInstance(this);
memset(&current_print_settings_, 0, sizeof(current_print_settings_));
@@ -441,6 +443,16 @@
// Keep a reference on the stack. See NOTE above.
scoped_refptr<PluginInstance> ref(this);
+ if (scrollbar_group_) {
+ if (event.type == WebInputEvent::MouseEnter) {
+ scrollbar_group_->MouseEnteredContentArea();
+ } else if (event.type == WebInputEvent::MouseMove) {
+ scrollbar_group_->MouseMovedInContentArea();
+ } else if (event.type == WebInputEvent::MouseLeave) {
+ scrollbar_group_->MouseExitedContentArea();
+ }
+ }
+
bool rv = false;
if (LoadInputEventInterface()) {
PP_InputEvent_Class event_class = ClassifyInputEvent(event.type);
@@ -520,6 +532,9 @@
clip_ = clip;
}
+ if (scrollbar_group_)
+ scrollbar_group_->ContentResized();
+
PP_Rect pp_position, pp_clip;
RectToPPRect(position_, &pp_position);
RectToPPRect(clip_, &pp_clip);
@@ -672,6 +687,16 @@
plugin_find_interface_->StopFind(pp_instance());
}
+void PluginInstance::WillStartLiveResize() {
+ if (scrollbar_group_)
+ scrollbar_group_->WillStartLiveResize();
+}
+
+void PluginInstance::WillEndLiveResize() {
+ if (scrollbar_group_)
+ scrollbar_group_->WillEndLiveResize();
+}
+
bool PluginInstance::LoadFindInterface() {
if (!plugin_find_interface_) {
plugin_find_interface_ =
@@ -1332,6 +1357,17 @@
return frame->view()->mainFrame()->document().isPluginDocument();
}
+void PluginInstance::SetScrollbarGroup(
+ PPB_ScrollbarGroup_Impl* scrollbar_group) {
+ if (!IsFullPagePlugin())
+ return;
+
+ // Only handle one scrollbar group for now, i.e. the normal case of one group
+ // for a full-page plugin.
+ DCHECK(!scrollbar_group || !scrollbar_group_);
+ scrollbar_group_ = scrollbar_group;
+}
+
PPB_Instance_FunctionAPI* PluginInstance::AsPPB_Instance_FunctionAPI() {
return this;
}

Powered by Google App Engine
This is Rietveld 408576698