Changeset 73940 in webkit


Ignore:
Timestamp:
Dec 13, 2010 11:56:19 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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:
Location:
trunk/WebKit/chromium
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r73939 r73940  
     12010-12-13  David Holloway  <dhollowa@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] Removes deprecated logic following the consolidation of AutoFill and
     6        Autocomplete popup menu handling (https://bugs.webkit.org/show_bug.cgi?id=41236).
     7        Filling of the form fields is now handled completely on the Chromium side, for
     8        both AutoFill and Autocomplete.
     9
     10        https://bugs.webkit.org/show_bug.cgi?id=41822
     11
     12        * public/WebView.h:
     13        * src/AutoFillPopupMenuClient.cpp:
     14        (WebKit::AutoFillPopupMenuClient::AutoFillPopupMenuClient):
     15        (WebKit::AutoFillPopupMenuClient::valueChanged):
     16        * src/AutoFillPopupMenuClient.h:
     17        * src/WebViewImpl.cpp:
     18        (WebKit::WebViewImpl::applyAutoFillSuggestions):
     19        * src/WebViewImpl.h:
     20
    1212010-12-13  Yury Semikhatsky  <yurys@chromium.org>
    222
  • trunk/WebKit/chromium/public/WebView.h

    r72001 r73940  
    280280    // AutoFill  -----------------------------------------------------------
    281281
    282     // DEPRECATED.
    283     virtual void applyAutoFillSuggestions(
    284         const WebNode&,
    285         const WebVector<WebString>& names,
    286         const WebVector<WebString>& labels,
    287         const WebVector<int>& uniqueIDs,
    288         int separatorIndex) = 0;
    289 
    290282    // Notifies the WebView that AutoFill suggestions are available for a node.
    291283    // |uniqueIDs| is a vector of IDs that represent the unique ID of each
     
    303295        int separatorIndex) = 0;
    304296
    305     // Notifies the WebView that Autocomplete suggestions are available for a
    306     // node.
    307     // DEPRECATED: merging with applyAutoFillSuggestions.
    308     virtual void applyAutocompleteSuggestions(
    309         const WebNode&,
    310         const WebVector<WebString>& suggestions,
    311         int defaultSuggestionIndex) = 0;
    312 
    313297    // Hides any popup (suggestions, selects...) that might be showing.
    314298    virtual void hidePopups() = 0;
  • trunk/WebKit/chromium/src/AutoFillPopupMenuClient.cpp

    r72001 r73940  
    5252    , m_selectedIndex(-1)
    5353    , m_textField(0)
    54     , m_AutocompleteModeEnabled(false)
    5554{
    5655}
     
    124123void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
    125124{
    126     // DEPRECATED: Will be removed once AutoFill and Autocomplete merge is
    127     // completed.
    128     if (m_AutocompleteModeEnabled) {
    129         m_textField->setValue(getSuggestion(listIndex));
    130 
    131         WebViewImpl* webView = getWebView();
    132         if (!webView)
    133             return;
    134 
    135         EditorClientImpl* editor =
    136             static_cast<EditorClientImpl*>(webView->page()->editorClient());
    137         ASSERT(editor);
    138         editor->onAutocompleteSuggestionAccepted(
    139             static_cast<HTMLInputElement*>(m_textField.get()));
    140     } else {
    141       WebViewImpl* webView = getWebView();
    142       if (!webView)
    143           return;
    144 
    145       if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
    146           --listIndex;
    147 
    148       ASSERT(listIndex < m_names.size());
    149 
    150       webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
    151                                                      m_names[listIndex],
    152                                                      m_labels[listIndex],
    153                                                      m_uniqueIDs[listIndex],
    154                                                      listIndex);
    155     }
     125    WebViewImpl* webView = getWebView();
     126    if (!webView)
     127        return;
     128
     129    if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
     130        --listIndex;
     131
     132    ASSERT(listIndex < m_names.size());
     133
     134    webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
     135                                                   m_names[listIndex],
     136                                                   m_labels[listIndex],
     137                                                   m_uniqueIDs[listIndex],
     138                                                   listIndex);
    156139}
    157140
  • trunk/WebKit/chromium/src/AutoFillPopupMenuClient.h

    r72001 r73940  
    115115                        int separatorIndex);
    116116
    117     // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is
    118     // complete.
    119     void setAutocompleteMode(bool enabled) { m_AutocompleteModeEnabled = enabled; }
    120 
    121117private:
    122118    // Convert the specified index from an index into the visible list (which might
     
    148144    OwnPtr<WebCore::PopupMenuStyle> m_regularStyle;
    149145    OwnPtr<WebCore::PopupMenuStyle> m_warningStyle;
    150 
    151     // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is
    152     // complete.
    153     bool m_AutocompleteModeEnabled;
    154146};
    155147
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r73724 r73940  
    19221922    const WebVector<WebString>& names,
    19231923    const WebVector<WebString>& labels,
    1924     const WebVector<int>& uniqueIDs,
    1925     int separatorIndex)
    1926 {
    1927     WebVector<WebString> icons(names.size());
    1928     applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, separatorIndex);
    1929 }
    1930 
    1931 void WebViewImpl::applyAutoFillSuggestions(
    1932     const WebNode& node,
    1933     const WebVector<WebString>& names,
    1934     const WebVector<WebString>& labels,
    19351924    const WebVector<WebString>& icons,
    19361925    const WebVector<int>& uniqueIDs,
     
    19781967        m_autoFillPopupShowing = true;
    19791968    }
    1980 
    1981     // DEPRECATED: This special mode will go away once AutoFill and Autocomplete
    1982     // merge is complete.
    1983     if (m_autoFillPopupClient)
    1984         m_autoFillPopupClient->setAutocompleteMode(false);
    1985 }
    1986 
    1987 // DEPRECATED: replacing with applyAutoFillSuggestions.
    1988 void WebViewImpl::applyAutocompleteSuggestions(
    1989     const WebNode& node,
    1990     const WebVector<WebString>& suggestions,
    1991     int defaultSuggestionIndex)
    1992 {
    1993     WebVector<WebString> names(suggestions.size());
    1994     WebVector<WebString> labels(suggestions.size());
    1995     WebVector<WebString> icons(suggestions.size());
    1996     WebVector<int> uniqueIDs(suggestions.size());
    1997 
    1998     for (size_t i = 0; i < suggestions.size(); ++i)
    1999         names[i] = suggestions[i];
    2000 
    2001     applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, -1);
    2002     if (m_autoFillPopupClient)
    2003         m_autoFillPopupClient->setAutocompleteMode(true);
    20041969}
    20051970
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r73724 r73940  
    181181    virtual WebDevToolsAgent* devToolsAgent();
    182182    virtual WebAccessibilityObject accessibilityObject();
    183     // DEPRECATED.
    184     virtual void applyAutoFillSuggestions(
    185         const WebNode&,
    186         const WebVector<WebString>& names,
    187         const WebVector<WebString>& labels,
    188         const WebVector<int>& uniqueIDs,
    189         int separatorIndex);
    190183    virtual void applyAutoFillSuggestions(
    191184        const WebNode&,
     
    195188        const WebVector<int>& uniqueIDs,
    196189        int separatorIndex);
    197     // DEPRECATED: replacing with applyAutoFillSuggestions.
    198     virtual void applyAutocompleteSuggestions(
    199         const WebNode&,
    200         const WebVector<WebString>& suggestions,
    201         int defaultSuggestionIndex);
    202190    virtual void hidePopups();
    203191    virtual void setScrollbarColors(unsigned inactiveColor,
Note: See TracChangeset for help on using the changeset viewer.