OLD | NEW |
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 "webkit/glue/plugins/pepper_scrollbar.h" | 5 #include "webkit/glue/plugins/pepper_scrollbar.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
10 #include "third_party/ppapi/c/dev/ppp_scrollbar_dev.h" | 10 #include "third_party/ppapi/c/dev/ppp_scrollbar_dev.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
13 #include "third_party/WebKit/WebKit/chromium/public/WebScrollbar.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebScrollbar.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
15 #include "webkit/glue/plugins/pepper_event_conversion.h" | 15 #include "webkit/glue/plugins/pepper_event_conversion.h" |
16 #include "webkit/glue/plugins/pepper_image_data.h" | 16 #include "webkit/glue/plugins/pepper_image_data.h" |
17 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 17 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
18 #include "webkit/glue/plugins/pepper_plugin_module.h" | 18 #include "webkit/glue/plugins/pepper_plugin_module.h" |
19 #include "webkit/glue/webkit_glue.h" | 19 #include "webkit/glue/webkit_glue.h" |
20 | 20 |
21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
22 #include "base/win_util.h" | 22 #include "base/win/windows_version.h" |
23 #endif | 23 #endif |
24 | 24 |
25 using WebKit::WebInputEvent; | 25 using WebKit::WebInputEvent; |
26 using WebKit::WebRect; | 26 using WebKit::WebRect; |
27 using WebKit::WebScrollbar; | 27 using WebKit::WebScrollbar; |
28 | 28 |
29 namespace pepper { | 29 namespace pepper { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 gfx::Rect gfx_rect(rect->point.x, | 157 gfx::Rect gfx_rect(rect->point.x, |
158 rect->point.y, | 158 rect->point.y, |
159 rect->size.width, | 159 rect->size.width, |
160 rect->size.height); | 160 rect->size.height); |
161 skia::PlatformCanvas* canvas = image->mapped_canvas(); | 161 skia::PlatformCanvas* canvas = image->mapped_canvas(); |
162 if (!canvas) | 162 if (!canvas) |
163 return false; | 163 return false; |
164 scrollbar_->paint(webkit_glue::ToWebCanvas(canvas), gfx_rect); | 164 scrollbar_->paint(webkit_glue::ToWebCanvas(canvas), gfx_rect); |
165 | 165 |
166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
167 if (win_util::GetWinVersion() == win_util::WINVERSION_XP) { | 167 if (base::win::GetVersion() == base::win::VERSION_XP) { |
168 canvas->getTopPlatformDevice().makeOpaque( | 168 canvas->getTopPlatformDevice().makeOpaque( |
169 gfx_rect.x(), gfx_rect.y(), gfx_rect.width(), gfx_rect.height()); | 169 gfx_rect.x(), gfx_rect.y(), gfx_rect.width(), gfx_rect.height()); |
170 } | 170 } |
171 #endif | 171 #endif |
172 | 172 |
173 return true; | 173 return true; |
174 } | 174 } |
175 | 175 |
176 bool Scrollbar::HandleEvent(const PP_InputEvent* event) { | 176 bool Scrollbar::HandleEvent(const PP_InputEvent* event) { |
177 scoped_ptr<WebInputEvent> web_input_event(CreateWebInputEvent(*event)); | 177 scoped_ptr<WebInputEvent> web_input_event(CreateWebInputEvent(*event)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 PP_Rect pp_rect; | 231 PP_Rect pp_rect; |
232 pp_rect.point.x = dirty_.x(); | 232 pp_rect.point.x = dirty_.x(); |
233 pp_rect.point.y = dirty_.y(); | 233 pp_rect.point.y = dirty_.y(); |
234 pp_rect.size.width = dirty_.width(); | 234 pp_rect.size.width = dirty_.width(); |
235 pp_rect.size.height = dirty_.height(); | 235 pp_rect.size.height = dirty_.height(); |
236 dirty_ = gfx::Rect(); | 236 dirty_ = gfx::Rect(); |
237 Invalidate(&pp_rect); | 237 Invalidate(&pp_rect); |
238 } | 238 } |
239 | 239 |
240 } // namespace pepper | 240 } // namespace pepper |
OLD | NEW |