| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 34 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
| 35 #include "core/html/HTMLDivElement.h" | 35 #include "core/html/HTMLDivElement.h" |
| 36 #include "core/html/forms/DateTimeChooser.h" | 36 #include "core/html/forms/DateTimeChooser.h" |
| 37 #include "core/html/forms/DateTimeChooserClient.h" | 37 #include "core/html/forms/DateTimeChooserClient.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class HTMLInputElement; | 41 class HTMLInputElement; |
| 42 | 42 |
| 43 class PickerIndicatorElement FINAL : public HTMLDivElement, public DateTimeChoos
erClient { | 43 class PickerIndicatorElement final : public HTMLDivElement, public DateTimeChoos
erClient { |
| 44 public: | 44 public: |
| 45 // PickerIndicatorOwner implementer must call removePickerIndicatorOwner whe
n | 45 // PickerIndicatorOwner implementer must call removePickerIndicatorOwner whe
n |
| 46 // it doesn't handle event, e.g. at destruction. | 46 // it doesn't handle event, e.g. at destruction. |
| 47 class PickerIndicatorOwner : public WillBeGarbageCollectedMixin { | 47 class PickerIndicatorOwner : public WillBeGarbageCollectedMixin { |
| 48 public: | 48 public: |
| 49 virtual ~PickerIndicatorOwner() { } | 49 virtual ~PickerIndicatorOwner() { } |
| 50 virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const = 0; | 50 virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const = 0; |
| 51 // FIXME: Remove. Deprecated in favor of double version. | 51 // FIXME: Remove. Deprecated in favor of double version. |
| 52 virtual void pickerIndicatorChooseValue(const String&) = 0; | 52 virtual void pickerIndicatorChooseValue(const String&) = 0; |
| 53 virtual void pickerIndicatorChooseValue(double) = 0; | 53 virtual void pickerIndicatorChooseValue(double) = 0; |
| 54 virtual Element& pickerOwnerElement() const = 0; | 54 virtual Element& pickerOwnerElement() const = 0; |
| 55 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; | 55 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 static PassRefPtrWillBeRawPtr<PickerIndicatorElement> create(Document&, Pick
erIndicatorOwner&); | 58 static PassRefPtrWillBeRawPtr<PickerIndicatorElement> create(Document&, Pick
erIndicatorOwner&); |
| 59 virtual ~PickerIndicatorElement(); | 59 virtual ~PickerIndicatorElement(); |
| 60 virtual void trace(Visitor*) OVERRIDE; | 60 virtual void trace(Visitor*) override; |
| 61 | 61 |
| 62 void openPopup(); | 62 void openPopup(); |
| 63 void closePopup(); | 63 void closePopup(); |
| 64 virtual bool willRespondToMouseClickEvents() OVERRIDE; | 64 virtual bool willRespondToMouseClickEvents() override; |
| 65 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = nullptr; } | 65 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = nullptr; } |
| 66 AXObject* popupRootAXObject() const; | 66 AXObject* popupRootAXObject() const; |
| 67 | 67 |
| 68 // DateTimeChooserClient implementation. | 68 // DateTimeChooserClient implementation. |
| 69 virtual Element& ownerElement() const OVERRIDE; | 69 virtual Element& ownerElement() const override; |
| 70 virtual void didChooseValue(const String&) OVERRIDE; | 70 virtual void didChooseValue(const String&) override; |
| 71 virtual void didChooseValue(double) OVERRIDE; | 71 virtual void didChooseValue(double) override; |
| 72 virtual void didEndChooser() OVERRIDE; | 72 virtual void didEndChooser() override; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 PickerIndicatorElement(Document&, PickerIndicatorOwner&); | 75 PickerIndicatorElement(Document&, PickerIndicatorOwner&); |
| 76 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 76 virtual RenderObject* createRenderer(RenderStyle*) override; |
| 77 virtual void defaultEventHandler(Event*) OVERRIDE; | 77 virtual void defaultEventHandler(Event*) override; |
| 78 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; | 78 virtual void detach(const AttachContext& = AttachContext()) override; |
| 79 virtual bool isPickerIndicatorElement() const OVERRIDE; | 79 virtual bool isPickerIndicatorElement() const override; |
| 80 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 80 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 81 virtual void didNotifySubtreeInsertionsToDocument() OVERRIDE; | 81 virtual void didNotifySubtreeInsertionsToDocument() override; |
| 82 | 82 |
| 83 HTMLInputElement* hostInput(); | 83 HTMLInputElement* hostInput(); |
| 84 | 84 |
| 85 RawPtrWillBeMember<PickerIndicatorOwner> m_pickerIndicatorOwner; | 85 RawPtrWillBeMember<PickerIndicatorOwner> m_pickerIndicatorOwner; |
| 86 RefPtr<DateTimeChooser> m_chooser; | 86 RefPtr<DateTimeChooser> m_chooser; |
| 87 bool m_isInOpenPopup; | 87 bool m_isInOpenPopup; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 DEFINE_TYPE_CASTS(PickerIndicatorElement, Element, element, element->isPickerInd
icatorElement(), element.isPickerIndicatorElement()); | 90 DEFINE_TYPE_CASTS(PickerIndicatorElement, Element, element, element->isPickerInd
icatorElement(), element.isPickerIndicatorElement()); |
| 91 | 91 |
| 92 } | 92 } |
| 93 #endif | 93 #endif |
| 94 #endif | 94 #endif |
| OLD | NEW |