Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp

Issue 1896073002: Make BaseChooserOnlyDateAndTimeInputType a subclass of InputTypeView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
index 39f42c56061eea9ccab1a8d6f656b94d9cc3ce4b..15a058dc022aa06799f0d1db8fa8ad82a4d2d8da 100644
--- a/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
@@ -25,7 +25,6 @@
#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
-#if !ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/dom/Document.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -37,12 +36,18 @@
namespace blink {
-BaseChooserOnlyDateAndTimeInputType::BaseChooserOnlyDateAndTimeInputType(HTMLInputElement& element)
- : BaseDateAndTimeInputType(element)
+BaseChooserOnlyDateAndTimeInputType::BaseChooserOnlyDateAndTimeInputType(HTMLInputElement& element, BaseDateAndTimeInputType& inputType)
+ : InputTypeView(element)
+ , m_inputType(inputType)
{
ThreadState::current()->registerPreFinalizer(this);
}
+BaseChooserOnlyDateAndTimeInputType* BaseChooserOnlyDateAndTimeInputType::create(HTMLInputElement& element, BaseDateAndTimeInputType& inputType)
+{
+ return new BaseChooserOnlyDateAndTimeInputType(element, inputType);
+}
+
BaseChooserOnlyDateAndTimeInputType::~BaseChooserOnlyDateAndTimeInputType()
{
ASSERT(!m_dateTimeChooser);
@@ -50,8 +55,9 @@ BaseChooserOnlyDateAndTimeInputType::~BaseChooserOnlyDateAndTimeInputType()
DEFINE_TRACE(BaseChooserOnlyDateAndTimeInputType)
{
+ visitor->trace(m_inputType);
visitor->trace(m_dateTimeChooser);
- BaseDateAndTimeInputType::trace(visitor);
+ InputTypeView::trace(visitor);
DateTimeChooserClient::trace(visitor);
}
@@ -89,7 +95,7 @@ void BaseChooserOnlyDateAndTimeInputType::updateView()
if (!element().suggestedValue().isNull())
displayValue = element().suggestedValue();
else
- displayValue = visibleValue();
+ displayValue = m_inputType->visibleValue();
if (displayValue.isEmpty()) {
// Need to put something to keep text baseline.
displayValue = " ";
@@ -155,9 +161,8 @@ void BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent(KeyboardEvent* event)
void BaseChooserOnlyDateAndTimeInputType::accessKeyAction(bool sendMouseEvents)
{
- BaseDateAndTimeInputType::accessKeyAction(sendMouseEvents);
+ InputTypeView::accessKeyAction(sendMouseEvents);
BaseClickableWithKeyInputType::accessKeyAction(element(), sendMouseEvents);
}
-}
-#endif
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698