Less logging and more key handling

Change-Id: I53661e8247e8ef17e77f0e15dff9b094fe71cd68
diff --git a/Source/WebKit/fuchsia/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit/fuchsia/WebCoreSupport/WebEditorClient.cpp
index cac99c2..9f13a07 100644
--- a/Source/WebKit/fuchsia/WebCoreSupport/WebEditorClient.cpp
+++ b/Source/WebKit/fuchsia/WebCoreSupport/WebEditorClient.cpp
@@ -10,9 +10,9 @@
 
 #include <hid/usages.h>
 
-#pragma clang diagnostic ignored "-Wunused-parameter"
+#include <iostream>
 
-#define FuchsiaLogNever(...)
+#pragma clang diagnostic ignored "-Wunused-parameter"
 
 #ifdef notImplemented
 #undef notImplemented
@@ -23,220 +23,189 @@
 {
 
 using namespace WebCore;
+using namespace std;
 
 bool WebEditorClient::shouldDeleteRange(Range* range)
 {
-    FuchsiaLogNever("WebEditorClient::shouldDeleteRange");
     return true;
 }
 
 bool WebEditorClient::smartInsertDeleteEnabled()
 {
-    FuchsiaLogNever("WebEditorClient::smartInsertDeleteEnabled");
     return false;
 }
  
 bool WebEditorClient::isSelectTrailingWhitespaceEnabled()
 {
-    FuchsiaLogNever("WebEditorClient::isSelectTrailingWhitespaceEnabled");
     return true;
 }
 
 bool WebEditorClient::isContinuousSpellCheckingEnabled()
 {
-    FuchsiaLogNever("WebEditorClient::isContinuousSpellCheckingEnabled");
     return false;
 }
 
 void WebEditorClient::toggleContinuousSpellChecking()
 {
-    FuchsiaLogNever("WebEditorClient::toggleContinuousSpellChecking");
     notImplemented();
 }
 
 bool WebEditorClient::isGrammarCheckingEnabled()
 {
-    FuchsiaLogNever("WebEditorClient::isGrammarCheckingEnabled");
     return false;
 }
 
 void WebEditorClient::toggleGrammarChecking()
 {
-    FuchsiaLogNever("WebEditorClient::toggleGrammarChecking");
     notImplemented();
 }
 
 int WebEditorClient::spellCheckerDocumentTag()
 {
-    FuchsiaLogNever("WebEditorClient::spellCheckerDocumentTag");
     notImplemented();
     return false;
 }
 
 bool WebEditorClient::shouldBeginEditing(Range* range)
 {
-    FuchsiaLogNever("WebEditorClient::shouldBeginEditing");
+    cerr << "WebEditorClient::shouldBeginEditing" << endl;
     return true;
 }
 
 bool WebEditorClient::shouldEndEditing(Range* range)
 {
-    FuchsiaLogNever("WebEditorClient::shouldEndEditing");
+    cerr << "WebEditorClient::shouldEndEditing" << endl;
     return true;
 }
 
 bool WebEditorClient::shouldInsertNode(Node* node, Range* rangeToReplace, EditorInsertAction action)
 {
-    FuchsiaLogNever("WebEditorClient::shouldInsertNode");
     return true;
 }
 
 bool WebEditorClient::shouldInsertText(const String& text, Range* rangeToReplace, EditorInsertAction action)
 {
-    FuchsiaLogNever("WebEditorClient::shouldInsertText");
     return true;
 }
 
 bool WebEditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting)
 {
-    FuchsiaLogNever("WebEditorClient::shouldChangeSelectedRange");
     return true;
 }
     
 bool WebEditorClient::shouldApplyStyle(StyleProperties* style, Range* range)
 {
-    FuchsiaLogNever("WebEditorClient::shouldApplyStyle");
     return true;
 }
 
 void WebEditorClient::didApplyStyle()
 {
-    FuchsiaLogNever("WebEditorClient::didApplyStyle");
     notImplemented();
 }
 
 bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*)
 {
-    FuchsiaLogNever("WebEditorClient::shouldMoveRangeAfterDelete");
-    notImplemented();
     return true;
 }
 
 void WebEditorClient::didBeginEditing()
 {
-    FuchsiaLogNever("WebEditorClient::didBeginEditing");
+    cerr << "WebEditorClient::didBeginEditing" << endl;
     notImplemented();
 }
 
 void WebEditorClient::respondToChangedContents()
 {
-    FuchsiaLogNever("WebEditorClient::respondToChangedSelection");
     notImplemented();
 }
 
 void WebEditorClient::respondToChangedSelection(Frame* frame)
 {
-    FuchsiaLogNever("WebEditorClient::respondToChangedSelection");
     notImplemented();
 }
 
 void WebEditorClient::didChangeSelectionAndUpdateLayout()
 {
-    FuchsiaLogNever("WebEditorClient::didChangeSelectionAndUpdateLayout");
     notImplemented();
 }
 
 void WebEditorClient::updateEditorStateAfterLayoutIfEditabilityChanged()
 {
-    FuchsiaLogNever("WebEditorClient::updateEditorStateAfterLayoutIfEditabilityChanged");
     notImplemented();
 }
 
 void WebEditorClient::discardedComposition(Frame*)
 {
-    FuchsiaLogNever("WebEditorClient::discardedComposition");
     notImplemented();
 }
 
 void WebEditorClient::didEndEditing()
 {
-    FuchsiaLogNever("WebEditorClient::didEndEditing");
+    cerr << "WebEditorClient::didEndEditing" << endl;
     notImplemented();
 }
 
 void WebEditorClient::didWriteSelectionToPasteboard()
 {
-    FuchsiaLogNever("WebEditorClient::didWriteSelectionToPasteboard");
     notImplemented();
 }
 
 void WebEditorClient::willWriteSelectionToPasteboard(Range* range)
 {
-    FuchsiaLogNever("WebEditorClient::willWriteSelectionToPasteboard");
     notImplemented();
 }
 
 void WebEditorClient::getClientPasteboardDataForRange(Range* range, Vector<String>& pasteboardTypes, Vector<RefPtr<SharedBuffer>>& pasteboardData)
 {
-    FuchsiaLogNever("WebEditorClient::getClientPasteboardDataForRange");
     notImplemented();
 }
 
 void WebEditorClient::registerUndoStep(PassRefPtr<UndoStep> step)
 {
-    FuchsiaLogNever("WebEditorClient::registerUndoStep");
     notImplemented();
 }
 
 void WebEditorClient::registerRedoStep(PassRefPtr<UndoStep>)
 {
-    FuchsiaLogNever("WebEditorClient::registerRedoStep");
     notImplemented();
 }
 
 void WebEditorClient::clearUndoRedoOperations()
 {
-    FuchsiaLogNever("WebEditorClient::clearUndoRedoOperations");
     notImplemented();
 }
 
 bool WebEditorClient::canCopyCut(Frame*, bool defaultValue) const
 {
-    FuchsiaLogNever("WebEditorClient::canCopyCut");
     notImplemented();
     return false;
 }
 
 bool WebEditorClient::canPaste(Frame*, bool defaultValue) const
 {
-    FuchsiaLogNever("WebEditorClient::canPaste");
     notImplemented();
     return false;
 }
 
 bool WebEditorClient::canUndo() const
 {
-    FuchsiaLogNever("WebEditorClient::canUndo");
     notImplemented();
     return false;
 }
 
 bool WebEditorClient::canRedo() const
 {
-    FuchsiaLogNever("WebEditorClient::canRedo");
     notImplemented();
     return false;
 }
 
 void WebEditorClient::undo()
 {
-    FuchsiaLogNever("WebEditorClient::undo");
     notImplemented();
 }
 
 void WebEditorClient::redo()
 {
-    FuchsiaLogNever("WebEditorClient::redo");
     notImplemented();
 }
 
