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 FrameView* frame_view) 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 498 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 |