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

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-18T17:22:32 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
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2d003e74b553f98b40e42af142ed7022b31fbfd5 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,10 @@ void TextFieldInputType::handleKeydownEvent(KeyboardEvent* event)
{
if (!element().focused())
return;
- Frame* frame = element().document().frame();
- if (!frame || !frame->editor().doTextFieldCommandFromEvent(&element(), event))
+ if (Chrome* chrome = this->chrome()) {
+ chrome->client().handleKeyboardEventOnTextField(element(), *event);
return;
+ }
event->setDefaultHandled();
}
@@ -442,8 +444,8 @@ void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state)
{
if (!element().focused())
return;
- if (Frame* frame = element().document().frame())
- frame->editor().textDidChangeInTextField(&element());
+ if (Chrome* chrome = this->chrome())
+ chrome->client().didChangeValueInTextField(element());
}
void TextFieldInputType::spinButtonStepDown()
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.cpp ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698