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

Side by Side Diff: Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp

Issue 14707008: Remove WebKit::GraphicsContextBuilder, which was trivial. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Undo whitespace change Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 19 matching lines...) Expand all
30 #include "WebInputEventConversion.h" 30 #include "WebInputEventConversion.h"
31 #include "WebPluginContainerImpl.h" 31 #include "WebPluginContainerImpl.h"
32 #include "WebPluginScrollbarClient.h" 32 #include "WebPluginScrollbarClient.h"
33 #include "WebViewImpl.h" 33 #include "WebViewImpl.h"
34 #include "core/platform/ScrollAnimator.h" 34 #include "core/platform/ScrollAnimator.h"
35 #include "core/platform/ScrollTypes.h" 35 #include "core/platform/ScrollTypes.h"
36 #include "core/platform/Scrollbar.h" 36 #include "core/platform/Scrollbar.h"
37 #include "core/platform/ScrollbarTheme.h" 37 #include "core/platform/ScrollbarTheme.h"
38 #include "core/platform/chromium/KeyboardCodes.h" 38 #include "core/platform/chromium/KeyboardCodes.h"
39 #include "core/platform/graphics/GraphicsContext.h" 39 #include "core/platform/graphics/GraphicsContext.h"
40 #include "painting/GraphicsContextBuilder.h"
41 #include <public/WebCanvas.h> 40 #include <public/WebCanvas.h>
42 #include <public/WebRect.h> 41 #include <public/WebRect.h>
43 #include <public/WebVector.h> 42 #include <public/WebVector.h>
44 43
45 using namespace std; 44 using namespace std;
46 using namespace WebCore; 45 using namespace WebCore;
47 46
48 namespace WebKit { 47 namespace WebKit {
49 48
50 WebPluginScrollbar* WebPluginScrollbar::createForPlugin(Orientation orientation, 49 WebPluginScrollbar* WebPluginScrollbar::createForPlugin(Orientation orientation,
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if (direction == ScrollForward) 227 if (direction == ScrollForward)
229 dir = horizontal ? ScrollRight : ScrollDown; 228 dir = horizontal ? ScrollRight : ScrollDown;
230 else 229 else
231 dir = horizontal ? ScrollLeft : ScrollUp; 230 dir = horizontal ? ScrollLeft : ScrollUp;
232 231
233 m_group->scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), m ultiplier); 232 m_group->scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), m ultiplier);
234 } 233 }
235 234
236 void WebPluginScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect) 235 void WebPluginScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect)
237 { 236 {
238 m_scrollbar->paint(&GraphicsContextBuilder(canvas).context(), rect); 237 GraphicsContext context(canvas);
238 m_scrollbar->paint(&context, rect);
239 } 239 }
240 240
241 bool WebPluginScrollbarImpl::handleInputEvent(const WebInputEvent& event) 241 bool WebPluginScrollbarImpl::handleInputEvent(const WebInputEvent& event)
242 { 242 {
243 switch (event.type) { 243 switch (event.type) {
244 case WebInputEvent::MouseDown: 244 case WebInputEvent::MouseDown:
245 return onMouseDown(event); 245 return onMouseDown(event);
246 case WebInputEvent::MouseUp: 246 case WebInputEvent::MouseUp:
247 return onMouseUp(event); 247 return onMouseUp(event);
248 case WebInputEvent::MouseMove: 248 case WebInputEvent::MouseMove:
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 WebCore::ScrollDirection scrollDirection; 362 WebCore::ScrollDirection scrollDirection;
363 WebCore::ScrollGranularity scrollGranularity; 363 WebCore::ScrollGranularity scrollGranularity;
364 if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranu larity)) { 364 if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranu larity)) {
365 // Will return false if scroll direction wasn't compatible with this scr ollbar. 365 // Will return false if scroll direction wasn't compatible with this scr ollbar.
366 return m_group->scroll(scrollDirection, scrollGranularity); 366 return m_group->scroll(scrollDirection, scrollGranularity);
367 } 367 }
368 return false; 368 return false;
369 } 369 }
370 370
371 } // namespace WebKit 371 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebFrameImpl.cpp ('k') | Source/WebKit/chromium/src/WebPopupMenuImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698