| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 closeDateTimeChooser(); | 42 closeDateTimeChooser(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*) | 45 void BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent(Event*) |
| 46 { | 46 { |
| 47 if (element()->isDisabledOrReadOnly() || !element()->renderer() || !ScriptCo
ntroller::processingUserGesture()) | 47 if (element()->isDisabledOrReadOnly() || !element()->renderer() || !ScriptCo
ntroller::processingUserGesture()) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 if (m_dateTimeChooser) | 50 if (m_dateTimeChooser) |
| 51 return; | 51 return; |
| 52 if (!element()->document()->page()) | 52 if (!element()->document().page()) |
| 53 return; | 53 return; |
| 54 DateTimeChooserParameters parameters; | 54 DateTimeChooserParameters parameters; |
| 55 if (!element()->setupDateTimeChooserParameters(parameters)) | 55 if (!element()->setupDateTimeChooserParameters(parameters)) |
| 56 return; | 56 return; |
| 57 m_dateTimeChooser = element()->document()->page()->chrome().openDateTimeChoo
ser(this, parameters); | 57 m_dateTimeChooser = element()->document().page()->chrome().openDateTimeChoos
er(this, parameters); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree() | 60 void BaseChooserOnlyDateAndTimeInputType::createShadowSubtree() |
| 61 { | 61 { |
| 62 DEFINE_STATIC_LOCAL(AtomicString, valueContainerPseudo, ("-webkit-date-and-t
ime-value", AtomicString::ConstructFromLiteral)); | 62 DEFINE_STATIC_LOCAL(AtomicString, valueContainerPseudo, ("-webkit-date-and-t
ime-value", AtomicString::ConstructFromLiteral)); |
| 63 | 63 |
| 64 RefPtr<HTMLDivElement> valueContainer = HTMLDivElement::create(element()->do
cument()); | 64 RefPtr<HTMLDivElement> valueContainer = HTMLDivElement::create(&element()->d
ocument()); |
| 65 valueContainer->setPart(valueContainerPseudo); | 65 valueContainer->setPart(valueContainerPseudo); |
| 66 element()->userAgentShadowRoot()->appendChild(valueContainer.get()); | 66 element()->userAgentShadowRoot()->appendChild(valueContainer.get()); |
| 67 updateAppearance(); | 67 updateAppearance(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void BaseChooserOnlyDateAndTimeInputType::updateAppearance() | 70 void BaseChooserOnlyDateAndTimeInputType::updateAppearance() |
| 71 { | 71 { |
| 72 Node* node = element()->userAgentShadowRoot()->firstChild(); | 72 Node* node = element()->userAgentShadowRoot()->firstChild(); |
| 73 if (!node || !node->isHTMLElement()) | 73 if (!node || !node->isHTMLElement()) |
| 74 return; | 74 return; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents) | 126 void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents) |
| 127 { | 127 { |
| 128 BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents); | 128 BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents); |
| 129 BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents); | 129 BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } | 132 } |
| 133 #endif | 133 #endif |
| OLD | NEW |