| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 explicit PagePopupChromeClient(WebPagePopupImpl* popup) : popup_(popup) { | 84 explicit PagePopupChromeClient(WebPagePopupImpl* popup) : popup_(popup) { |
| 85 DCHECK(popup_->WidgetClient()); | 85 DCHECK(popup_->WidgetClient()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CloseWindowSoon() override { popup_->ClosePopup(); } | 88 void CloseWindowSoon() override { popup_->ClosePopup(); } |
| 89 | 89 |
| 90 IntRect RootWindowRect() override { return popup_->WindowRectInScreen(); } | 90 IntRect RootWindowRect() override { return popup_->WindowRectInScreen(); } |
| 91 | 91 |
| 92 IntRect ViewportToScreen( | 92 IntRect ViewportToScreen(const IntRect& rect, |
| 93 const IntRect& rect, | 93 const PlatformLocalFrame*) const override { |
| 94 const FrameViewBase* frame_view_base) const override { | |
| 95 WebRect rect_in_screen(rect); | 94 WebRect rect_in_screen(rect); |
| 96 WebRect window_rect = popup_->WindowRectInScreen(); | 95 WebRect window_rect = popup_->WindowRectInScreen(); |
| 97 popup_->WidgetClient()->ConvertViewportToWindow(&rect_in_screen); | 96 popup_->WidgetClient()->ConvertViewportToWindow(&rect_in_screen); |
| 98 rect_in_screen.x += window_rect.x; | 97 rect_in_screen.x += window_rect.x; |
| 99 rect_in_screen.y += window_rect.y; | 98 rect_in_screen.y += window_rect.y; |
| 100 return rect_in_screen; | 99 return rect_in_screen; |
| 101 } | 100 } |
| 102 | 101 |
| 103 float WindowToViewportScalar(const float scalar_value) const override { | 102 float WindowToViewportScalar(const float scalar_value) const override { |
| 104 WebFloatRect viewport_rect(0, 0, scalar_value, 0); | 103 WebFloatRect viewport_rect(0, 0, scalar_value, 0); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 117 fprintf(stderr, "CONSOLE MESSSAGE:%u: %s\n", line_number, | 116 fprintf(stderr, "CONSOLE MESSSAGE:%u: %s\n", line_number, |
| 118 message.Utf8().data()); | 117 message.Utf8().data()); |
| 119 #endif | 118 #endif |
| 120 } | 119 } |
| 121 | 120 |
| 122 void InvalidateRect(const IntRect& paint_rect) override { | 121 void InvalidateRect(const IntRect& paint_rect) override { |
| 123 if (!paint_rect.IsEmpty()) | 122 if (!paint_rect.IsEmpty()) |
| 124 popup_->WidgetClient()->DidInvalidateRect(paint_rect); | 123 popup_->WidgetClient()->DidInvalidateRect(paint_rect); |
| 125 } | 124 } |
| 126 | 125 |
| 127 void ScheduleAnimation(LocalFrame*) override { | 126 void ScheduleAnimation(const PlatformLocalFrame*) override { |
| 128 // Calling scheduleAnimation on m_webView so WebViewTestProxy will call | 127 // Calling scheduleAnimation on m_webView so WebViewTestProxy will call |
| 129 // beginFrame. | 128 // beginFrame. |
| 130 if (LayoutTestSupport::IsRunningLayoutTest()) | 129 if (LayoutTestSupport::IsRunningLayoutTest()) |
| 131 popup_->web_view_->MainFrameImpl()->FrameWidget()->ScheduleAnimation(); | 130 popup_->web_view_->MainFrameImpl()->FrameWidget()->ScheduleAnimation(); |
| 132 | 131 |
| 133 if (popup_->layer_tree_view_) { | 132 if (popup_->layer_tree_view_) { |
| 134 popup_->layer_tree_view_->SetNeedsBeginFrame(); | 133 popup_->layer_tree_view_->SetNeedsBeginFrame(); |
| 135 return; | 134 return; |
| 136 } | 135 } |
| 137 popup_->widget_client_->ScheduleAnimation(); | 136 popup_->widget_client_->ScheduleAnimation(); |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // A WebPagePopupImpl instance usually has two references. | 602 // A WebPagePopupImpl instance usually has two references. |
| 604 // - One owned by the instance itself. It represents the visible widget. | 603 // - One owned by the instance itself. It represents the visible widget. |
| 605 // - One owned by a WebViewBase. It's released when the WebViewBase ask the | 604 // - One owned by a WebViewBase. It's released when the WebViewBase ask the |
| 606 // WebPagePopupImpl to close. | 605 // WebPagePopupImpl to close. |
| 607 // We need them because the closing operation is asynchronous and the widget | 606 // We need them because the closing operation is asynchronous and the widget |
| 608 // can be closed while the WebViewBase is unaware of it. | 607 // can be closed while the WebViewBase is unaware of it. |
| 609 return AdoptRef(new WebPagePopupImpl(client)).LeakRef(); | 608 return AdoptRef(new WebPagePopupImpl(client)).LeakRef(); |
| 610 } | 609 } |
| 611 | 610 |
| 612 } // namespace blink | 611 } // namespace blink |
| OLD | NEW |