OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // An InputType object represents the type-specific part of an HTMLInputElement. | 52 // An InputType object represents the type-specific part of an HTMLInputElement. |
53 // Do not expose instances of InputType and classes derived from it to classes | 53 // Do not expose instances of InputType and classes derived from it to classes |
54 // other than HTMLInputElement. | 54 // other than HTMLInputElement. |
55 // FIXME: InputType should not inherit InputTypeView. It's conceptually wrong. | 55 // FIXME: InputType should not inherit InputTypeView. It's conceptually wrong. |
56 class InputType : public InputTypeView { | 56 class InputType : public InputTypeView { |
57 WTF_MAKE_NONCOPYABLE(InputType); | 57 WTF_MAKE_NONCOPYABLE(InputType); |
58 WTF_MAKE_FAST_ALLOCATED; | 58 WTF_MAKE_FAST_ALLOCATED; |
59 | 59 |
60 public: | 60 public: |
61 static PassRefPtr<InputType> create(HTMLInputElement*, const AtomicString&); | 61 static PassRefPtr<InputType> create(HTMLInputElement&, const AtomicString&); |
62 static PassRefPtr<InputType> createText(HTMLInputElement*); | 62 static PassRefPtr<InputType> createText(HTMLInputElement&); |
63 static const AtomicString& normalizeTypeName(const AtomicString&); | 63 static const AtomicString& normalizeTypeName(const AtomicString&); |
64 virtual ~InputType(); | 64 virtual ~InputType(); |
65 | 65 |
66 static bool canChangeFromAnotherType(const AtomicString& normalizedTypeName)
; | 66 static bool canChangeFromAnotherType(const AtomicString& normalizedTypeName)
; |
67 static bool themeSupportsDataListUI(InputType*); | 67 static bool themeSupportsDataListUI(InputType*); |
68 | 68 |
69 virtual const AtomicString& formControlType() const = 0; | 69 virtual const AtomicString& formControlType() const = 0; |
70 | 70 |
71 // Type query functions | 71 // Type query functions |
72 | 72 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 virtual unsigned height() const; | 232 virtual unsigned height() const; |
233 virtual unsigned width() const; | 233 virtual unsigned width() const; |
234 | 234 |
235 void dispatchSimulatedClickIfActive(KeyboardEvent*) const; | 235 void dispatchSimulatedClickIfActive(KeyboardEvent*) const; |
236 | 236 |
237 // InputTypeView override | 237 // InputTypeView override |
238 virtual bool shouldSubmitImplicitly(Event*) OVERRIDE; | 238 virtual bool shouldSubmitImplicitly(Event*) OVERRIDE; |
239 virtual bool hasCustomFocusLogic() const OVERRIDE; | 239 virtual bool hasCustomFocusLogic() const OVERRIDE; |
240 | 240 |
241 protected: | 241 protected: |
242 InputType(HTMLInputElement* element) : InputTypeView(element) { } | 242 InputType(HTMLInputElement& element) : InputTypeView(element) { } |
243 Chrome* chrome() const; | 243 Chrome* chrome() const; |
244 Locale& locale() const; | 244 Locale& locale() const; |
245 Decimal parseToNumberOrNaN(const String&) const; | 245 Decimal parseToNumberOrNaN(const String&) const; |
246 void observeFeatureIfVisible(UseCounter::Feature) const; | 246 void observeFeatureIfVisible(UseCounter::Feature) const; |
247 | 247 |
248 private: | 248 private: |
249 // Helper for stepUp()/stepDown(). Adds step value * count to the current va
lue. | 249 // Helper for stepUp()/stepDown(). Adds step value * count to the current va
lue. |
250 void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, Exception
State&); | 250 void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, Exception
State&); |
251 }; | 251 }; |
252 | 252 |
253 } // namespace WebCore | 253 } // namespace WebCore |
254 #endif | 254 #endif |
OLD | NEW |