| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 class PickerIndicatorElement FINAL : public HTMLDivElement, public DateTimeChoos
erClient { | 44 class PickerIndicatorElement FINAL : public HTMLDivElement, public DateTimeChoos
erClient { |
| 45 public: | 45 public: |
| 46 // PickerIndicatorOwner implementer must call removePickerIndicatorOwner whe
n | 46 // PickerIndicatorOwner implementer must call removePickerIndicatorOwner whe
n |
| 47 // it doesn't handle event, e.g. at destruction. | 47 // it doesn't handle event, e.g. at destruction. |
| 48 class PickerIndicatorOwner { | 48 class PickerIndicatorOwner { |
| 49 public: | 49 public: |
| 50 virtual ~PickerIndicatorOwner() { } | 50 virtual ~PickerIndicatorOwner() { } |
| 51 virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const = 0; | 51 virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const = 0; |
| 52 virtual void pickerIndicatorChooseValue(const String&) = 0; | 52 virtual void pickerIndicatorChooseValue(const String&) = 0; |
| 53 virtual void pickerIndicatorChooseValue(double) = 0; |
| 53 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; | 54 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 static PassRefPtr<PickerIndicatorElement> create(Document&, PickerIndicatorO
wner&); | 57 static PassRefPtr<PickerIndicatorElement> create(Document&, PickerIndicatorO
wner&); |
| 57 virtual ~PickerIndicatorElement(); | 58 virtual ~PickerIndicatorElement(); |
| 58 void openPopup(); | 59 void openPopup(); |
| 59 void closePopup(); | 60 void closePopup(); |
| 60 virtual bool willRespondToMouseClickEvents() OVERRIDE; | 61 virtual bool willRespondToMouseClickEvents() OVERRIDE; |
| 61 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = 0; } | 62 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = 0; } |
| 62 | 63 |
| 63 // DateTimeChooserClient implementation. | 64 // DateTimeChooserClient implementation. |
| 64 virtual void didChooseValue(const String&) OVERRIDE; | 65 virtual void didChooseValue(const String&) OVERRIDE; |
| 66 virtual void didChooseValue(double) OVERRIDE; |
| 65 virtual void didEndChooser() OVERRIDE; | 67 virtual void didEndChooser() OVERRIDE; |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 PickerIndicatorElement(Document&, PickerIndicatorOwner&); | 70 PickerIndicatorElement(Document&, PickerIndicatorOwner&); |
| 69 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 71 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
| 70 virtual void defaultEventHandler(Event*) OVERRIDE; | 72 virtual void defaultEventHandler(Event*) OVERRIDE; |
| 71 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; | 73 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; |
| 72 virtual bool isPickerIndicatorElement() const OVERRIDE; | 74 virtual bool isPickerIndicatorElement() const OVERRIDE; |
| 73 | 75 |
| 74 HTMLInputElement* hostInput(); | 76 HTMLInputElement* hostInput(); |
| 75 | 77 |
| 76 PickerIndicatorOwner* m_pickerIndicatorOwner; | 78 PickerIndicatorOwner* m_pickerIndicatorOwner; |
| 77 RefPtr<DateTimeChooser> m_chooser; | 79 RefPtr<DateTimeChooser> m_chooser; |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 inline PickerIndicatorElement* toPickerIndicatorElement(Element* element) | 82 inline PickerIndicatorElement* toPickerIndicatorElement(Element* element) |
| 81 { | 83 { |
| 82 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isPickerIndicatorEleme
nt()); | 84 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isPickerIndicatorEleme
nt()); |
| 83 return static_cast<PickerIndicatorElement*>(element); | 85 return static_cast<PickerIndicatorElement*>(element); |
| 84 } | 86 } |
| 85 | 87 |
| 86 } | 88 } |
| 87 #endif | 89 #endif |
| 88 #endif | 90 #endif |
| OLD | NEW |