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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 namespace blink { | 68 namespace blink { |
69 | 69 |
70 class PagePopupChromeClient final : public EmptyChromeClient { | 70 class PagePopupChromeClient final : public EmptyChromeClient { |
71 public: | 71 public: |
72 static PagePopupChromeClient* create(WebPagePopupImpl* popup) | 72 static PagePopupChromeClient* create(WebPagePopupImpl* popup) |
73 { | 73 { |
74 return new PagePopupChromeClient(popup); | 74 return new PagePopupChromeClient(popup); |
75 } | 75 } |
76 | 76 |
77 void setWindowRect(const IntRect& rect) override | 77 void setWindowRect(const IntRect& rect, LocalFrame&) override |
78 { | 78 { |
79 m_popup->setWindowRect(rect); | 79 m_popup->setWindowRect(rect); |
80 } | 80 } |
81 | 81 |
82 private: | 82 private: |
83 explicit PagePopupChromeClient(WebPagePopupImpl* popup) | 83 explicit PagePopupChromeClient(WebPagePopupImpl* popup) |
84 : m_popup(popup) | 84 : m_popup(popup) |
85 { | 85 { |
86 DCHECK(m_popup->widgetClient()); | 86 DCHECK(m_popup->widgetClient()); |
87 } | 87 } |
88 | 88 |
89 void closeWindowSoon() override | 89 void closeWindowSoon() override |
90 { | 90 { |
91 m_popup->closePopup(); | 91 m_popup->closePopup(); |
92 } | 92 } |
93 | 93 |
94 IntRect windowRect() override | 94 IntRect rootWindowRect() override |
95 { | 95 { |
96 return m_popup->windowRectInScreen(); | 96 return m_popup->windowRectInScreen(); |
97 } | 97 } |
98 | 98 |
99 IntRect viewportToScreen(const IntRect& rect, const Widget* widget) const ov
erride | 99 IntRect viewportToScreen(const IntRect& rect, const Widget* widget) const ov
erride |
100 { | 100 { |
101 WebRect rectInScreen(rect); | 101 WebRect rectInScreen(rect); |
102 WebRect windowRect = m_popup->windowRectInScreen(); | 102 WebRect windowRect = m_popup->windowRectInScreen(); |
103 m_popup->widgetClient()->convertViewportToWindow(&rectInScreen); | 103 m_popup->widgetClient()->convertViewportToWindow(&rectInScreen); |
104 rectInScreen.x += windowRect.x; | 104 rectInScreen.x += windowRect.x; |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 // A WebPagePopupImpl instance usually has two references. | 582 // A WebPagePopupImpl instance usually has two references. |
583 // - One owned by the instance itself. It represents the visible widget. | 583 // - One owned by the instance itself. It represents the visible widget. |
584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
585 // WebPagePopupImpl to close. | 585 // WebPagePopupImpl to close. |
586 // We need them because the closing operation is asynchronous and the widget | 586 // We need them because the closing operation is asynchronous and the widget |
587 // can be closed while the WebViewImpl is unaware of it. | 587 // can be closed while the WebViewImpl is unaware of it. |
588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
589 } | 589 } |
590 | 590 |
591 } // namespace blink | 591 } // namespace blink |
OLD | NEW |