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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class PagePopup; | 42 class PagePopup; |
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 // FIXME: Remove. Deprecated in favor of double version. |
52 virtual void pickerIndicatorChooseValue(const String&) = 0; | 53 virtual void pickerIndicatorChooseValue(const String&) = 0; |
| 54 virtual void pickerIndicatorChooseValue(double) = 0; |
53 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; | 55 virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&)
= 0; |
54 }; | 56 }; |
55 | 57 |
56 static PassRefPtr<PickerIndicatorElement> create(Document&, PickerIndicatorO
wner&); | 58 static PassRefPtr<PickerIndicatorElement> create(Document&, PickerIndicatorO
wner&); |
57 virtual ~PickerIndicatorElement(); | 59 virtual ~PickerIndicatorElement(); |
58 void openPopup(); | 60 void openPopup(); |
59 void closePopup(); | 61 void closePopup(); |
60 virtual bool willRespondToMouseClickEvents() OVERRIDE; | 62 virtual bool willRespondToMouseClickEvents() OVERRIDE; |
61 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = 0; } | 63 void removePickerIndicatorOwner() { m_pickerIndicatorOwner = 0; } |
62 | 64 |
63 // DateTimeChooserClient implementation. | 65 // DateTimeChooserClient implementation. |
64 virtual void didChooseValue(const String&) OVERRIDE; | 66 virtual void didChooseValue(const String&) OVERRIDE; |
| 67 virtual void didChooseValue(double) OVERRIDE; |
65 virtual void didEndChooser() OVERRIDE; | 68 virtual void didEndChooser() OVERRIDE; |
66 | 69 |
67 private: | 70 private: |
68 PickerIndicatorElement(Document&, PickerIndicatorOwner&); | 71 PickerIndicatorElement(Document&, PickerIndicatorOwner&); |
69 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 72 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
70 virtual void defaultEventHandler(Event*) OVERRIDE; | 73 virtual void defaultEventHandler(Event*) OVERRIDE; |
71 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; | 74 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE; |
72 virtual bool isPickerIndicatorElement() const OVERRIDE; | 75 virtual bool isPickerIndicatorElement() const OVERRIDE; |
73 | 76 |
74 HTMLInputElement* hostInput(); | 77 HTMLInputElement* hostInput(); |
75 | 78 |
76 PickerIndicatorOwner* m_pickerIndicatorOwner; | 79 PickerIndicatorOwner* m_pickerIndicatorOwner; |
77 RefPtr<DateTimeChooser> m_chooser; | 80 RefPtr<DateTimeChooser> m_chooser; |
78 }; | 81 }; |
79 | 82 |
80 inline PickerIndicatorElement* toPickerIndicatorElement(Element* element) | 83 inline PickerIndicatorElement* toPickerIndicatorElement(Element* element) |
81 { | 84 { |
82 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isPickerIndicatorEleme
nt()); | 85 ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isPickerIndicatorEleme
nt()); |
83 return static_cast<PickerIndicatorElement*>(element); | 86 return static_cast<PickerIndicatorElement*>(element); |
84 } | 87 } |
85 | 88 |
86 } | 89 } |
87 #endif | 90 #endif |
88 #endif | 91 #endif |
OLD | NEW |