| 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 657 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 return MainFrame()->ScheduleAnimation(GetHostWindow()); | 678 if (HostWindow* window = GetHostWindow()) { |
| 679 window->ScheduleAnimation(MainFrame()); |
| 680 return true; |
| 681 } |
| 682 return false; |
| 679 } | 683 } |
| 680 | 684 |
| 681 void VisualViewport::ClampToBoundaries() { | 685 void VisualViewport::ClampToBoundaries() { |
| 682 SetLocation(FloatPoint(offset_)); | 686 SetLocation(FloatPoint(offset_)); |
| 683 } | 687 } |
| 684 | 688 |
| 685 FloatRect VisualViewport::ViewportToRootFrame( | 689 FloatRect VisualViewport::ViewportToRootFrame( |
| 686 const FloatRect& rect_in_viewport) const { | 690 const FloatRect& rect_in_viewport) const { |
| 687 FloatRect rect_in_root_frame = rect_in_viewport; | 691 FloatRect rect_in_root_frame = rect_in_viewport; |
| 688 rect_in_root_frame.Scale(1 / Scale()); | 692 rect_in_root_frame.Scale(1 / Scale()); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 } else if (graphics_layer == root_transform_layer_.get()) { | 852 } else if (graphics_layer == root_transform_layer_.get()) { |
| 849 name = "Root Transform Layer"; | 853 name = "Root Transform Layer"; |
| 850 } else { | 854 } else { |
| 851 ASSERT_NOT_REACHED(); | 855 ASSERT_NOT_REACHED(); |
| 852 } | 856 } |
| 853 | 857 |
| 854 return name; | 858 return name; |
| 855 } | 859 } |
| 856 | 860 |
| 857 } // namespace blink | 861 } // namespace blink |
| OLD | NEW |