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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 private: | 66 private: |
67 // WebWidget functions | 67 // WebWidget functions |
68 virtual WebSize size() OVERRIDE; | 68 virtual WebSize size() OVERRIDE; |
69 virtual void animate(double) OVERRIDE; | 69 virtual void animate(double) OVERRIDE; |
70 virtual void layout() OVERRIDE; | 70 virtual void layout() OVERRIDE; |
71 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE; | 71 virtual void paint(WebCanvas*, const WebRect&, PaintOptions = ReadbackFromCo mpositorIfAvailable) OVERRIDE; |
72 virtual void resize(const WebSize&) OVERRIDE; | 72 virtual void resize(const WebSize&) OVERRIDE; |
73 virtual void close() OVERRIDE; | 73 virtual void close() OVERRIDE; |
74 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; | 74 virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; |
75 virtual void setFocus(bool) OVERRIDE; | 75 virtual void setFocus(bool) OVERRIDE; |
76 virtual bool isPagePopup() OVERRIDE { return true; } | |
76 | 77 |
77 // PageWidgetEventHandler functions | 78 // PageWidgetEventHandler functions |
78 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; | 79 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; |
79 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; | 80 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; |
80 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; | 81 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; |
81 | 82 |
82 explicit WebPagePopupImpl(WebWidgetClient*); | 83 explicit WebPagePopupImpl(WebWidgetClient*); |
83 bool initializePage(); | 84 bool initializePage(); |
84 void destroyPage(); | 85 void destroyPage(); |
85 | 86 |
86 WebWidgetClient* m_widgetClient; | 87 WebWidgetClient* m_widgetClient; |
87 WebRect m_windowRectInScreen; | 88 WebRect m_windowRectInScreen; |
88 WebViewImpl* m_webView; | 89 WebViewImpl* m_webView; |
89 OwnPtr<WebCore::Page> m_page; | 90 OwnPtr<WebCore::Page> m_page; |
90 OwnPtr<PagePopupChromeClient> m_chromeClient; | 91 OwnPtr<PagePopupChromeClient> m_chromeClient; |
91 WebCore::PagePopupClient* m_popupClient; | 92 WebCore::PagePopupClient* m_popupClient; |
92 bool m_closing; | 93 bool m_closing; |
93 | 94 |
94 friend class WebPagePopup; | 95 friend class WebPagePopup; |
95 friend class PagePopupChromeClient; | 96 friend class PagePopupChromeClient; |
96 }; | 97 }; |
97 | 98 |
99 inline WebPagePopupImpl* toWebPagePopupImpl(WebWidget* widget) | |
100 { | |
101 ASSERT_WITH_SECURITY_IMPLICATION(widget && widget->isPagePopup()); | |
tkent
2013/10/08 05:24:04
should accept null widget for consistency.
| |
102 return static_cast<WebPagePopupImpl*>(widget); | |
103 } | |
104 | |
105 inline WebPagePopupImpl* toWebPagePopupImpl(WebCore::PagePopup* popup) | |
106 { | |
107 ASSERT_WITH_SECURITY_IMPLICATION(!popup); | |
tkent
2013/10/08 05:24:04
Null pointer has no security implication.
should a
| |
108 return static_cast<WebPagePopupImpl*>(popup); | |
109 } | |
110 | |
98 } // namespace WebKit | 111 } // namespace WebKit |
99 #endif // WebPagePopupImpl_h | 112 #endif // WebPagePopupImpl_h |
OLD | NEW |