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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/dev/resize_client_dev.h"
6
7 #include "ppapi/c/dev/ppp_resize_dev.h"
8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/module.h"
10 #include "ppapi/cpp/module_impl.h"
11
12 namespace pp {
13
14 namespace {
15
16 // PPP_Resize_Dev --------------------------------------------------------------
17
18 const char kPPPResizeInterface[] = PPP_RESIZE_DEV_INTERFACE;
19
20 void WillStartLiveResize(PP_Instance instance) {
21 void* object =
22 pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface);
23 if (!object)
24 return;
25 return static_cast<ResizeClient_Dev*>(object)->WillStartLiveResize();
26 }
27
28 void WillEndLiveResize(PP_Instance instance) {
29 void* object =
30 pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface);
31 if (!object)
32 return;
33 return static_cast<ResizeClient_Dev*>(object)->WillEndLiveResize();
34 }
35
36 static PPP_Resize_Dev resize_interface = {
37 &WillStartLiveResize,
38 &WillEndLiveResize
39 };
40
41 } // namespace
42
43 ResizeClient_Dev::ResizeClient_Dev(Instance* instance)
44 : associated_instance_(instance) {
45 pp::Module::Get()->AddPluginInterface(kPPPResizeInterface, &resize_interface);
46 associated_instance_->AddPerInstanceObject(kPPPResizeInterface, this);
47 }
48
49 ResizeClient_Dev::~ResizeClient_Dev() {
50 associated_instance_->RemovePerInstanceObject(kPPPResizeInterface, this);
51 }
52
53 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698