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

Side by Side Diff: sky/engine/platform/scroll/Scrollbar.cpp

Issue 689283003: Remove scroll corners and resizers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 result = beforeThumbRect; 506 result = beforeThumbRect;
507 else if (part == ForwardTrackPart) 507 else if (part == ForwardTrackPart)
508 result = afterThumbRect; 508 result = afterThumbRect;
509 else 509 else
510 result = thumbRect; 510 result = thumbRect;
511 511
512 result.moveBy(-location()); 512 result.moveBy(-location());
513 invalidateRect(result); 513 invalidateRect(result);
514 } 514 }
515 515
516 void Scrollbar::paintScrollCorner(GraphicsContext* context, const IntRect& corne rRect)
517 {
518 if (cornerRect.isEmpty())
519 return;
520 blink::Platform::current()->themeEngine()->paint(context->canvas(), blink::W ebThemeEngine::PartScrollbarCorner, blink::WebThemeEngine::StateNormal, blink::W ebRect(cornerRect), 0);
521 }
522
523 bool Scrollbar::shouldCenterOnThumb(const PlatformMouseEvent& evt) 516 bool Scrollbar::shouldCenterOnThumb(const PlatformMouseEvent& evt)
524 { 517 {
525 return blink::Platform::current()->scrollbarBehavior()->shouldCenterOnThumb( static_cast<blink::WebScrollbarBehavior::Button>(evt.button()), evt.shiftKey(), evt.altKey()); 518 return blink::Platform::current()->scrollbarBehavior()->shouldCenterOnThumb( static_cast<blink::WebScrollbarBehavior::Button>(evt.button()), evt.shiftKey(), evt.altKey());
526 } 519 }
527 520
528 bool Scrollbar::shouldSnapBackToDragOrigin(const PlatformMouseEvent& evt) 521 bool Scrollbar::shouldSnapBackToDragOrigin(const PlatformMouseEvent& evt)
529 { 522 {
530 IntPoint mousePosition = convertFromContainingView(evt.position()); 523 IntPoint mousePosition = convertFromContainingView(evt.position());
531 mousePosition.move(x(), y()); 524 mousePosition.move(x(), y());
532 return blink::Platform::current()->scrollbarBehavior()->shouldSnapBackToDrag Origin(mousePosition, trackRect(), orientation() == HorizontalScrollbar); 525 return blink::Platform::current()->scrollbarBehavior()->shouldSnapBackToDrag Origin(mousePosition, trackRect(), orientation() == HorizontalScrollbar);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 thumbRect.setWidth(thumbRect.width() - kScrollbarMargin); 617 thumbRect.setWidth(thumbRect.width() - kScrollbarMargin);
625 if (isLeftSideVerticalScrollbar()) 618 if (isLeftSideVerticalScrollbar())
626 thumbRect.setX(thumbRect.x() + kScrollbarMargin); 619 thumbRect.setX(thumbRect.x() + kScrollbarMargin);
627 } 620 }
628 621
629 DEFINE_STATIC_LOCAL(Color, color, (128, 128, 128, 128)); 622 DEFINE_STATIC_LOCAL(Color, color, (128, 128, 128, 128));
630 context->fillRect(thumbRect, color); 623 context->fillRect(thumbRect, color);
631 } 624 }
632 625
633 } // namespace blink 626 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/scroll/Scrollbar.h ('k') | sky/engine/public/platform/WebFallbackThemeEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698