2010-12-13 David Holloway <dhollowa@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 19:56:19 +0000 (19:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 19:56:19 +0000 (19:56 +0000)
        Reviewed by Eric Seidel.

        [chromium] Removes deprecated logic following the consolidation of AutoFill and
        Autocomplete popup menu handling (https://bugs.webkit.org/show_bug.cgi?id=41236).
        Filling of the form fields is now handled completely on the Chromium side, for
        both AutoFill and Autocomplete.

        https://bugs.webkit.org/show_bug.cgi?id=41822

        * public/WebView.h:
        * src/AutoFillPopupMenuClient.cpp:
        (WebKit::AutoFillPopupMenuClient::AutoFillPopupMenuClient):
        (WebKit::AutoFillPopupMenuClient::valueChanged):
        * src/AutoFillPopupMenuClient.h:
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::applyAutoFillSuggestions):
        * src/WebViewImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/chromium/ChangeLog
WebKit/chromium/public/WebView.h
WebKit/chromium/src/AutoFillPopupMenuClient.cpp
WebKit/chromium/src/AutoFillPopupMenuClient.h
WebKit/chromium/src/WebViewImpl.cpp
WebKit/chromium/src/WebViewImpl.h

index 431acb5..c64571d 100644 (file)
@@ -1,3 +1,23 @@
+2010-12-13  David Holloway  <dhollowa@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] Removes deprecated logic following the consolidation of AutoFill and
+        Autocomplete popup menu handling (https://bugs.webkit.org/show_bug.cgi?id=41236).
+        Filling of the form fields is now handled completely on the Chromium side, for
+        both AutoFill and Autocomplete.
+
+        https://bugs.webkit.org/show_bug.cgi?id=41822
+
+        * public/WebView.h:
+        * src/AutoFillPopupMenuClient.cpp:
+        (WebKit::AutoFillPopupMenuClient::AutoFillPopupMenuClient):
+        (WebKit::AutoFillPopupMenuClient::valueChanged):
+        * src/AutoFillPopupMenuClient.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::applyAutoFillSuggestions):
+        * src/WebViewImpl.h:
+
 2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Rollout 73914, 73915, 73917, 73920 and 73921.
index d9d72c7..a18a64e 100644 (file)
@@ -279,14 +279,6 @@ public:
 
     // AutoFill  -----------------------------------------------------------
 
-    // DEPRECATED.
-    virtual void applyAutoFillSuggestions(
-        const WebNode&,
-        const WebVector<WebString>& names,
-        const WebVector<WebString>& labels,
-        const WebVector<int>& uniqueIDs,
-        int separatorIndex) = 0;
-
     // Notifies the WebView that AutoFill suggestions are available for a node.
     // |uniqueIDs| is a vector of IDs that represent the unique ID of each
     // AutoFill profile in the suggestions popup.  If a unique ID is 0, then the
@@ -302,14 +294,6 @@ public:
         const WebVector<int>& uniqueIDs,
         int separatorIndex) = 0;
 
-    // Notifies the WebView that Autocomplete suggestions are available for a
-    // node.
-    // DEPRECATED: merging with applyAutoFillSuggestions.
-    virtual void applyAutocompleteSuggestions(
-        const WebNode&,
-        const WebVector<WebString>& suggestions,
-        int defaultSuggestionIndex) = 0;
-
     // Hides any popup (suggestions, selects...) that might be showing.
     virtual void hidePopups() = 0;
 
index 32abd6f..704ba69 100644 (file)
@@ -51,7 +51,6 @@ AutoFillPopupMenuClient::AutoFillPopupMenuClient()
     : m_separatorIndex(-1)
     , m_selectedIndex(-1)
     , m_textField(0)
-    , m_AutocompleteModeEnabled(false)
 {
 }
 
@@ -123,36 +122,20 @@ bool AutoFillPopupMenuClient::canRemoveSuggestionAtIndex(unsigned listIndex)
 
 void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
 {
-    // DEPRECATED: Will be removed once AutoFill and Autocomplete merge is
-    // completed.
-    if (m_AutocompleteModeEnabled) {
-        m_textField->setValue(getSuggestion(listIndex));
-
-        WebViewImpl* webView = getWebView();
-        if (!webView)
-            return;
-
-        EditorClientImpl* editor =
-            static_cast<EditorClientImpl*>(webView->page()->editorClient());
-        ASSERT(editor);
-        editor->onAutocompleteSuggestionAccepted(
-            static_cast<HTMLInputElement*>(m_textField.get()));
-    } else {
-      WebViewImpl* webView = getWebView();
-      if (!webView)
-          return;
-
-      if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
-          --listIndex;
-
-      ASSERT(listIndex < m_names.size());
-
-      webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
-                                                     m_names[listIndex],
-                                                     m_labels[listIndex],
-                                                     m_uniqueIDs[listIndex],
-                                                     listIndex);
-    }
+    WebViewImpl* webView = getWebView();
+    if (!webView)
+        return;
+
+    if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
+        --listIndex;
+
+    ASSERT(listIndex < m_names.size());
+
+    webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
+                                                   m_names[listIndex],
+                                                   m_labels[listIndex],
+                                                   m_uniqueIDs[listIndex],
+                                                   listIndex);
 }
 
 void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)
