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

Side by Side Diff: ppapi/cpp/dev/widget_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: sync and take out WebKit changes 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
« no previous file with comments | « ppapi/cpp/dev/widget_client_dev.h ('k') | ppapi/cpp/instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/cpp/dev/widget_client_dev.h" 5 #include "ppapi/cpp/dev/widget_client_dev.h"
6 6
7 #include "ppapi/c/dev/ppp_scrollbar_dev.h" 7 #include "ppapi/c/dev/ppp_scrollbar_dev.h"
8 #include "ppapi/c/dev/ppp_widget_dev.h" 8 #include "ppapi/c/dev/ppp_widget_dev.h"
9 #include "ppapi/cpp/dev/scrollbar_dev.h" 9 #include "ppapi/cpp/dev/scrollbar_dev.h"
10 #include "ppapi/cpp/dev/widget_dev.h" 10 #include "ppapi/cpp/dev/widget_dev.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 PP_Resource scrollbar_id, 44 PP_Resource scrollbar_id,
45 uint32_t value) { 45 uint32_t value) {
46 void* object = 46 void* object =
47 pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface); 47 pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
48 if (!object) 48 if (!object)
49 return; 49 return;
50 return static_cast<WidgetClient_Dev*>(object)->ScrollbarValueChanged( 50 return static_cast<WidgetClient_Dev*>(object)->ScrollbarValueChanged(
51 Scrollbar_Dev(scrollbar_id), value); 51 Scrollbar_Dev(scrollbar_id), value);
52 } 52 }
53 53
54 void Scrollbar_OverlayChanged(PP_Instance instance,
55 PP_Resource scrollbar_id,
56 PP_Bool overlay) {
57 void* object =
58 pp::Instance::GetPerInstanceObject(instance, kPPPScrollbarInterface);
59 if (!object)
60 return;
61 return static_cast<WidgetClient_Dev*>(object)->ScrollbarOverlayChanged(
62 Scrollbar_Dev(scrollbar_id), PP_ToBool(overlay));
63 }
64
54 static PPP_Scrollbar_Dev scrollbar_interface = { 65 static PPP_Scrollbar_Dev scrollbar_interface = {
55 &Scrollbar_ValueChanged, 66 &Scrollbar_ValueChanged,
67 &Scrollbar_OverlayChanged,
56 }; 68 };
57 69
58 } // namespace 70 } // namespace
59 71
60 WidgetClient_Dev::WidgetClient_Dev(Instance* instance) 72 WidgetClient_Dev::WidgetClient_Dev(Instance* instance)
61 : associated_instance_(instance) { 73 : associated_instance_(instance) {
62 pp::Module::Get()->AddPluginInterface(kPPPWidgetInterface, &widget_interface); 74 pp::Module::Get()->AddPluginInterface(kPPPWidgetInterface, &widget_interface);
63 associated_instance_->AddPerInstanceObject(kPPPWidgetInterface, this); 75 associated_instance_->AddPerInstanceObject(kPPPWidgetInterface, this);
64 pp::Module::Get()->AddPluginInterface(kPPPScrollbarInterface, 76 pp::Module::Get()->AddPluginInterface(kPPPScrollbarInterface,
65 &scrollbar_interface); 77 &scrollbar_interface);
66 associated_instance_->AddPerInstanceObject(kPPPScrollbarInterface, this); 78 associated_instance_->AddPerInstanceObject(kPPPScrollbarInterface, this);
67 } 79 }
68 80
69 WidgetClient_Dev::~WidgetClient_Dev() { 81 WidgetClient_Dev::~WidgetClient_Dev() {
70 associated_instance_->RemovePerInstanceObject(kPPPScrollbarInterface, this); 82 associated_instance_->RemovePerInstanceObject(kPPPScrollbarInterface, this);
71 associated_instance_->RemovePerInstanceObject(kPPPWidgetInterface, this); 83 associated_instance_->RemovePerInstanceObject(kPPPWidgetInterface, this);
72 } 84 }
73 85
74 } // namespace pp 86 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/widget_client_dev.h ('k') | ppapi/cpp/instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698