| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 487 } |
| 488 | 488 |
| 489 bool VisualViewport::VisualViewportSuppliesScrollbars() const { | 489 bool VisualViewport::VisualViewportSuppliesScrollbars() const { |
| 490 return GetPage().GetSettings().GetViewportEnabled(); | 490 return GetPage().GetSettings().GetViewportEnabled(); |
| 491 } | 491 } |
| 492 | 492 |
| 493 bool VisualViewport::ScrollAnimatorEnabled() const { | 493 bool VisualViewport::ScrollAnimatorEnabled() const { |
| 494 return GetPage().GetSettings().GetScrollAnimatorEnabled(); | 494 return GetPage().GetSettings().GetScrollAnimatorEnabled(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 HostWindow* VisualViewport::GetHostWindow() const { | 497 PlatformChromeClient* VisualViewport::GetChromeClient() const { |
| 498 return &GetPage().GetChromeClient(); | 498 return &GetPage().GetChromeClient(); |
| 499 } | 499 } |
| 500 | 500 |
| 501 bool VisualViewport::ShouldUseIntegerScrollOffset() const { | 501 bool VisualViewport::ShouldUseIntegerScrollOffset() const { |
| 502 LocalFrame* frame = MainFrame(); | 502 LocalFrame* frame = MainFrame(); |
| 503 if (frame && frame->GetSettings() && | 503 if (frame && frame->GetSettings() && |
| 504 !frame->GetSettings()->GetPreferCompositingToLCDTextEnabled()) | 504 !frame->GetSettings()->GetPreferCompositingToLCDTextEnabled()) |
| 505 return true; | 505 return true; |
| 506 | 506 |
| 507 return ScrollableArea::ShouldUseIntegerScrollOffset(); | 507 return ScrollableArea::ShouldUseIntegerScrollOffset(); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 GraphicsLayerPaintingPhase, | 668 GraphicsLayerPaintingPhase, |
| 669 const IntRect&) const {} | 669 const IntRect&) const {} |
| 670 | 670 |
| 671 LocalFrame* VisualViewport::MainFrame() const { | 671 LocalFrame* VisualViewport::MainFrame() const { |
| 672 return GetPage().MainFrame() && GetPage().MainFrame()->IsLocalFrame() | 672 return GetPage().MainFrame() && GetPage().MainFrame()->IsLocalFrame() |
| 673 ? GetPage().DeprecatedLocalMainFrame() | 673 ? GetPage().DeprecatedLocalMainFrame() |
| 674 : 0; | 674 : 0; |
| 675 } | 675 } |
| 676 | 676 |
| 677 bool VisualViewport::ScheduleAnimation() { | 677 bool VisualViewport::ScheduleAnimation() { |
| 678 if (HostWindow* window = GetHostWindow()) { | 678 if (PlatformChromeClient* client = GetChromeClient()) { |
| 679 window->ScheduleAnimation(MainFrame()); | 679 client->ScheduleAnimation(MainFrame()); |
| 680 return true; | 680 return true; |
| 681 } | 681 } |
| 682 return false; | 682 return false; |
| 683 } | 683 } |
| 684 | 684 |
| 685 void VisualViewport::ClampToBoundaries() { | 685 void VisualViewport::ClampToBoundaries() { |
| 686 SetLocation(FloatPoint(offset_)); | 686 SetLocation(FloatPoint(offset_)); |
| 687 } | 687 } |
| 688 | 688 |
| 689 FloatRect VisualViewport::ViewportToRootFrame( | 689 FloatRect VisualViewport::ViewportToRootFrame( |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 } else if (graphics_layer == root_transform_layer_.get()) { | 852 } else if (graphics_layer == root_transform_layer_.get()) { |
| 853 name = "Root Transform Layer"; | 853 name = "Root Transform Layer"; |
| 854 } else { | 854 } else { |
| 855 ASSERT_NOT_REACHED(); | 855 ASSERT_NOT_REACHED(); |
| 856 } | 856 } |
| 857 | 857 |
| 858 return name; | 858 return name; |
| 859 } | 859 } |
| 860 | 860 |
| 861 } // namespace blink | 861 } // namespace blink |
| OLD | NEW |