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

Unified Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 72543005: Get rid of explict editor dependency from text field (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-11-15T16:10:10 Created 7 years, 1 month 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: Source/core/html/forms/TextFieldInputType.cpp
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 72d13c58a415b111bd35e1e3c9ede2f4f4860495..95669ea678e71c11ccf08bf6ed585bf719f3700e 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -39,7 +39,6 @@
#include "core/dom/NodeRenderStyle.h"
#include "core/events/TextEvent.h"
#include "core/dom/shadow/ShadowRoot.h"
-#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/TextIterator.h"
#include "core/html/FormDataList.h"
@@ -47,6 +46,8 @@
#include "core/html/shadow/ShadowElementNames.h"
#include "core/html/shadow/TextControlInnerElements.h"
#include "core/frame/Frame.h"
+#include "core/page/Chrome.h"
+#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
#include "core/page/Settings.h"
#include "core/rendering/RenderLayer.h"
@@ -153,9 +154,12 @@ void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
{
if (!element().focused())
return;
- Frame* frame = element().document().frame();
- if (!frame || !frame->editor().doTextFieldCommandFromEvent(&element(), event))
- return;
+ if (Frame* frame = element().document().frame()) {
+ if (Page* page = frame->page()) {
+ page->chrome().client().doTextFieldCommandFromEvent(&element(), event);
tkent 2013/11/15 08:18:06 You can use InputType::chrome().
yosin_UTC9 2013/11/15 11:06:01 Done.
+ return;
+ }
+ }
event->setDefaultHandled();
}
@@ -442,8 +446,10 @@ void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state)
{
if (!element().focused())
return;
- if (Frame* frame = element().document().frame())
- frame->editor().textDidChangeInTextField(&element());
+ if (Frame* frame = element().document().frame()) {
+ if (Page* page = frame->page())
+ page->chrome().client().textDidChangeInTextField(&element());
tkent 2013/11/15 08:18:06 ditto.
yosin_UTC9 2013/11/15 11:06:01 Done.
+ }
}
void TextFieldInputType::spinButtonStepDown()

Powered by Google App Engine
This is Rietveld 408576698