OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 FloatRect VisualViewport::visibleRect() const | 144 FloatRect VisualViewport::visibleRect() const |
145 { | 145 { |
146 return FloatRect(location(), visibleSize()); | 146 return FloatRect(location(), visibleSize()); |
147 } | 147 } |
148 | 148 |
149 FloatRect VisualViewport::visibleRectInDocument() const | 149 FloatRect VisualViewport::visibleRectInDocument() const |
150 { | 150 { |
151 if (!mainFrame() || !mainFrame()->view()) | 151 if (!mainFrame() || !mainFrame()->view()) |
152 return FloatRect(); | 152 return FloatRect(); |
153 | 153 |
154 FloatPoint viewLocation = FloatPoint(mainFrame()->view()->scrollableArea()->
scrollPositionDouble()); | 154 FloatPoint viewLocation = FloatPoint(mainFrame()->view()->getScrollableArea(
)->scrollPositionDouble()); |
155 return FloatRect(viewLocation, visibleSize()); | 155 return FloatRect(viewLocation, visibleSize()); |
156 } | 156 } |
157 | 157 |
158 FloatRect VisualViewport::mainViewToViewportCSSPixels(const FloatRect& rect) con
st | 158 FloatRect VisualViewport::mainViewToViewportCSSPixels(const FloatRect& rect) con
st |
159 { | 159 { |
160 // Note, this is in CSS Pixels so we don't apply scale. | 160 // Note, this is in CSS Pixels so we don't apply scale. |
161 FloatRect rectInViewport = rect; | 161 FloatRect rectInViewport = rect; |
162 rectInViewport.moveBy(-location()); | 162 rectInViewport.moveBy(-location()); |
163 return rectInViewport; | 163 return rectInViewport; |
164 } | 164 } |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 return frameHost().settings().scrollAnimatorEnabled(); | 424 return frameHost().settings().scrollAnimatorEnabled(); |
425 } | 425 } |
426 | 426 |
427 void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) con
st | 427 void VisualViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) con
st |
428 { | 428 { |
429 ASSERT(layerTreeView); | 429 ASSERT(layerTreeView); |
430 | 430 |
431 layerTreeView->clearViewportLayers(); | 431 layerTreeView->clearViewportLayers(); |
432 } | 432 } |
433 | 433 |
434 HostWindow* VisualViewport::hostWindow() const | 434 HostWindow* VisualViewport::getHostWindow() const |
435 { | 435 { |
436 return &frameHost().chromeClient(); | 436 return &frameHost().chromeClient(); |
437 } | 437 } |
438 | 438 |
439 DoubleRect VisualViewport::visibleContentRectDouble(IncludeScrollbarsInRect) con
st | 439 DoubleRect VisualViewport::visibleContentRectDouble(IncludeScrollbarsInRect) con
st |
440 { | 440 { |
441 return visibleRect(); | 441 return visibleRect(); |
442 } | 442 } |
443 | 443 |
444 IntRect VisualViewport::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl
usion) const | 444 IntRect VisualViewport::visibleContentRect(IncludeScrollbarsInRect scrollbarIncl
usion) const |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 576 |
577 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph
icsLayerPaintingPhase, const IntRect&) const | 577 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph
icsLayerPaintingPhase, const IntRect&) const |
578 { | 578 { |
579 } | 579 } |
580 | 580 |
581 LocalFrame* VisualViewport::mainFrame() const | 581 LocalFrame* VisualViewport::mainFrame() const |
582 { | 582 { |
583 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL
ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0; | 583 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL
ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0; |
584 } | 584 } |
585 | 585 |
586 Widget* VisualViewport::widget() | 586 Widget* VisualViewport::getWidget() |
587 { | 587 { |
588 return mainFrame()->view(); | 588 return mainFrame()->view(); |
589 } | 589 } |
590 | 590 |
591 FloatPoint VisualViewport::clampOffsetToBoundaries(const FloatPoint& offset) | 591 FloatPoint VisualViewport::clampOffsetToBoundaries(const FloatPoint& offset) |
592 { | 592 { |
593 FloatPoint clampedOffset(offset); | 593 FloatPoint clampedOffset(offset); |
594 clampedOffset = clampedOffset.shrunkTo(FloatPoint(maximumScrollPositionDoubl
e())); | 594 clampedOffset = clampedOffset.shrunkTo(FloatPoint(maximumScrollPositionDoubl
e())); |
595 clampedOffset = clampedOffset.expandedTo(FloatPoint(minimumScrollPositionDou
ble())); | 595 clampedOffset = clampedOffset.expandedTo(FloatPoint(minimumScrollPositionDou
ble())); |
596 return clampedOffset; | 596 return clampedOffset; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } else if (graphicsLayer == m_rootTransformLayer) { | 739 } else if (graphicsLayer == m_rootTransformLayer) { |
740 name = "Root Transform Layer"; | 740 name = "Root Transform Layer"; |
741 } else { | 741 } else { |
742 ASSERT_NOT_REACHED(); | 742 ASSERT_NOT_REACHED(); |
743 } | 743 } |
744 | 744 |
745 return name; | 745 return name; |
746 } | 746 } |
747 | 747 |
748 } // namespace blink | 748 } // namespace blink |
OLD | NEW |