| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 20 matching lines...) Expand all Loading... |
| 31 #ifndef ExternalPopupMenu_h | 31 #ifndef ExternalPopupMenu_h |
| 32 #define ExternalPopupMenu_h | 32 #define ExternalPopupMenu_h |
| 33 | 33 |
| 34 #include "platform/PopupMenu.h" | 34 #include "platform/PopupMenu.h" |
| 35 #include "platform/Timer.h" | 35 #include "platform/Timer.h" |
| 36 #include "public/platform/WebCanvas.h" | 36 #include "public/platform/WebCanvas.h" |
| 37 #include "public/platform/WebScrollbar.h" | 37 #include "public/platform/WebScrollbar.h" |
| 38 #include "public/web/WebExternalPopupMenuClient.h" | 38 #include "public/web/WebExternalPopupMenuClient.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 |
| 41 class FloatQuad; | 42 class FloatQuad; |
| 42 class LocalFrame; | 43 class LocalFrame; |
| 43 class FrameView; | 44 class FrameView; |
| 44 class IntRect; | 45 class IntRect; |
| 45 class IntSize; | 46 class IntSize; |
| 46 class PopupMenuClient; | 47 class PopupMenuClient; |
| 47 } | |
| 48 | |
| 49 namespace blink { | |
| 50 | |
| 51 class WebExternalPopupMenu; | 48 class WebExternalPopupMenu; |
| 52 class WebViewImpl; | 49 class WebViewImpl; |
| 53 struct WebPopupMenuInfo; | 50 struct WebPopupMenuInfo; |
| 54 class WebMouseEvent; | 51 class WebMouseEvent; |
| 55 | 52 |
| 56 // The ExternalPopupMenu connects the actual implementation of the popup menu | 53 // The ExternalPopupMenu connects the actual implementation of the popup menu |
| 57 // to the WebCore popup menu. | 54 // to the WebCore popup menu. |
| 58 class ExternalPopupMenu FINAL : public blink::PopupMenu, public WebExternalPopup
MenuClient { | 55 class ExternalPopupMenu FINAL : public PopupMenu, public WebExternalPopupMenuCli
ent { |
| 59 public: | 56 public: |
| 60 ExternalPopupMenu(blink::LocalFrame&, blink::PopupMenuClient*, WebViewImpl&)
; | 57 ExternalPopupMenu(LocalFrame&, PopupMenuClient*, WebViewImpl&); |
| 61 virtual ~ExternalPopupMenu(); | 58 virtual ~ExternalPopupMenu(); |
| 62 | 59 |
| 63 private: | 60 private: |
| 64 // blink::PopupMenu methods: | 61 // PopupMenu methods: |
| 65 virtual void show(const blink::FloatQuad& controlPosition, const blink::IntS
ize&, int index) OVERRIDE; | 62 virtual void show(const FloatQuad& controlPosition, const IntSize&, int inde
x) OVERRIDE; |
| 66 virtual void hide() OVERRIDE; | 63 virtual void hide() OVERRIDE; |
| 67 virtual void updateFromElement() OVERRIDE; | 64 virtual void updateFromElement() OVERRIDE; |
| 68 virtual void disconnectClient() OVERRIDE; | 65 virtual void disconnectClient() OVERRIDE; |
| 69 | 66 |
| 70 // WebExternalPopupClient methods: | 67 // WebExternalPopupClient methods: |
| 71 virtual void didChangeSelection(int index) OVERRIDE; | 68 virtual void didChangeSelection(int index) OVERRIDE; |
| 72 virtual void didAcceptIndex(int index) OVERRIDE; | 69 virtual void didAcceptIndex(int index) OVERRIDE; |
| 73 virtual void didAcceptIndices(const WebVector<int>& indices) OVERRIDE; | 70 virtual void didAcceptIndices(const WebVector<int>& indices) OVERRIDE; |
| 74 virtual void didCancel() OVERRIDE; | 71 virtual void didCancel() OVERRIDE; |
| 75 | 72 |
| 76 void dispatchEvent(blink::Timer<ExternalPopupMenu>*); | 73 void dispatchEvent(Timer<ExternalPopupMenu>*); |
| 77 // Fills |info| with the popup menu information contained in the | 74 // Fills |info| with the popup menu information contained in the |
| 78 // blink::PopupMenuClient associated with this ExternalPopupMenu. | 75 // PopupMenuClient associated with this ExternalPopupMenu. |
| 79 void getPopupMenuInfo(WebPopupMenuInfo* info); | 76 void getPopupMenuInfo(WebPopupMenuInfo* info); |
| 80 int toPopupMenuItemIndex(int index); | 77 int toPopupMenuItemIndex(int index); |
| 81 int toExternalPopupMenuItemIndex(int index); | 78 int toExternalPopupMenuItemIndex(int index); |
| 82 | 79 |
| 83 blink::PopupMenuClient* m_popupMenuClient; | 80 PopupMenuClient* m_popupMenuClient; |
| 84 RefPtr<blink::FrameView> m_frameView; | 81 RefPtr<FrameView> m_frameView; |
| 85 WebViewImpl& m_webView; | 82 WebViewImpl& m_webView; |
| 86 OwnPtr<WebMouseEvent> m_syntheticEvent; | 83 OwnPtr<WebMouseEvent> m_syntheticEvent; |
| 87 blink::Timer<ExternalPopupMenu> m_dispatchEventTimer; | 84 Timer<ExternalPopupMenu> m_dispatchEventTimer; |
| 88 // The actual implementor of the show menu. | 85 // The actual implementor of the show menu. |
| 89 WebExternalPopupMenu* m_webExternalPopupMenu; | 86 WebExternalPopupMenu* m_webExternalPopupMenu; |
| 90 }; | 87 }; |
| 91 | 88 |
| 92 } // namespace blink | 89 } // namespace blink |
| 93 | 90 |
| 94 #endif // ExternalPopupMenu_h | 91 #endif // ExternalPopupMenu_h |
| OLD | NEW |