| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLoca
lMainFrame()); | 413 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLoca
lMainFrame()); |
| 414 } | 414 } |
| 415 | 415 |
| 416 void WebPagePopupImpl::resize(const WebSize& newSizeInViewport) | 416 void WebPagePopupImpl::resize(const WebSize& newSizeInViewport) |
| 417 { | 417 { |
| 418 WebRect newSize(0, 0, newSizeInViewport.width, newSizeInViewport.height); | 418 WebRect newSize(0, 0, newSizeInViewport.width, newSizeInViewport.height); |
| 419 widgetClient()->convertViewportToWindow(&newSize); | 419 widgetClient()->convertViewportToWindow(&newSize); |
| 420 | 420 |
| 421 WebRect windowRect = windowRectInScreen(); | 421 WebRect windowRect = windowRectInScreen(); |
| 422 | 422 |
| 423 if (windowRect.width != newSize.width | 423 // TODO(bokan): We should only call into this if the bounds actually changed |
| 424 && windowRect.height != newSize.height) { | 424 // but this reveals a bug in Aura. crbug.com/633140. |
| 425 windowRect.width = newSize.width; | 425 windowRect.width = newSize.width; |
| 426 windowRect.height = newSize.height; | 426 windowRect.height = newSize.height; |
| 427 setWindowRect(windowRect); | 427 setWindowRect(windowRect); |
| 428 } | |
| 429 | 428 |
| 430 if (m_page) { | 429 if (m_page) { |
| 431 toLocalFrame(m_page->mainFrame())->view()->resize(newSizeInViewport); | 430 toLocalFrame(m_page->mainFrame())->view()->resize(newSizeInViewport); |
| 432 m_page->frameHost().visualViewport().setSize(newSizeInViewport); | 431 m_page->frameHost().visualViewport().setSize(newSizeInViewport); |
| 433 } | 432 } |
| 434 | 433 |
| 435 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh
t)); | 434 m_widgetClient->didInvalidateRect(WebRect(0, 0, newSize.width, newSize.heigh
t)); |
| 436 } | 435 } |
| 437 | 436 |
| 438 WebInputEventResult WebPagePopupImpl::handleKeyEvent(const WebKeyboardEvent& eve
nt) | 437 WebInputEventResult WebPagePopupImpl::handleKeyEvent(const WebKeyboardEvent& eve
nt) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 // A WebPagePopupImpl instance usually has two references. | 582 // A WebPagePopupImpl instance usually has two references. |
| 584 // - One owned by the instance itself. It represents the visible widget. | 583 // - One owned by the instance itself. It represents the visible widget. |
| 585 // - 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 |
| 586 // WebPagePopupImpl to close. | 585 // WebPagePopupImpl to close. |
| 587 // 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 |
| 588 // can be closed while the WebViewImpl is unaware of it. | 587 // can be closed while the WebViewImpl is unaware of it. |
| 589 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 590 } | 589 } |
| 591 | 590 |
| 592 } // namespace blink | 591 } // namespace blink |
| OLD | NEW |