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

Side by Side Diff: chrome/renderer/pepper_scrollbar_widget.cc

Issue 2884016: Chrome side of Pepper v2 scrollbar widget. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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) 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 "chrome/renderer/pepper_scrollbar_widget.h" 5 #include "chrome/renderer/pepper_scrollbar_widget.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/keyboard_codes.h" 8 #include "base/keyboard_codes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 case NPWidgetPropertyScrollbarScrollByPage: 237 case NPWidgetPropertyScrollbarScrollByPage:
238 case NPWidgetPropertyScrollbarScrollByDocument: 238 case NPWidgetPropertyScrollbarScrollByDocument:
239 case NPWidgetPropertyScrollbarScrollByPixels: { 239 case NPWidgetPropertyScrollbarScrollByPixels: {
240 bool forward; 240 bool forward;
241 float multiplier = 1.0; 241 float multiplier = 1.0;
242 242
243 WebScrollbar::ScrollGranularity granularity; 243 WebScrollbar::ScrollGranularity granularity;
244 if (property == NPWidgetPropertyScrollbarScrollByLine) { 244 if (property == NPWidgetPropertyScrollbarScrollByLine) {
245 forward = *static_cast<bool*>(value); 245 forward = *static_cast<bool*>(value);
246 granularity = WebScrollbar::ScrollByLine; 246 granularity = WebScrollbar::ScrollByLine;
247 } else if (property == NPWidgetPropertyScrollbarScrollByLine) { 247 } else if (property == NPWidgetPropertyScrollbarScrollByPage) {
248 forward = *static_cast<bool*>(value); 248 forward = *static_cast<bool*>(value);
249 granularity = WebScrollbar::ScrollByPage; 249 granularity = WebScrollbar::ScrollByPage;
250 } else if (property == NPWidgetPropertyScrollbarScrollByLine) { 250 } else if (property == NPWidgetPropertyScrollbarScrollByDocument) {
251 forward = *static_cast<bool*>(value); 251 forward = *static_cast<bool*>(value);
252 granularity = WebScrollbar::ScrollByDocument; 252 granularity = WebScrollbar::ScrollByDocument;
253 } else { 253 } else {
254 multiplier = static_cast<float>(*static_cast<int32*>(value)); 254 multiplier = static_cast<float>(*static_cast<int32*>(value));
255 forward = multiplier >= 0; 255 forward = multiplier >= 0;
256 if (multiplier < 0) 256 if (multiplier < 0)
257 multiplier *= -1; 257 multiplier *= -1;
258 granularity = WebScrollbar::ScrollByPixel; 258 granularity = WebScrollbar::ScrollByPixel;
259 } 259 }
260 scrollbar_->scroll( 260 scrollbar_->scroll(
(...skipping 29 matching lines...) Expand all
290 tickmarks->assign(rects, 0); 290 tickmarks->assign(rects, 0);
291 } else { 291 } else {
292 tickmarks->assign(&tickmarks_[0], tickmarks_.size()); 292 tickmarks->assign(&tickmarks_[0], tickmarks_.size());
293 } 293 }
294 } 294 }
295 295
296 void PepperScrollbarWidget::NotifyInvalidate() { 296 void PepperScrollbarWidget::NotifyInvalidate() {
297 if (!dirty_rect_.IsEmpty()) 297 if (!dirty_rect_.IsEmpty())
298 WidgetPropertyChanged(NPWidgetPropertyDirtyRect); 298 WidgetPropertyChanged(NPWidgetPropertyDirtyRect);
299 } 299 }
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/plugins/pepper_event_conversion.h » ('j') | webkit/glue/plugins/pepper_scrollbar.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698