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

Unified Diff: ppapi/cpp/dev/resize_client_dev.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: Redo by adding ScrollbarGroup to pepper and WebKit 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: ppapi/cpp/dev/resize_client_dev.cc
===================================================================
--- ppapi/cpp/dev/resize_client_dev.cc (revision 0)
+++ ppapi/cpp/dev/resize_client_dev.cc (revision 0)
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/dev/resize_client_dev.h"
+
+#include "ppapi/c/dev/ppp_resize_dev.h"
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module.h"
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+// PPP_Resize_Dev --------------------------------------------------------------
+
+const char kPPPResizeInterface[] = PPP_RESIZE_DEV_INTERFACE;
+
+void WillStartLiveResize(PP_Instance instance) {
+ void* object =
+ pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface);
+ if (!object)
+ return;
+ return static_cast<ResizeClient_Dev*>(object)->WillStartLiveResize();
+}
+
+void WillEndLiveResize(PP_Instance instance) {
+ void* object =
+ pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface);
+ if (!object)
+ return;
+ return static_cast<ResizeClient_Dev*>(object)->WillEndLiveResize();
+}
+
+static PPP_Resize_Dev resize_interface = {
+ &WillStartLiveResize,
+ &WillEndLiveResize
+};
+
+} // namespace
+
+ResizeClient_Dev::ResizeClient_Dev(Instance* instance)
+ : associated_instance_(instance) {
+ pp::Module::Get()->AddPluginInterface(kPPPResizeInterface, &resize_interface);
+ associated_instance_->AddPerInstanceObject(kPPPResizeInterface, this);
+}
+
+ResizeClient_Dev::~ResizeClient_Dev() {
+ associated_instance_->RemovePerInstanceObject(kPPPResizeInterface, this);
+}
+
+} // namespace pp
Property changes on: ppapi\cpp\dev\resize_client_dev.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698