| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 WebSize WebPagePopupImpl::size() | 317 WebSize WebPagePopupImpl::size() |
| 318 { | 318 { |
| 319 return m_popupClient->contentSize(); | 319 return m_popupClient->contentSize(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void WebPagePopupImpl::beginFrame(const WebBeginFrameArgs& frameTime) | 322 void WebPagePopupImpl::beginFrame(const WebBeginFrameArgs& frameTime) |
| 323 { | 323 { |
| 324 // FIXME: This should use frameTime.lastFrameTimeMonotonic but doing so | 324 // FIXME: This should use frameTime.lastFrameTimeMonotonic but doing so |
| 325 // breaks tests. | 325 // breaks tests. |
| 326 PageWidgetDelegate::animate(m_page.get(), monotonicallyIncreasingTime()); | 326 PageWidgetDelegate::animate(m_page.get(), monotonicallyIncreasingTime(), m_p
age->deprecatedLocalMainFrame()); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void WebPagePopupImpl::willCloseLayerTreeView() | 329 void WebPagePopupImpl::willCloseLayerTreeView() |
| 330 { | 330 { |
| 331 setIsAcceleratedCompositingActive(false); | 331 setIsAcceleratedCompositingActive(false); |
| 332 m_layerTreeView = 0; | 332 m_layerTreeView = 0; |
| 333 } | 333 } |
| 334 | 334 |
| 335 void WebPagePopupImpl::layout() | 335 void WebPagePopupImpl::layout() |
| 336 { | 336 { |
| 337 PageWidgetDelegate::layout(m_page.get()); | 337 PageWidgetDelegate::layout(m_page.get(), m_page->deprecatedLocalMainFrame())
; |
| 338 } | 338 } |
| 339 | 339 |
| 340 void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect) | 340 void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect) |
| 341 { | 341 { |
| 342 if (!m_closing) | 342 if (!m_closing) |
| 343 PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDeleg
ate::Opaque); | 343 PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDeleg
ate::Opaque, m_page->deprecatedLocalMainFrame()); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void WebPagePopupImpl::resize(const WebSize& newSize) | 346 void WebPagePopupImpl::resize(const WebSize& newSize) |
| 347 { | 347 { |
| 348 m_windowRectInScreen = WebRect(m_windowRectInScreen.x, m_windowRectInScreen.
y, newSize.width, newSize.height); | 348 m_windowRectInScreen = WebRect(m_windowRectInScreen.x, m_windowRectInScreen.
y, newSize.width, newSize.height); |
| 349 m_widgetClient->setWindowRect(m_windowRectInScreen); | 349 m_widgetClient->setWindowRect(m_windowRectInScreen); |
| 350 | 350 |
| 351 if (m_page) | 351 if (m_page) |
| 352 toLocalFrame(m_page->mainFrame())->view()->resize(newSize); | 352 toLocalFrame(m_page->mainFrame())->view()->resize(newSize); |
| 353 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh
t)); | 353 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh
t)); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 372 if (m_closing || !m_page || !m_page->mainFrame() || !toLocalFrame(m_page->ma
inFrame())->view()) | 372 if (m_closing || !m_page || !m_page->mainFrame() || !toLocalFrame(m_page->ma
inFrame())->view()) |
| 373 return false; | 373 return false; |
| 374 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); | 374 LocalFrame& frame = *toLocalFrame(m_page->mainFrame()); |
| 375 return frame.eventHandler().handleGestureEvent(PlatformGestureEventBuilder(f
rame.view(), event)); | 375 return frame.eventHandler().handleGestureEvent(PlatformGestureEventBuilder(f
rame.view(), event)); |
| 376 } | 376 } |
| 377 | 377 |
| 378 bool WebPagePopupImpl::handleInputEvent(const WebInputEvent& event) | 378 bool WebPagePopupImpl::handleInputEvent(const WebInputEvent& event) |
| 379 { | 379 { |
| 380 if (m_closing) | 380 if (m_closing) |
| 381 return false; | 381 return false; |
| 382 return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, event); | 382 return PageWidgetDelegate::handleInputEvent(m_page.get(), *this, event, m_pa
ge->deprecatedLocalMainFrame()); |
| 383 } | 383 } |
| 384 | 384 |
| 385 bool WebPagePopupImpl::handleKeyEvent(const PlatformKeyboardEvent& event) | 385 bool WebPagePopupImpl::handleKeyEvent(const PlatformKeyboardEvent& event) |
| 386 { | 386 { |
| 387 if (m_closing || !m_page->mainFrame() || !toLocalFrame(m_page->mainFrame())-
>view()) | 387 if (m_closing || !m_page->mainFrame() || !toLocalFrame(m_page->mainFrame())-
>view()) |
| 388 return false; | 388 return false; |
| 389 return toLocalFrame(m_page->mainFrame())->eventHandler().keyEvent(event); | 389 return toLocalFrame(m_page->mainFrame())->eventHandler().keyEvent(event); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void WebPagePopupImpl::setFocus(bool enable) | 392 void WebPagePopupImpl::setFocus(bool enable) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 // A WebPagePopupImpl instance usually has two references. | 447 // A WebPagePopupImpl instance usually has two references. |
| 448 // - One owned by the instance itself. It represents the visible widget. | 448 // - One owned by the instance itself. It represents the visible widget. |
| 449 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 449 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 450 // WebPagePopupImpl to close. | 450 // WebPagePopupImpl to close. |
| 451 // We need them because the closing operation is asynchronous and the widget | 451 // We need them because the closing operation is asynchronous and the widget |
| 452 // can be closed while the WebViewImpl is unaware of it. | 452 // can be closed while the WebViewImpl is unaware of it. |
| 453 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 453 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace blink | 456 } // namespace blink |
| OLD | NEW |