@@ -247,11 +216,23 @@
     int keyCode = platformEvent->nativeVirtualKeyCode();
     bool eventHandled = false;
     bool shiftHeld = platformEvent->shiftKey();
-    String commandName;
+    String commandName="";
     switch(keyCode) {
     case HID_USAGE_KEY_BACKSPACE:
         commandName = "DeleteBackward";
         break;
+    case HID_USAGE_KEY_TAB:
+        commandName = "InsertTab";
+        break;
+    case HID_USAGE_KEY_PAGEUP:
+        commandName = "ScrollPageBackward";
+        break;
+    case HID_USAGE_KEY_PAGEDOWN:
+        commandName = "ScrollPageForward";
+        break;
+    case HID_USAGE_KEY_ENTER:
+        commandName = "InsertNewline";
+        break;
     case HID_USAGE_KEY_LEFT:
         if (shiftHeld)
             commandName = "MoveBackwardAndModifySelection";
@@ -264,10 +245,6 @@
         else
             commandName = "MoveForward";
         break;
-        break;
-    default:
-        eventHandled = frame->editor().insertText(platformEvent->text(), event);
-        break;
     }
 
     if (commandName == "") {
@@ -284,88 +261,74 @@
 
 void WebEditorClient::handleInputMethodKeydown(KeyboardEvent*)
 {
-    FuchsiaLogNever("WebEditorClient::handleInputMethodKeydown");
     notImplemented();
 }
 
 void WebEditorClient::textFieldDidBeginEditing(Element* element)
 {
-    FuchsiaLogNever("WebEditorClient::textFieldDidBeginEditing");
     notImplemented();
 }
 
 void WebEditorClient::textFieldDidEndEditing(Element* element)
 {
-    FuchsiaLogNever("WebEditorClient::textFieldDidEndEditing");
     notImplemented();
 }
 
 void WebEditorClient::textDidChangeInTextField(Element* element)
 {
-    FuchsiaLogNever("WebEditorClient::textDidChangeInTextField");
     notImplemented();
 }
 
 void WebEditorClient::textDidChangeInTextArea(Element* element)
 {
-    FuchsiaLogNever("WebEditorClient::textDidChangeInTextArea");
     notImplemented();
 }
 
 void WebEditorClient::overflowScrollPositionChanged()
 {
-    FuchsiaLogNever("WebEditorClient::overflowScrollPositionChanged");
     notImplemented();
 }
 
 bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event)
 {
-    FuchsiaLogNever("WebEditorClient::doTextFieldCommandFromEvent");
     notImplemented();
     return false;
 }
 
 void WebEditorClient::textWillBeDeletedInTextField(Element* element)
 {
-    FuchsiaLogNever("WebEditorClient::textWillBeDeletedInTextField");
     notImplemented();
 }
 
 bool WebEditorClient::shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType type) const
 {
-    FuchsiaLogNever("WebEditorClient::shouldEraseMarkersAfterChangeSelection");
     notImplemented();
     return false;
 }
 
 void WebEditorClient::ignoreWordInSpellDocument(const String& word)
 {
-    FuchsiaLogNever("WebEditorClient::ignoreWordInSpellDocument");
     notImplemented();
 }
 
 void WebEditorClient::learnWord(const String& word)
 {
-    FuchsiaLogNever("WebEditorClient::learnWord");
     notImplemented();
 }
 
 void WebEditorClient::checkSpellingOfString(StringView text, int* misspellingLocation, int* misspellingLength)
 {
-    FuchsiaLogNever("WebEditorClient::checkSpellingOfString");
     notImplemented();
 }
 
 String WebEditorClient::getAutoCorrectSuggestionForMisspelledWord(const String&)
 {
-    FuchsiaLogNever("WebEditorClient::getAutoCorrectSuggestionForMisspelledWord");
     notImplemented();
     return String();
 }
 
 void WebEditorClient::checkGrammarOfString(StringView text, Vector<WebCore::GrammarDetail>& grammarDetails, int* badGrammarLocation, int* badGrammarLength)
 {
-    FuchsiaLogNever("WebEditorClient::checkGrammarOfString");
     notImplemented();
 }