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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 virtual ~FieldOwner(); | 53 virtual ~FieldOwner(); |
54 virtual void didBlurFromField() = 0; | 54 virtual void didBlurFromField() = 0; |
55 virtual void didFocusOnField() = 0; | 55 virtual void didFocusOnField() = 0; |
56 virtual void fieldValueChanged() = 0; | 56 virtual void fieldValueChanged() = 0; |
57 virtual bool focusOnNextField(const DateTimeFieldElement*) = 0; | 57 virtual bool focusOnNextField(const DateTimeFieldElement*) = 0; |
58 virtual bool focusOnPreviousField(const DateTimeFieldElement*) = 0; | 58 virtual bool focusOnPreviousField(const DateTimeFieldElement*) = 0; |
59 virtual bool isFieldOwnerDisabled() const = 0; | 59 virtual bool isFieldOwnerDisabled() const = 0; |
60 virtual bool isFieldOwnerReadOnly() const = 0; | 60 virtual bool isFieldOwnerReadOnly() const = 0; |
61 virtual AtomicString localeIdentifier() const = 0; | 61 virtual AtomicString localeIdentifier() const = 0; |
62 | 62 |
63 // We can't pass FieldOwner pointer into Visitor::visit function | 63 // We can't pass FieldOwner pointer into Visitor::mark function |
64 // directly because it does not coincide with the actual start of the ob
ject | 64 // directly because it does not coincide with the actual start of the ob
ject |
65 // and visitor has to access object header. Thus we need a helper method | 65 // and visitor has to access object header. Thus we need a helper method |
66 // that would correctly adjust the pointer before passing it into the | 66 // that will correctly adjust the pointer before passing it into the |
67 // visitor. | 67 // visitor. |
68 virtual void visitWith(Visitor*) const = 0; | 68 virtual void adjustAndMark(Visitor*) const = 0; |
69 virtual void trace(Visitor*) { } | 69 virtual void trace(Visitor*) { } |
70 }; | 70 }; |
71 | 71 |
72 virtual void defaultEventHandler(Event*) OVERRIDE; | 72 virtual void defaultEventHandler(Event*) OVERRIDE; |
73 virtual bool hasValue() const = 0; | 73 virtual bool hasValue() const = 0; |
74 bool isDisabled() const; | 74 bool isDisabled() const; |
75 virtual bool isFocusable() const OVERRIDE FINAL; | 75 virtual bool isFocusable() const OVERRIDE FINAL; |
76 virtual float maximumWidth(const Font&); | 76 virtual float maximumWidth(const Font&); |
77 virtual void populateDateTimeFieldsState(DateTimeFieldsState&) = 0; | 77 virtual void populateDateTimeFieldsState(DateTimeFieldsState&) = 0; |
78 void removeEventHandler() { m_fieldOwner = nullptr; } | 78 void removeEventHandler() { m_fieldOwner = nullptr; } |
(...skipping 27 matching lines...) Expand all Loading... |
106 virtual bool isDateTimeFieldElement() const OVERRIDE; | 106 virtual bool isDateTimeFieldElement() const OVERRIDE; |
107 bool isFieldOwnerDisabled() const; | 107 bool isFieldOwnerDisabled() const; |
108 bool isFieldOwnerReadOnly() const; | 108 bool isFieldOwnerReadOnly() const; |
109 virtual bool supportsFocus() const OVERRIDE FINAL; | 109 virtual bool supportsFocus() const OVERRIDE FINAL; |
110 | 110 |
111 Member<FieldOwner> m_fieldOwner; | 111 Member<FieldOwner> m_fieldOwner; |
112 }; | 112 }; |
113 | 113 |
114 template<> class TraceTrait<DateTimeFieldElement::FieldOwner> { | 114 template<> class TraceTrait<DateTimeFieldElement::FieldOwner> { |
115 public: | 115 public: |
116 static void visit(Visitor* visitor, const DateTimeFieldElement::FieldOwner*
self) { self->visitWith(visitor); } | 116 static void mark(Visitor* visitor, const DateTimeFieldElement::FieldOwner* s
elf) { self->adjustAndMark(visitor); } |
117 static intptr_t getTypeMarker() { return 0; } | 117 static intptr_t getTypeMarker() { return 0; } |
118 static void checkTypeMarker(Visitor*, const DateTimeFieldElement::FieldOwner
*) { } | 118 static void checkTypeMarker(Visitor*, const DateTimeFieldElement::FieldOwner
*) { } |
119 static void trace(Visitor* visitor, void* self) { static_cast<DateTimeFieldE
lement::FieldOwner*>(self)->trace(visitor); } | 119 static void trace(Visitor* visitor, void* self) { static_cast<DateTimeFieldE
lement::FieldOwner*>(self)->trace(visitor); } |
120 }; | 120 }; |
121 | 121 |
122 } // namespace WebCore | 122 } // namespace WebCore |
123 | 123 |
124 #endif | 124 #endif |
125 #endif | 125 #endif |
OLD | NEW |