| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 message.utf8().data()); | 108 message.utf8().data()); |
| 109 #endif | 109 #endif |
| 110 } | 110 } |
| 111 | 111 |
| 112 void invalidateRect(const IntRect& paintRect) override { | 112 void invalidateRect(const IntRect& paintRect) override { |
| 113 if (!paintRect.isEmpty()) | 113 if (!paintRect.isEmpty()) |
| 114 m_popup->widgetClient()->didInvalidateRect(paintRect); | 114 m_popup->widgetClient()->didInvalidateRect(paintRect); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void scheduleAnimation(Widget*) override { | 117 void scheduleAnimation(Widget*) override { |
| 118 // Calling scheduleAnimation on m_webView so WebViewTestProxy will call begi
nFrame. | 118 // Calling scheduleAnimation on m_webView so WebViewTestProxy will call |
| 119 // beginFrame. |
| 119 if (LayoutTestSupport::isRunningLayoutTest()) | 120 if (LayoutTestSupport::isRunningLayoutTest()) |
| 120 m_popup->m_webView->mainFrameImpl()->frameWidget()->scheduleAnimation(); | 121 m_popup->m_webView->mainFrameImpl()->frameWidget()->scheduleAnimation(); |
| 121 | 122 |
| 122 if (m_popup->isAcceleratedCompositingActive()) { | 123 if (m_popup->isAcceleratedCompositingActive()) { |
| 123 DCHECK(m_popup->m_layerTreeView); | 124 DCHECK(m_popup->m_layerTreeView); |
| 124 m_popup->m_layerTreeView->setNeedsBeginFrame(); | 125 m_popup->m_layerTreeView->setNeedsBeginFrame(); |
| 125 return; | 126 return; |
| 126 } | 127 } |
| 127 m_popup->m_widgetClient->scheduleAnimation(); | 128 m_popup->m_widgetClient->scheduleAnimation(); |
| 128 } | 129 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 }; | 231 }; |
| 231 | 232 |
| 232 bool PagePopupFeaturesClient::isEnabled(Document*, | 233 bool PagePopupFeaturesClient::isEnabled(Document*, |
| 233 ContextFeatures::FeatureType type, | 234 ContextFeatures::FeatureType type, |
| 234 bool defaultValue) { | 235 bool defaultValue) { |
| 235 if (type == ContextFeatures::PagePopup) | 236 if (type == ContextFeatures::PagePopup) |
| 236 return true; | 237 return true; |
| 237 return defaultValue; | 238 return defaultValue; |
| 238 } | 239 } |
| 239 | 240 |
| 240 // WebPagePopupImpl ------------------------------------------------------------
---- | 241 // WebPagePopupImpl ---------------------------------------------------------- |
| 241 | 242 |
| 242 WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client) | 243 WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client) |
| 243 : m_widgetClient(client), | 244 : m_widgetClient(client), |
| 244 m_closing(false), | 245 m_closing(false), |
| 245 m_layerTreeView(0), | 246 m_layerTreeView(0), |
| 246 m_rootLayer(0), | 247 m_rootLayer(0), |
| 247 m_rootGraphicsLayer(0), | 248 m_rootGraphicsLayer(0), |
| 248 m_isAcceleratedCompositingActive(false) { | 249 m_isAcceleratedCompositingActive(false) { |
| 249 DCHECK(client); | 250 DCHECK(client); |
| 250 } | 251 } |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // A WebPagePopupImpl instance usually has two references. | 581 // A WebPagePopupImpl instance usually has two references. |
| 581 // - One owned by the instance itself. It represents the visible widget. | 582 // - One owned by the instance itself. It represents the visible widget. |
| 582 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 583 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 583 // WebPagePopupImpl to close. | 584 // WebPagePopupImpl to close. |
| 584 // We need them because the closing operation is asynchronous and the widget | 585 // We need them because the closing operation is asynchronous and the widget |
| 585 // can be closed while the WebViewImpl is unaware of it. | 586 // can be closed while the WebViewImpl is unaware of it. |
| 586 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 587 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 587 } | 588 } |
| 588 | 589 |
| 589 } // namespace blink | 590 } // namespace blink |
| OLD | NEW |