| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 class WebPagePopupImpl final | 52 class WebPagePopupImpl final |
| 53 : public WebPagePopup | 53 : public WebPagePopup |
| 54 , public PageWidgetEventHandler | 54 , public PageWidgetEventHandler |
| 55 , public PagePopup | 55 , public PagePopup |
| 56 , public RefCounted<WebPagePopupImpl> { | 56 , public RefCounted<WebPagePopupImpl> { |
| 57 WTF_MAKE_NONCOPYABLE(WebPagePopupImpl); | 57 WTF_MAKE_NONCOPYABLE(WebPagePopupImpl); |
| 58 WTF_MAKE_FAST_ALLOCATED(WebPagePopupImpl); | 58 WTF_MAKE_FAST_ALLOCATED(WebPagePopupImpl); |
| 59 | 59 |
| 60 public: | 60 public: |
| 61 virtual ~WebPagePopupImpl(); | 61 ~WebPagePopupImpl() override; |
| 62 bool initialize(WebViewImpl*, PagePopupClient*); | 62 bool initialize(WebViewImpl*, PagePopupClient*); |
| 63 bool handleKeyEvent(const PlatformKeyboardEvent&); | 63 bool handleKeyEvent(const PlatformKeyboardEvent&); |
| 64 void closePopup(); | 64 void closePopup(); |
| 65 WebWidgetClient* widgetClient() const { return m_widgetClient; } | 65 WebWidgetClient* widgetClient() const { return m_widgetClient; } |
| 66 bool hasSamePopupClient(WebPagePopupImpl* other) { return other && m_popupCl
ient == other->m_popupClient; } | 66 bool hasSamePopupClient(WebPagePopupImpl* other) { return other && m_popupCl
ient == other->m_popupClient; } |
| 67 LocalDOMWindow* window(); | 67 LocalDOMWindow* window(); |
| 68 virtual void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) override; | 68 void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) override; |
| 69 virtual void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*
) override; | 69 void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*) overri
de; |
| 70 virtual WebPoint positionRelativeToOwner() override; | 70 WebPoint positionRelativeToOwner() override; |
| 71 virtual void postMessage(const String& message) override; | 71 void postMessage(const String& message) override; |
| 72 void cancel(); | 72 void cancel(); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // WebWidget functions | 75 // WebWidget functions |
| 76 virtual WebSize size() override; | 76 WebSize size() override; |
| 77 virtual void beginFrame(const WebBeginFrameArgs&) override; | 77 void beginFrame(const WebBeginFrameArgs&) override; |
| 78 virtual void layout() override; | 78 void layout() override; |
| 79 virtual void willCloseLayerTreeView() override; | 79 void willCloseLayerTreeView() override; |
| 80 virtual void paint(WebCanvas*, const WebRect&) override; | 80 void paint(WebCanvas*, const WebRect&) override; |
| 81 virtual void resize(const WebSize&) override; | 81 void resize(const WebSize&) override; |
| 82 virtual void close() override; | 82 void close() override; |
| 83 virtual bool handleInputEvent(const WebInputEvent&) override; | 83 bool handleInputEvent(const WebInputEvent&) override; |
| 84 virtual void setFocus(bool) override; | 84 void setFocus(bool) override; |
| 85 virtual bool isPagePopup() const override { return true; } | 85 bool isPagePopup() const override { return true; } |
| 86 virtual bool isAcceleratedCompositingActive() const override { return m_isAc
celeratedCompositingActive; } | 86 bool isAcceleratedCompositingActive() const override { return m_isAccelerate
dCompositingActive; } |
| 87 | 87 |
| 88 // PageWidgetEventHandler functions | 88 // PageWidgetEventHandler functions |
| 89 virtual bool handleKeyEvent(const WebKeyboardEvent&) override; | 89 bool handleKeyEvent(const WebKeyboardEvent&) override; |
| 90 virtual bool handleCharEvent(const WebKeyboardEvent&) override; | 90 bool handleCharEvent(const WebKeyboardEvent&) override; |
| 91 virtual bool handleGestureEvent(const WebGestureEvent&) override; | 91 bool handleGestureEvent(const WebGestureEvent&) override; |
| 92 virtual void handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent&) ov
erride; | 92 void handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent&) override; |
| 93 virtual bool handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEven
t&) override; | 93 bool handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEvent&) over
ride; |
| 94 | 94 |
| 95 bool isMouseEventInWindow(const WebMouseEvent&); | 95 bool isMouseEventInWindow(const WebMouseEvent&); |
| 96 | 96 |
| 97 // PagePopup function | 97 // PagePopup function |
| 98 virtual AXObject* rootAXObject() override; | 98 AXObject* rootAXObject() override; |
| 99 virtual void setWindowRect(const IntRect&) override; | 99 void setWindowRect(const IntRect&) override; |
| 100 | 100 |
| 101 explicit WebPagePopupImpl(WebWidgetClient*); | 101 explicit WebPagePopupImpl(WebWidgetClient*); |
| 102 bool initializePage(); | 102 bool initializePage(); |
| 103 void destroyPage(); | 103 void destroyPage(); |
| 104 void setRootGraphicsLayer(GraphicsLayer*); | 104 void setRootGraphicsLayer(GraphicsLayer*); |
| 105 void setIsAcceleratedCompositingActive(bool enter); | 105 void setIsAcceleratedCompositingActive(bool enter); |
| 106 | 106 |
| 107 WebWidgetClient* m_widgetClient; | 107 WebWidgetClient* m_widgetClient; |
| 108 WebRect m_windowRectInScreen; | 108 WebRect m_windowRectInScreen; |
| 109 WebViewImpl* m_webView; | 109 WebViewImpl* m_webView; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 121 friend class PagePopupChromeClient; | 121 friend class PagePopupChromeClient; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebWidget, widget, widget->isPagePopup(), wi
dget.isPagePopup()); | 124 DEFINE_TYPE_CASTS(WebPagePopupImpl, WebWidget, widget, widget->isPagePopup(), wi
dget.isPagePopup()); |
| 125 // WebPagePopupImpl is the only implementation of PagePopup, so no | 125 // WebPagePopupImpl is the only implementation of PagePopup, so no |
| 126 // further checking required. | 126 // further checking required. |
| 127 DEFINE_TYPE_CASTS(WebPagePopupImpl, PagePopup, popup, true, true); | 127 DEFINE_TYPE_CASTS(WebPagePopupImpl, PagePopup, popup, true, true); |
| 128 | 128 |
| 129 } // namespace blink | 129 } // namespace blink |
| 130 #endif // WebPagePopupImpl_h | 130 #endif // WebPagePopupImpl_h |
| OLD | NEW |