Title: [131937] trunk/Source/WebKit/blackberry
Revision
131937
Author
[email protected]
Date
2012-10-19 13:09:02 -0700 (Fri, 19 Oct 2012)

Log Message

[BlackBerry] Move all keyboard type calculations into InputHandler.
https://bugs.webkit.org/show_bug.cgi?id=99847

Reviewed by Yong Li.

PR 227381.

Move all keyboard type calculations into webkit and avoid passing type
information to the webview.

Reviewed Internally by Nima Ghanavatian.

* Api/WebPageClient.h:
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::convertInputTypeToVKBType):
(WebKit):
(BlackBerry::WebKit::InputHandler::setElementFocused):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (131936 => 131937)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-10-19 20:03:57 UTC (rev 131936)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-10-19 20:09:02 UTC (rev 131937)
@@ -139,7 +139,7 @@
     virtual void notifyContentRendered(const Platform::IntRect&) = 0;
     virtual void resizeSurfaceIfNeeded() = 0;
 
-    virtual void inputFocusGained(Platform::BlackBerryInputType, int inputStyle, Platform::VirtualKeyboardType, Platform::VirtualKeyboardEnterKeyType) = 0;
+    virtual void inputFocusGained(int inputStyle, Platform::VirtualKeyboardType, Platform::VirtualKeyboardEnterKeyType) = 0;
     virtual void inputFocusLost() = 0;
     virtual void inputTextChanged() = 0;
     virtual void inputSelectionChanged(unsigned selectionStart, unsigned selectionEnd) = 0;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (131936 => 131937)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-10-19 20:03:57 UTC (rev 131936)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-10-19 20:09:02 UTC (rev 131937)
@@ -1,3 +1,23 @@
+2012-10-19  Mike Fenton  <[email protected]>
+
+        [BlackBerry] Move all keyboard type calculations into InputHandler.
+        https://bugs.webkit.org/show_bug.cgi?id=99847
+
+        Reviewed by Yong Li.
+
+        PR 227381.
+
+        Move all keyboard type calculations into webkit and avoid passing type
+        information to the webview.
+
+        Reviewed Internally by Nima Ghanavatian.
+
+        * Api/WebPageClient.h:
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::convertInputTypeToVKBType):
+        (WebKit):
+        (BlackBerry::WebKit::InputHandler::setElementFocused):
+
 2012-10-19  Jacky Jiang  <[email protected]>
 
         [BlackBerry] Page viewport aspect ratio not kept on navigating back

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (131936 => 131937)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-19 20:03:57 UTC (rev 131936)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-19 20:09:02 UTC (rev 131937)
@@ -242,6 +242,26 @@
     return DEFAULT_STYLE;
 }
 
+static VirtualKeyboardType convertInputTypeToVKBType(BlackBerryInputType inputType)
+{
+    switch (inputType) {
+    case InputTypeURL:
+        return VKBTypeUrl;
+    case InputTypeEmail:
+        return VKBTypeEmail;
+    case InputTypeTelephone:
+        return VKBTypePhone;
+    case InputTypePassword:
+        return VKBTypePassword;
+    case InputTypeNumber:
+    case InputTypeHexadecimal:
+        return VKBTypePin;
+    default:
+        // All other types are text based use default keyboard.
+        return VKBTypeDefault;
+    }
+}
+
 static VirtualKeyboardType convertStringToKeyboardType(const AtomicString& string)
 {
     DEFINE_STATIC_LOCAL(AtomicString, Default, ("default"));
@@ -812,6 +832,9 @@
     m_currentFocusElementTextEditMask = inputStyle(type, element);
 
     VirtualKeyboardType keyboardType = keyboardTypeAttribute(element);
+    if (keyboardType == VKBTypeNotSet)
+        keyboardType = convertInputTypeToVKBType(type);
+
     VirtualKeyboardEnterKeyType enterKeyType = keyboardEnterKeyTypeAttribute(element);
 
     if (enterKeyType == VKBEnterKeyNotSet && type != InputTypeTextArea) {
@@ -823,7 +846,7 @@
     }
 
     FocusLog(LogLevelInfo, "InputHandler::setElementFocused, Type=%d, Style=%d, Keyboard Type=%d, Enter Key=%d", type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
-    m_webPage->m_client->inputFocusGained(type, m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
+    m_webPage->m_client->inputFocusGained(m_currentFocusElementTextEditMask, keyboardType, enterKeyType);
 
     handleInputLocaleChanged(m_webPage->m_webSettings->isWritingDirectionRTL());
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to