summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-08 16:00:21 +0100
committerBen Murdoch <benm@google.com>2010-10-08 17:06:07 +0100
commit9dd59112365c6368f9d510822009c59f1981d670 (patch)
treebb72cfa44df2a60ebf80df9070c6c127fb77e7f4 /WebCore
parentf4220bb8c200137e401bfce313ec01c6dc1e59e0 (diff)
downloadexternal_webkit-9dd59112365c6368f9d510822009c59f1981d670.zip
external_webkit-9dd59112365c6368f9d510822009c59f1981d670.tar.gz
external_webkit-9dd59112365c6368f9d510822009c59f1981d670.tar.bz2
Fix WebCore/WebKit layering violation.
Move the call to WebViewCore::updateTextfield() to the PlatformBridge so that WebCore code does not depend on WebKit code to compile. In addition to being a layering violation, the inclusion of WebViewCore.h includes WebCoreJni.h, which in a future change causes LOG to get #undefined when using the chromium net stack. Change-Id: Id88d332624323e03ce82120ef55db200cbabe63b
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/html/HTMLInputElement.cpp6
-rw-r--r--WebCore/html/HTMLTextAreaElement.cpp4
-rw-r--r--WebCore/platform/android/PlatformBridge.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 7e01de5..ef7c42f 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -68,7 +68,7 @@
#include "StepRange.h"
#include "TextEvent.h"
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
-#include "WebViewCore.h"
+#include "PlatformBridge.h"
#endif
#include "WheelEvent.h"
#include <wtf/HashMap.h>
@@ -885,7 +885,7 @@ void HTMLInputElement::updateType()
DeprecatedInputType newType = typeString.isEmpty() ? TEXT : typeMap->get(typeString);
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
if (newType == PASSWORD && document()->focusedNode() == this)
- android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, true, String());
+ PlatformBridge::updateTextfield(document()->view(), this, true, String());
#endif
// IMPORTANT: Don't allow the type to be changed to FILE after the first
@@ -1638,7 +1638,7 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
unsigned max = m_data.value().length();
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
// Make sure our UI side textfield changes to match the RenderTextControl
- android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value);
+ PlatformBridge::updateTextfield(document()->view(), this, false, value);
#endif
if (document()->focusedNode() == this)
InputElement::updateSelectionRange(this, this, max, max);
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index a5e7d1e..2741bfe 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -50,7 +50,7 @@
#include <wtf/StdLibExtras.h>
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
-#include "WebViewCore.h"
+#include "PlatformBridge.h"
#endif
namespace WebCore {
@@ -325,7 +325,7 @@ void HTMLTextAreaElement::setValueCommon(const String& value)
if (document()->focusedNode() == this) {
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
// Make sure our UI side textfield changes to match the RenderTextControl
- android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value);
+ PlatformBridge::updateTextfield(document()->view(), this, false, value);
#endif
unsigned endOfString = m_value.length();
setSelectionRange(endOfString, endOfString);
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h
index 948847a..3900a74 100644
--- a/WebCore/platform/android/PlatformBridge.h
+++ b/WebCore/platform/android/PlatformBridge.h
@@ -84,6 +84,7 @@ namespace WebCore {
class Document;
class FrameView;
+class Node;
class Widget;
// An interface to the embedding layer, which has the ability to answer
@@ -133,6 +134,8 @@ public:
// Update the viewport meta data.
static void updateViewport(FrameView*);
+
+ static void updateTextfield(FrameView*, Node*, bool changeToPassword, const WTF::String& text);
};
}