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

Side by Side Diff: webkit/plugins/ppapi/ppb_scrollbar_impl.h

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix self-assignment 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/task.h" 10 #include "base/task.h"
11 #include "ppapi/thunk/ppb_scrollbar_api.h" 11 #include "ppapi/thunk/ppb_scrollbar_api.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScrollbarClient.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScrollbarClient.h"
14 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
15 #include "webkit/plugins/ppapi/ppb_widget_impl.h" 15 #include "webkit/plugins/ppapi/ppb_widget_impl.h"
16 16
17 namespace webkit { 17 namespace webkit {
18 namespace ppapi { 18 namespace ppapi {
19 19
20 class PluginInstance;
21
22 class PPB_Scrollbar_Impl : public PPB_Widget_Impl, 20 class PPB_Scrollbar_Impl : public PPB_Widget_Impl,
23 public ::ppapi::thunk::PPB_Scrollbar_API, 21 public ::ppapi::thunk::PPB_Scrollbar_API,
24 public WebKit::WebScrollbarClient { 22 public WebKit::WebScrollbarClient {
25 public: 23 public:
26 static PP_Resource Create(PluginInstance* instance, 24 static PP_Resource Create(PP_Instance instance, bool vertical);
27 bool vertical);
28 25
29 virtual ~PPB_Scrollbar_Impl(); 26 virtual ~PPB_Scrollbar_Impl();
30 27
31 // Resource override. 28 // Resource override.
32 virtual PPB_Scrollbar_API* AsPPB_Scrollbar_API() OVERRIDE; 29 virtual PPB_Scrollbar_API* AsPPB_Scrollbar_API() OVERRIDE;
33 30
34 // Returns a pointer to the interface implementing PPB_Scrollbar_0_3 that is 31 // Returns a pointer to the interface implementing PPB_Scrollbar_0_3 that is
35 // exposed to the plugin. New code should use the thunk system for the new 32 // exposed to the plugin. New code should use the thunk system for the new
36 // version of this API. 33 // version of this API.
37 static const PPB_Scrollbar_0_3_Dev* Get0_3Interface(); 34 static const PPB_Scrollbar_0_3_Dev* Get0_3Interface();
38 35
39 // Returns a pointer to the interface implementing PPB_Scrollbar_0_4 that is 36 // Returns a pointer to the interface implementing PPB_Scrollbar_0_4 that is
40 // exposed to the plugin. New code should use the thunk system for the new 37 // exposed to the plugin. New code should use the thunk system for the new
41 // version of this API. 38 // version of this API.
42 static const PPB_Scrollbar_0_4_Dev* Get0_4Interface(); 39 static const PPB_Scrollbar_0_4_Dev* Get0_4Interface();
43 40
44 // PPB_Scrollbar_API implementation. 41 // PPB_Scrollbar_API implementation.
45 virtual uint32_t GetThickness() OVERRIDE; 42 virtual uint32_t GetThickness() OVERRIDE;
46 virtual bool IsOverlay() OVERRIDE; 43 virtual bool IsOverlay() OVERRIDE;
47 virtual uint32_t GetValue() OVERRIDE; 44 virtual uint32_t GetValue() OVERRIDE;
48 virtual void SetValue(uint32_t value) OVERRIDE; 45 virtual void SetValue(uint32_t value) OVERRIDE;
49 virtual void SetDocumentSize(uint32_t size) OVERRIDE; 46 virtual void SetDocumentSize(uint32_t size) OVERRIDE;
50 virtual void SetTickMarks(const PP_Rect* tick_marks, uint32_t count) OVERRIDE; 47 virtual void SetTickMarks(const PP_Rect* tick_marks, uint32_t count) OVERRIDE;
51 virtual void ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) OVERRIDE; 48 virtual void ScrollBy(PP_ScrollBy_Dev unit, int32_t multiplier) OVERRIDE;
52 49
53 private: 50 private:
54 PPB_Scrollbar_Impl(PluginInstance* instance); 51 PPB_Scrollbar_Impl(PP_Instance instance);
viettrungluu 2011/08/23 17:28:13 Could you add an "explicit" as a drive-by?
55 void Init(bool vertical); 52 void Init(bool vertical);
56 53
57 // PPB_Widget private implementation. 54 // PPB_Widget private implementation.
58 virtual PP_Bool PaintInternal(const gfx::Rect& rect, 55 virtual PP_Bool PaintInternal(const gfx::Rect& rect,
59 PPB_ImageData_Impl* image) OVERRIDE; 56 PPB_ImageData_Impl* image) OVERRIDE;
60 virtual PP_Bool HandleEventInternal( 57 virtual PP_Bool HandleEventInternal(
61 const ::ppapi::InputEventData& data) OVERRIDE; 58 const ::ppapi::InputEventData& data) OVERRIDE;
62 virtual void SetLocationInternal(const PP_Rect* location) OVERRIDE; 59 virtual void SetLocationInternal(const PP_Rect* location) OVERRIDE;
63 60
64 // WebKit::WebScrollbarClient implementation. 61 // WebKit::WebScrollbarClient implementation.
(...skipping 14 matching lines...) Expand all
79 // Used so that the post task for Invalidate doesn't keep an extra reference. 76 // Used so that the post task for Invalidate doesn't keep an extra reference.
80 ScopedRunnableMethodFactory<PPB_Scrollbar_Impl> method_factory_; 77 ScopedRunnableMethodFactory<PPB_Scrollbar_Impl> method_factory_;
81 78
82 DISALLOW_COPY_AND_ASSIGN(PPB_Scrollbar_Impl); 79 DISALLOW_COPY_AND_ASSIGN(PPB_Scrollbar_Impl);
83 }; 80 };
84 81
85 } // namespace ppapi 82 } // namespace ppapi
86 } // namespace webkit 83 } // namespace webkit
87 84
88 #endif // WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_ 85 #endif // WEBKIT_PLUGINS_PPAPI_PPB_SCROLLBAR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698