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

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

Issue 2832883003: Remove unneeded Convert* methods and move many from FrameViewBase to FrameView (Closed)
Patch Set: remove scrollbar convert methods Created 3 years, 8 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 // Non-overlay scrollbars should always participate in hit testing. 562 // Non-overlay scrollbars should always participate in hit testing.
563 if (!IsOverlayScrollbar()) 563 if (!IsOverlayScrollbar())
564 return true; 564 return true;
565 return !scrollable_area_->ScrollbarsHidden(); 565 return !scrollable_area_->ScrollbarsHidden();
566 } 566 }
567 567
568 bool Scrollbar::IsWindowActive() const { 568 bool Scrollbar::IsWindowActive() const {
569 return scrollable_area_ && scrollable_area_->IsActive(); 569 return scrollable_area_ && scrollable_area_->IsActive();
570 } 570 }
571 571
572 IntRect Scrollbar::ConvertToContainingFrameViewBase( 572 IntPoint Scrollbar::ConvertFromRootFrame(
573 const IntRect& local_rect) const { 573 const IntPoint& point_in_root_frame) const {
574 if (scrollable_area_) { 574 if (const FrameViewBase* parent = Parent()) {
575 return scrollable_area_->ConvertFromScrollbarToContainingFrameViewBase( 575 IntPoint parent_point = parent->ConvertFromRootFrame(point_in_root_frame);
576 *this, local_rect); 576 if (scrollable_area_) {
577 return scrollable_area_->ConvertFromContainingFrameViewBaseToScrollbar(
578 *this, parent_point);
579 }
577 } 580 }
578 581
579 return FrameViewBase::ConvertToContainingFrameViewBase(local_rect); 582 return point_in_root_frame;
580 }
581
582 IntRect Scrollbar::ConvertFromContainingFrameViewBase(
583 const IntRect& parent_rect) const {
584 if (scrollable_area_) {
585 return scrollable_area_->ConvertFromContainingFrameViewBaseToScrollbar(
586 *this, parent_rect);
587 }
588
589 return FrameViewBase::ConvertFromContainingFrameViewBase(parent_rect);
590 }
591
592 IntPoint Scrollbar::ConvertToContainingFrameViewBase(
593 const IntPoint& local_point) const {
594 if (scrollable_area_) {
595 return scrollable_area_->ConvertFromScrollbarToContainingFrameViewBase(
596 *this, local_point);
597 }
598
599 return FrameViewBase::ConvertToContainingFrameViewBase(local_point);
600 }
601
602 IntPoint Scrollbar::ConvertFromContainingFrameViewBase(
603 const IntPoint& parent_point) const {
604 if (scrollable_area_) {
605 return scrollable_area_->ConvertFromContainingFrameViewBaseToScrollbar(
606 *this, parent_point);
607 }
608
609 return FrameViewBase::ConvertFromContainingFrameViewBase(parent_point);
610 } 583 }
611 584
612 float Scrollbar::ScrollableAreaCurrentPos() const { 585 float Scrollbar::ScrollableAreaCurrentPos() const {
613 if (!scrollable_area_) 586 if (!scrollable_area_)
614 return 0; 587 return 0;
615 588
616 if (orientation_ == kHorizontalScrollbar) { 589 if (orientation_ == kHorizontalScrollbar) {
617 return scrollable_area_->GetScrollOffset().Width() - 590 return scrollable_area_->GetScrollOffset().Width() -
618 scrollable_area_->MinimumScrollOffset().Width(); 591 scrollable_area_->MinimumScrollOffset().Width();
619 } 592 }
(...skipping 20 matching lines...) Expand all
640 invalid_parts = kAllParts; 613 invalid_parts = kAllParts;
641 if (invalid_parts & ~kThumbPart) 614 if (invalid_parts & ~kThumbPart)
642 track_needs_repaint_ = true; 615 track_needs_repaint_ = true;
643 if (invalid_parts & kThumbPart) 616 if (invalid_parts & kThumbPart)
644 thumb_needs_repaint_ = true; 617 thumb_needs_repaint_ = true;
645 if (scrollable_area_) 618 if (scrollable_area_)
646 scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation()); 619 scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation());
647 } 620 }
648 621
649 } // namespace blink 622 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698