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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 3 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) 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 , m_trackNeedsRepaint(true) 60 , m_trackNeedsRepaint(true)
61 , m_thumbNeedsRepaint(true) 61 , m_thumbNeedsRepaint(true)
62 { 62 {
63 m_theme.registerScrollbar(*this); 63 m_theme.registerScrollbar(*this);
64 64
65 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for 65 // FIXME: This is ugly and would not be necessary if we fix cross-platform c ode to actually query for
66 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar 66 // scrollbar thickness and use it when sizing scrollbars (rather than leavin g one dimension of the scrollbar
67 // alone when sizing). 67 // alone when sizing).
68 int thickness = m_theme.scrollbarThickness(controlSize); 68 int thickness = m_theme.scrollbarThickness(controlSize);
69 if (m_hostWindow) 69 if (m_hostWindow)
70 thickness = m_hostWindow->windowToViewportScalar(thickness); 70 thickness = m_hostWindow->windowToViewportScalar(*scrollableArea->getWid get(), thickness);
71 Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); 71 Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
72 72
73 m_currentPos = scrollableAreaCurrentPos(); 73 m_currentPos = scrollableAreaCurrentPos();
74 } 74 }
75 75
76 Scrollbar::~Scrollbar() 76 Scrollbar::~Scrollbar()
77 { 77 {
78 m_theme.unregisterScrollbar(*this); 78 m_theme.unregisterScrollbar(*this);
79 } 79 }
80 80
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 m_enabled = e; 496 m_enabled = e;
497 theme().updateEnabledState(*this); 497 theme().updateEnabledState(*this);
498 setNeedsPaintInvalidation(AllParts); 498 setNeedsPaintInvalidation(AllParts);
499 } 499 }
500 500
501 int Scrollbar::scrollbarThickness() const 501 int Scrollbar::scrollbarThickness() const
502 { 502 {
503 int thickness = orientation() == HorizontalScrollbar ? height() : width(); 503 int thickness = orientation() == HorizontalScrollbar ? height() : width();
504 if (!thickness || !m_hostWindow) 504 if (!thickness || !m_hostWindow)
505 return thickness; 505 return thickness;
506 return m_hostWindow->windowToViewportScalar(m_theme.scrollbarThickness(contr olSize())); 506 return m_hostWindow->windowToViewportScalar(*m_scrollableArea->getWidget(), m_theme.scrollbarThickness(controlSize()));
507 } 507 }
508 508
509 509
510 bool Scrollbar::isOverlayScrollbar() const 510 bool Scrollbar::isOverlayScrollbar() const
511 { 511 {
512 return m_theme.usesOverlayScrollbars(); 512 return m_theme.usesOverlayScrollbars();
513 } 513 }
514 514
515 bool Scrollbar::shouldParticipateInHitTesting() 515 bool Scrollbar::shouldParticipateInHitTesting()
516 { 516 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 invalidParts = AllParts; 590 invalidParts = AllParts;
591 if (invalidParts & ~ThumbPart) 591 if (invalidParts & ~ThumbPart)
592 m_trackNeedsRepaint = true; 592 m_trackNeedsRepaint = true;
593 if (invalidParts & ThumbPart) 593 if (invalidParts & ThumbPart)
594 m_thumbNeedsRepaint = true; 594 m_thumbNeedsRepaint = true;
595 if (m_scrollableArea) 595 if (m_scrollableArea)
596 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 596 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
597 } 597 }
598 598
599 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp ('k') | third_party/WebKit/Source/web/ChromeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698