[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jhawkins at chromium.org jhawkins at chromium.org
Wed Dec 22 11:12:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 87bdd5349c9848874084b8ce35a852654e321f15
Author: jhawkins at chromium.org <jhawkins at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 15 00:19:57 2010 +0000

    2010-07-14  James Hawkins  <jhawkins at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [Chromium] Use the unique ID instead of the profile label to identify
            the accepted AutoFill suggestion.
            https://bugs.webkit.org/show_bug.cgi?id=42301
    
            * public/WebView.h:
            * public/WebViewClient.h:
            (WebKit::WebViewClient::didAcceptAutoFillSuggestion):
            (WebKit::WebViewClient::didSelectAutoFillSuggestion):
            * src/AutoFillPopupMenuClient.cpp:
            (WebKit::AutoFillPopupMenuClient::valueChanged):
            (WebKit::AutoFillPopupMenuClient::selectionChanged):
            (WebKit::AutoFillPopupMenuClient::initialize):
            (WebKit::AutoFillPopupMenuClient::setSuggestions):
            (WebKit::AutoFillPopupMenuClient::textFieldStyle):
            * src/AutoFillPopupMenuClient.h:
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::applyAutoFillSuggestions):
            (WebKit::WebViewImpl::applyAutocompleteSuggestions):
            * src/WebViewImpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63379 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 09bbc6c..b0fd32f 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,27 @@
+2010-07-14  James Hawkins  <jhawkins at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Use the unique ID instead of the profile label to identify
+        the accepted AutoFill suggestion.
+        https://bugs.webkit.org/show_bug.cgi?id=42301
+
+        * public/WebView.h:
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::didAcceptAutoFillSuggestion):
+        (WebKit::WebViewClient::didSelectAutoFillSuggestion):
+        * src/AutoFillPopupMenuClient.cpp:
+        (WebKit::AutoFillPopupMenuClient::valueChanged):
+        (WebKit::AutoFillPopupMenuClient::selectionChanged):
+        (WebKit::AutoFillPopupMenuClient::initialize):
+        (WebKit::AutoFillPopupMenuClient::setSuggestions):
+        (WebKit::AutoFillPopupMenuClient::textFieldStyle):
+        * src/AutoFillPopupMenuClient.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::applyAutoFillSuggestions):
+        (WebKit::WebViewImpl::applyAutocompleteSuggestions):
+        * src/WebViewImpl.h:
+
 2010-07-14  Jay Civelli  <jcivelli at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index a8f5387..26d7269 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -248,11 +248,21 @@ public:
 
     // AutoFill  -----------------------------------------------------------
 
+    // DEPRECATED.
+    virtual void applyAutoFillSuggestions(
+        const WebNode&,
+        const WebVector<WebString>& names,
+        const WebVector<WebString>& labels,
+        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.
     virtual void applyAutoFillSuggestions(
         const WebNode&,
         const WebVector<WebString>& names,
         const WebVector<WebString>& labels,
+        const WebVector<int>& uniqueIDs,
         int separatorIndex) = 0;
 
     // Notifies the WebView that Autocomplete suggestions are available for a
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index f21d262..11fb233 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -307,6 +307,7 @@ public:
     virtual void didAcceptAutoFillSuggestion(const WebNode&,
                                              const WebString& name,
                                              const WebString& label,
+                                             int uniqueID,
                                              unsigned index) { }
 
     // Informs the browser that the user has selected an AutoFill suggestion for
@@ -314,10 +315,11 @@ public:
     // the arrow keys to navigate to a suggestion.
     virtual void didSelectAutoFillSuggestion(const WebNode&,
                                              const WebString& name,
-                                             const WebString& label) { }
+                                             const WebString& label,
+                                             int uniqueID) { }
 
     // Informs the browser that the user has cleared the selection from the
-    // AutoFill suggestions dropdown.  This happens when a user uses the arrow
+    // AutoFill suggestions popup.  This happens when a user uses the arrow
     // keys to navigate outside the range of possible selections.
     virtual void didClearAutoFillSelection(const WebNode&) { }
 
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 3af6f56..4e4b829 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -121,6 +121,7 @@ void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
       webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
                                                      m_names[listIndex],
                                                      m_labels[listIndex],
+                                                     m_uniqueIDs[listIndex],
                                                      listIndex);
     }
 }
@@ -138,7 +139,8 @@ void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEven
 
     webView->client()->didSelectAutoFillSuggestion(WebNode(getTextField()),
                                                    m_names[listIndex],
-                                                   m_labels[listIndex]);
+                                                   m_labels[listIndex],
+                                                   m_uniqueIDs[listIndex]);
 }
 
 void AutoFillPopupMenuClient::selectionCleared()
