Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Side by Side Diff: Source/web/WebPagePopupImpl.h

Issue 26564006: Cleanup: Add conversion interface for WebWidget derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebHelperPluginImpl.h ('k') | Source/web/WebPopupMenuImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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() const 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());
102 return static_cast<WebPagePopupImpl*>(widget);
103 }
104
105 inline WebPagePopupImpl* toWebPagePopupImpl(WebCore::PagePopup* popup)
106 {
107 // WebPagePopupImpl is the only implementation of WebCore::PagePopup, so
108 // no further checking required.
109 return static_cast<WebPagePopupImpl*>(popup);
110 }
111
98 } // namespace WebKit 112 } // namespace WebKit
99 #endif // WebPagePopupImpl_h 113 #endif // WebPagePopupImpl_h
OLDNEW
« no previous file with comments | « Source/web/WebHelperPluginImpl.h ('k') | Source/web/WebPopupMenuImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698