| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PopupMenuImpl_h | 5 #ifndef PopupMenuImpl_h |
| 6 #define PopupMenuImpl_h | 6 #define PopupMenuImpl_h |
| 7 | 7 |
| 8 #include "core/page/PagePopupClient.h" | 8 #include "core/page/PagePopupClient.h" |
| 9 #include "platform/PopupMenu.h" | 9 #include "platform/PopupMenu.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class ChromeClientImpl; | 13 class ChromeClient; |
| 14 class PagePopup; | 14 class PagePopup; |
| 15 class HTMLElement; | 15 class HTMLElement; |
| 16 class HTMLHRElement; | 16 class HTMLHRElement; |
| 17 class HTMLOptGroupElement; | 17 class HTMLOptGroupElement; |
| 18 class HTMLOptionElement; | 18 class HTMLOptionElement; |
| 19 class HTMLSelectElement; | 19 class HTMLSelectElement; |
| 20 | 20 |
| 21 class PopupMenuImpl final : public PopupMenu, public PagePopupClient { | 21 class PopupMenuImpl final : public PopupMenu, public PagePopupClient { |
| 22 public: | 22 public: |
| 23 static PopupMenuImpl* Create(ChromeClientImpl*, HTMLSelectElement&); | 23 static PopupMenuImpl* Create(ChromeClient*, HTMLSelectElement&); |
| 24 ~PopupMenuImpl() override; | 24 ~PopupMenuImpl() override; |
| 25 DECLARE_VIRTUAL_TRACE(); | 25 DECLARE_VIRTUAL_TRACE(); |
| 26 | 26 |
| 27 void Update(); | 27 void Update(); |
| 28 | 28 |
| 29 void Dispose(); | 29 void Dispose(); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 PopupMenuImpl(ChromeClientImpl*, HTMLSelectElement&); | 32 PopupMenuImpl(ChromeClient*, HTMLSelectElement&); |
| 33 | 33 |
| 34 class ItemIterationContext; | 34 class ItemIterationContext; |
| 35 void AddOption(ItemIterationContext&, HTMLOptionElement&); | 35 void AddOption(ItemIterationContext&, HTMLOptionElement&); |
| 36 void AddOptGroup(ItemIterationContext&, HTMLOptGroupElement&); | 36 void AddOptGroup(ItemIterationContext&, HTMLOptGroupElement&); |
| 37 void AddSeparator(ItemIterationContext&, HTMLHRElement&); | 37 void AddSeparator(ItemIterationContext&, HTMLHRElement&); |
| 38 void AddElementStyle(ItemIterationContext&, HTMLElement&); | 38 void AddElementStyle(ItemIterationContext&, HTMLElement&); |
| 39 | 39 |
| 40 // PopupMenu functions: | 40 // PopupMenu functions: |
| 41 void Show() override; | 41 void Show() override; |
| 42 void Hide() override; | 42 void Hide() override; |
| 43 void DisconnectClient() override; | 43 void DisconnectClient() override; |
| 44 void UpdateFromElement(UpdateReason) override; | 44 void UpdateFromElement(UpdateReason) override; |
| 45 | 45 |
| 46 // PagePopupClient functions: | 46 // PagePopupClient functions: |
| 47 void WriteDocument(SharedBuffer*) override; | 47 void WriteDocument(SharedBuffer*) override; |
| 48 void SelectFontsFromOwnerDocument(Document&) override; | 48 void SelectFontsFromOwnerDocument(Document&) override; |
| 49 void SetValueAndClosePopup(int, const String&) override; | 49 void SetValueAndClosePopup(int, const String&) override; |
| 50 void SetValue(const String&) override; | 50 void SetValue(const String&) override; |
| 51 void ClosePopup() override; | 51 void ClosePopup() override; |
| 52 Element& OwnerElement() override; | 52 Element& OwnerElement() override; |
| 53 float ZoomFactor() override { return 1.0; } | 53 float ZoomFactor() override { return 1.0; } |
| 54 Locale& GetLocale() override; | 54 Locale& GetLocale() override; |
| 55 void DidClosePopup() override; | 55 void DidClosePopup() override; |
| 56 | 56 |
| 57 Member<ChromeClientImpl> chrome_client_; | 57 Member<ChromeClient> chrome_client_; |
| 58 Member<HTMLSelectElement> owner_element_; | 58 Member<HTMLSelectElement> owner_element_; |
| 59 PagePopup* popup_; | 59 PagePopup* popup_; |
| 60 bool needs_update_; | 60 bool needs_update_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace blink | 63 } // namespace blink |
| 64 | 64 |
| 65 #endif // PopupMenuImpl_h | 65 #endif // PopupMenuImpl_h |
| OLD | NEW |