@@ -230,9 +232,11 @@ void AutoFillPopupMenuClient::initialize(
     HTMLInputElement* textField,
     const WebVector<WebString>& names,
     const WebVector<WebString>& labels,
+    const WebVector<int>& uniqueIDs,
     int separatorIndex)
 {
     ASSERT(names.size() == labels.size());
+    ASSERT(names.size() == uniqueIDs.size());
     ASSERT(separatorIndex < static_cast<int>(names.size()));
 
     m_selectedIndex = -1;
@@ -240,7 +244,7 @@ void AutoFillPopupMenuClient::initialize(
 
     // The suggestions must be set before initializing the
     // AutoFillPopupMenuClient.
-    setSuggestions(names, labels, separatorIndex);
+    setSuggestions(names, labels, uniqueIDs, separatorIndex);
 
     FontDescription fontDescription;
     RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl,
@@ -259,16 +263,20 @@ void AutoFillPopupMenuClient::initialize(
 
 void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names,
                                              const WebVector<WebString>& labels,
+                                             const WebVector<int>& uniqueIDs,
                                              int separatorIndex)
 {
     ASSERT(names.size() == labels.size());
+    ASSERT(names.size() == uniqueIDs.size());
     ASSERT(separatorIndex < static_cast<int>(names.size()));
 
     m_names.clear();
     m_labels.clear();
+    m_uniqueIDs.clear();
     for (size_t i = 0; i < names.size(); ++i) {
         m_names.append(names[i]);
         m_labels.append(labels[i]);
+        m_uniqueIDs.append(uniqueIDs[i]);
     }
 
     m_separatorIndex = separatorIndex;
@@ -306,7 +314,7 @@ RenderStyle* AutoFillPopupMenuClient::textFieldStyle() const
     RenderStyle* style = m_textField->computedStyle();
     if (!style) {
         // It seems we can only have a 0 style in a TextField if the
-        // node is detached, in which case we the popup shoud not be
+        // node is detached, in which case we the popup should not be
         // showing.  Please report this in http://crbug.com/7708 and
         // include the page you were visiting.
         ASSERT_NOT_REACHED();
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h
index 461bc64..2be7dc4 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.h
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h
@@ -97,10 +97,12 @@ public:
     void initialize(WebCore::HTMLInputElement*,
                     const WebVector<WebString>& names,
                     const WebVector<WebString>& labels,
+                    const WebVector<int>& uniqueIDs,
                     int separatorIndex);
 
     void setSuggestions(const WebVector<WebString>& names,
                         const WebVector<WebString>& labels,
+                        const WebVector<int>& uniqueIDs,
                         int separatorIndex);
 
     // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is
@@ -122,6 +124,7 @@ private:
     // The names and labels that make up the text of the menu items.
     Vector<WebCore::String> m_names;
     Vector<WebCore::String> m_labels;
+    Vector<int> m_uniqueIDs;
 
     // The index of the separator.  -1 if there is no separator.
     int m_separatorIndex;
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index f3fec75..5a1cfc2 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -1723,7 +1723,19 @@ void WebViewImpl::applyAutoFillSuggestions(
     const WebVector<WebString>& labels,
     int separatorIndex)
 {
+    WebVector<int> uniqueIDs(names.size());
+    applyAutoFillSuggestions(node, names, labels, uniqueIDs, separatorIndex);
+}
+
+void WebViewImpl::applyAutoFillSuggestions(
+    const WebNode& node,
+    const WebVector<WebString>& names,
+    const WebVector<WebString>& labels,
+    const WebVector<int>& uniqueIDs,
+    int separatorIndex)
+{
     ASSERT(names.size() == labels.size());
+    ASSERT(names.size() == unique_ids.size());
     ASSERT(separatorIndex < static_cast<int>(names.size()));
 
     if (names.isEmpty()) {
@@ -1748,7 +1760,8 @@ void WebViewImpl::applyAutoFillSuggestions(
     if (!m_autoFillPopupClient.get())
         m_autoFillPopupClient.set(new AutoFillPopupMenuClient);
 
-    m_autoFillPopupClient->initialize(inputElem, names, labels, separatorIndex);
+    m_autoFillPopupClient->initialize(
+        inputElem, names, labels, uniqueIDs, separatorIndex);
 
     if (!m_autoFillPopup.get()) {
         m_autoFillPopup = PopupContainer::create(m_autoFillPopupClient.get(),
@@ -1757,7 +1770,8 @@ void WebViewImpl::applyAutoFillSuggestions(
     }
 
     if (m_autoFillPopupShowing) {
-        m_autoFillPopupClient->setSuggestions(names, labels, separatorIndex);
+        m_autoFillPopupClient->setSuggestions(
+            names, labels, uniqueIDs, separatorIndex);
         refreshAutoFillPopup();
     } else {
         m_autoFillPopup->show(focusedNode->getRect(),
@@ -1779,13 +1793,12 @@ void WebViewImpl::applyAutocompleteSuggestions(
 {
     WebVector<WebString> names(suggestions.size());
     WebVector<WebString> labels(suggestions.size());
+    WebVector<int> uniqueIDs(suggestions.size());
 
-    for (size_t i = 0; i < suggestions.size(); ++i) {
+    for (size_t i = 0; i < suggestions.size(); ++i)
         names[i] = suggestions[i];
-        labels[i] = WebString();
-    }
 
-    applyAutoFillSuggestions(node, names, labels, -1);
+    applyAutoFillSuggestions(node, names, labels, uniqueIDs, -1);
     if (m_autoFillPopupClient)
         m_autoFillPopupClient->setAutocompleteMode(true);
 }
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index db2a1d2..c07ceec 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -164,11 +164,18 @@ public:
                                      const WebString& value);
     virtual WebDevToolsAgent* devToolsAgent();
     virtual WebAccessibilityObject accessibilityObject();
+    // DEPRECATED.
     virtual void applyAutoFillSuggestions(
         const WebNode&,
         const WebVector<WebString>& names,
         const WebVector<WebString>& labels,
         int separatorIndex);
+    virtual void applyAutoFillSuggestions(
+        const WebNode&,
+        const WebVector<WebString>& names,
+        const WebVector<WebString>& labels,
+        const WebVector<int>& uniqueIDs,
+        int separatorIndex);
     // DEPRECATED: replacing with applyAutoFillSuggestions.
     virtual void applyAutocompleteSuggestions(
         const WebNode&,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list