index e3edfd3..0129a81 100644 (file)
@@ -114,10 +114,6 @@ public:
                         const WebVector<int>& uniqueIDs,
                         int separatorIndex);
 
-    // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is
-    // complete.
-    void setAutocompleteMode(bool enabled) { m_AutocompleteModeEnabled = enabled; }
-
 private:
     // Convert the specified index from an index into the visible list (which might
     // include a separator entry) to an index to |m_names| and |m_labels|.
@@ -147,10 +143,6 @@ private:
     RefPtr<WebCore::HTMLInputElement> m_textField;
     OwnPtr<WebCore::PopupMenuStyle> m_regularStyle;
     OwnPtr<WebCore::PopupMenuStyle> m_warningStyle;
-
-    // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is
-    // complete.
-    bool m_AutocompleteModeEnabled;
 };
 
 } // namespace WebKit
index 49a3d78..ac05dd2 100644 (file)
@@ -1921,17 +1921,6 @@ void WebViewImpl::applyAutoFillSuggestions(
     const WebNode& node,
     const WebVector<WebString>& names,
     const WebVector<WebString>& labels,
-    const WebVector<int>& uniqueIDs,
-    int separatorIndex)
-{
-    WebVector<WebString> icons(names.size());
-    applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, separatorIndex);
-}
-
-void WebViewImpl::applyAutoFillSuggestions(
-    const WebNode& node,
-    const WebVector<WebString>& names,
-    const WebVector<WebString>& labels,
     const WebVector<WebString>& icons,
     const WebVector<int>& uniqueIDs,
     int separatorIndex)
@@ -1977,30 +1966,6 @@ void WebViewImpl::applyAutoFillSuggestions(
         m_autoFillPopup->show(focusedNode->getRect(), focusedNode->ownerDocument()->view(), 0);
         m_autoFillPopupShowing = true;
     }
-
-    // DEPRECATED: This special mode will go away once AutoFill and Autocomplete
-    // merge is complete.
-    if (m_autoFillPopupClient)
-        m_autoFillPopupClient->setAutocompleteMode(false);
-}
-
-// DEPRECATED: replacing with applyAutoFillSuggestions.
-void WebViewImpl::applyAutocompleteSuggestions(
-    const WebNode& node,
-    const WebVector<WebString>& suggestions,
-    int defaultSuggestionIndex)
-{
-    WebVector<WebString> names(suggestions.size());
-    WebVector<WebString> labels(suggestions.size());
-    WebVector<WebString> icons(suggestions.size());
-    WebVector<int> uniqueIDs(suggestions.size());
-
-    for (size_t i = 0; i < suggestions.size(); ++i)
-        names[i] = suggestions[i];
-
-    applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, -1);
-    if (m_autoFillPopupClient)
-        m_autoFillPopupClient->setAutocompleteMode(true);
 }
 
 void WebViewImpl::hidePopups()
index 759a463..6e8dcac 100644 (file)
@@ -180,13 +180,6 @@ public:
                                      const WebString& value);
     virtual WebDevToolsAgent* devToolsAgent();
     virtual WebAccessibilityObject accessibilityObject();
-    // DEPRECATED.
-    virtual void applyAutoFillSuggestions(
-        const WebNode&,
-        const WebVector<WebString>& names,
-        const WebVector<WebString>& labels,
-        const WebVector<int>& uniqueIDs,
-        int separatorIndex);
     virtual void applyAutoFillSuggestions(
         const WebNode&,
         const WebVector<WebString>& names,
@@ -194,11 +187,6 @@ public:
         const WebVector<WebString>& icons,
         const WebVector<int>& uniqueIDs,
         int separatorIndex);
-    // DEPRECATED: replacing with applyAutoFillSuggestions.
-    virtual void applyAutocompleteSuggestions(
-        const WebNode&,
-        const WebVector<WebString>& suggestions,
-        int defaultSuggestionIndex);
     virtual void hidePopups();
     virtual void setScrollbarColors(unsigned inactiveColor,
                                     unsigned activeColor,