[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
jam at chromium.org
jam at chromium.org
Fri Jan 21 15:18:53 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 9a5ace37653f89bd125f30d357827d6e26cc1772
Author: jam at chromium.org <jam at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 11 00:27:16 2011 +0000
2011-01-10 John Abd-El-Malek <jam at chromium.org>
Reviewed by James Robinson.
[chromium] Call WebAutoFillClient instead of WebViewClient for autofill related callbacks
https://bugs.webkit.org/show_bug.cgi?id=52169
* public/WebView.h:
* public/WebViewClient.h:
(WebKit::WebViewClient::didUpdateInspectorSetting):
* src/AutoFillPopupMenuClient.cpp:
(WebKit::AutoFillPopupMenuClient::valueChanged):
(WebKit::AutoFillPopupMenuClient::selectionChanged):
(WebKit::AutoFillPopupMenuClient::selectionCleared):
(WebKit::AutoFillPopupMenuClient::popupDidHide):
* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::textFieldDidBeginEditing):
(WebKit::EditorClientImpl::textFieldDidEndEditing):
(WebKit::EditorClientImpl::textDidChangeInTextField):
(WebKit::EditorClientImpl::doAutofill):
(WebKit::EditorClientImpl::onAutocompleteSuggestionAccepted):
(WebKit::EditorClientImpl::doTextFieldCommandFromEvent):
* src/WebViewImpl.cpp:
(WebKit::WebView::create):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::autocompleteHandleKeyEvent):
* src/WebViewImpl.h:
(WebKit::WebViewImpl::autoFillClient):
* src/WebWorkerBase.cpp:
(WebKit::WebWorkerBase::initializeLoader):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp
index 14fcdc7..ec6a502 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp
@@ -571,7 +571,7 @@ WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url)
WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url, DRTDevToolsAgent* devToolsAgent)
{
WebViewHost* host = new WebViewHost(this);
- WebView* view = WebView::create(host, devToolsAgent);
+ WebView* view = WebView::create(host, devToolsAgent, 0);
host->setWebWidget(view);
m_prefs.applyTo(view);
view->initializeMainFrame(host);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index a85bc15..49501c5 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,34 @@
+2011-01-10 John Abd-El-Malek <jam at chromium.org>
+
+ Reviewed by James Robinson.
+
+ [chromium] Call WebAutoFillClient instead of WebViewClient for autofill related callbacks
+ https://bugs.webkit.org/show_bug.cgi?id=52169
+
+ * public/WebView.h:
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::didUpdateInspectorSetting):
+ * src/AutoFillPopupMenuClient.cpp:
+ (WebKit::AutoFillPopupMenuClient::valueChanged):
+ (WebKit::AutoFillPopupMenuClient::selectionChanged):
+ (WebKit::AutoFillPopupMenuClient::selectionCleared):
+ (WebKit::AutoFillPopupMenuClient::popupDidHide):
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::textFieldDidBeginEditing):
+ (WebKit::EditorClientImpl::textFieldDidEndEditing):
+ (WebKit::EditorClientImpl::textDidChangeInTextField):
+ (WebKit::EditorClientImpl::doAutofill):
+ (WebKit::EditorClientImpl::onAutocompleteSuggestionAccepted):
+ (WebKit::EditorClientImpl::doTextFieldCommandFromEvent):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::create):
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::autocompleteHandleKeyEvent):
+ * src/WebViewImpl.h:
+ (WebKit::WebViewImpl::autoFillClient):
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::initializeLoader):
+
2011-01-10 John Knottenbelt <jknotten at chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index b6cbd68..58aeb5c 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '70844'
+ 'chromium_rev': '70952'
}
deps = {
@@ -107,6 +107,8 @@ deps = {
Var('chromium_svn')+'/tools/grit@'+Var('chromium_rev'),
'tools/generate_stubs':
Var('chromium_svn')+'/tools/generate_stubs@'+Var('chromium_rev'),
+ 'ui':
+ Var('chromium_svn')+'/ui@'+Var('chromium_rev'), # needed by app
# other third party
'third_party/icu':
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index a18a64e..4243998 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -36,9 +36,13 @@
#include "WebVector.h"
#include "WebWidget.h"
+// FIXME(jam): take out once Chromium rolls past this revision
+#define WEBKIT_HAS_WEB_AUTO_FILL_CLIENT
+
namespace WebKit {
class WebAccessibilityObject;
+class WebAutoFillClient;
class WebDevToolsAgent;
class WebDevToolsAgentClient;
class WebDragData;
@@ -81,8 +85,10 @@ public:
// Creates a WebView that is NOT yet initialized. You will need to
// call initializeMainFrame to finish the initialization. It is valid
- // to pass null WebViewClient and WebDevToolsAgentClient pointers.
- WEBKIT_API static WebView* create(WebViewClient*, WebDevToolsAgentClient*);
+ // to pass null client pointers.
+ WEBKIT_API static WebView* create(WebViewClient*,
+ WebDevToolsAgentClient*,
+ WebAutoFillClient*);
// After creating a WebView, you should immediately call this method.
// You can optionally modify the settings before calling this method.
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index da7a1b3..a3ad9b4 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -166,12 +166,6 @@ public:
virtual void didExecuteCommand(const WebString& commandName) { }
virtual void didEndEditing() { }
- // These methods are called when the users edits a text-field.
- virtual void textFieldDidBeginEditing(const WebInputElement&) { }
- virtual void textFieldDidEndEditing(const WebInputElement&) { }
- virtual void textFieldDidChange(const WebInputElement&) { }
- virtual void textFieldDidReceiveKeyDown(const WebInputElement&, const WebKeyboardEvent&) { }
-
// This method is called in response to WebView's handleInputEvent()
// when the default action for the current keyboard event is not
// suppressed by the page, to give the embedder a chance to handle
@@ -311,52 +305,6 @@ public:
virtual void didUpdateInspectorSetting(const WebString& key, const WebString& value) { }
-
- // AutoFill ------------------------------------------------------------
-
- // Queries the browser for suggestions to be shown for the form text
- // field named |name|. |value| is the text entered by the user so
- // far and the WebNode corresponds to the input field.
- virtual void queryAutofillSuggestions(const WebNode&,
- const WebString& name,
- const WebString& value) { }
-
- // Instructs the browser to remove the Autocomplete entry specified from
- // its DB.
- // FIXME: This method should be named removeAutocompleteSugestion.
- virtual void removeAutofillSuggestions(const WebString& name,
- const WebString& value) { }
-
- // Informs the browser that the user has accepted an AutoFill suggestion for
- // a WebNode. |uniqueID| is used as a key into the set of AutoFill profiles,
- // and should never be negative. If it is 0, then the suggestion is an
- // Autocomplete suggestion; and |value| stores the suggested text. |index|
- // is an index of the selected suggestion in the list of suggestions provided
- // by the client.
- virtual void didAcceptAutoFillSuggestion(const WebNode&,
- const WebString& value,
- const WebString& label,
- int uniqueID,
- unsigned index) { }
-
- // Informs the browser that the user has selected an AutoFill suggestion for
- // a WebNode. This happens when the user hovers over a suggestion or uses
- // the arrow keys to navigate to a suggestion.
- virtual void didSelectAutoFillSuggestion(const WebNode&,
- const WebString& name,
- const WebString& label,
- int uniqueID) { }
-
- // Informs the browser that the user has cleared the selection from the
- // 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&) { }
-
- // Informs the browser that the user has selected an autocomplete (password
- // or field) suggestion from the drop-down. The input element text has
- // already been set to the selected suggestion.
- virtual void didAcceptAutocompleteSuggestion(const WebInputElement&) { }
-
// Geolocation ---------------------------------------------------------
// Access the embedder API for (client-based) geolocation client .
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 704ba69..4f57994 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -37,6 +37,7 @@
#include "FrameView.h"
#include "HTMLInputElement.h"
#include "RenderTheme.h"
+#include "WebAutoFillClient.h"
#include "WebNode.h"
#include "WebString.h"
#include "WebVector.h"
@@ -131,11 +132,11 @@ void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
ASSERT(listIndex < m_names.size());
- webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
- m_names[listIndex],
- m_labels[listIndex],
- m_uniqueIDs[listIndex],
- listIndex);
+ webView->autoFillClient()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
+ m_names[listIndex],
+ m_labels[listIndex],
+ m_uniqueIDs[listIndex],
+ listIndex);
}
void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)
@@ -149,17 +150,17 @@ void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEven
ASSERT(listIndex < m_names.size());
- webView->client()->didSelectAutoFillSuggestion(WebNode(getTextField()),
- m_names[listIndex],
- m_labels[listIndex],
- m_uniqueIDs[listIndex]);
+ webView->autoFillClient()->didSelectAutoFillSuggestion(WebNode(getTextField()),
+ m_names[listIndex],
+ m_labels[listIndex],
+ m_uniqueIDs[listIndex]);
}
void AutoFillPopupMenuClient::selectionCleared()
{
WebViewImpl* webView = getWebView();
if (webView)
- webView->client()->didClearAutoFillSelection(WebNode(getTextField()));
+ webView->autoFillClient()->didClearAutoFillSelection(WebNode(getTextField()));
}
String AutoFillPopupMenuClient::itemText(unsigned listIndex) const
@@ -219,7 +220,7 @@ void AutoFillPopupMenuClient::popupDidHide()
return;
webView->autoFillPopupDidHide();
- webView->client()->didClearAutoFillSelection(WebNode(getTextField()));
+ webView->autoFillClient()->didClearAutoFillSelection(WebNode(getTextField()));
}
bool AutoFillPopupMenuClient::itemIsSeparator(unsigned listIndex) const
diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp
index 6f1739f..19b5873 100644
--- a/WebKit/chromium/src/EditorClientImpl.cpp
+++ b/WebKit/chromium/src/EditorClientImpl.cpp
@@ -42,6 +42,7 @@
#include "RenderObject.h"
#include "DOMUtilitiesPrivate.h"
+#include "WebAutoFillClient.h"
#include "WebEditingAction.h"
#include "WebElement.h"
#include "WebFrameImpl.h"
@@ -649,15 +650,15 @@ void EditorClientImpl::handleInputMethodKeydown(KeyboardEvent* keyEvent)
void EditorClientImpl::textFieldDidBeginEditing(Element* element)
{
HTMLInputElement* inputElement = toHTMLInputElement(element);
- if (m_webView->client() && inputElement)
- m_webView->client()->textFieldDidBeginEditing(WebInputElement(inputElement));
+ if (m_webView->autoFillClient() && inputElement)
+ m_webView->autoFillClient()->textFieldDidBeginEditing(WebInputElement(inputElement));
}
void EditorClientImpl::textFieldDidEndEditing(Element* element)
{
HTMLInputElement* inputElement = toHTMLInputElement(element);
- if (m_webView->client() && inputElement)
- m_webView->client()->textFieldDidEndEditing(WebInputElement(inputElement));
+ if (m_webView->autoFillClient() && inputElement)
+ m_webView->autoFillClient()->textFieldDidEndEditing(WebInputElement(inputElement));
// Notification that focus was lost. Be careful with this, it's also sent
// when the page is being closed.
@@ -691,8 +692,8 @@ void EditorClientImpl::textDidChangeInTextField(Element* element)
{
ASSERT(element->hasLocalName(HTMLNames::inputTag));
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);
- if (m_webView->client())
- m_webView->client()->textFieldDidChange(WebInputElement(inputElement));
+ if (m_webView->autoFillClient())
+ m_webView->autoFillClient()->textFieldDidChange(WebInputElement(inputElement));
// Note that we only show the autofill popup in this case if the caret is at
// the end. This matches FireFox and Safari but not IE.
@@ -785,14 +786,6 @@ void EditorClientImpl::doAutofill(Timer<EditorClientImpl>* timer)
true);
return;
}
-
- // Then trigger form autofill.
- WebString name = WebInputElement(inputElement).nameForAutofill();
- ASSERT(static_cast<int>(name.length()) > 0);
-
- if (m_webView->client())
- m_webView->client()->queryAutofillSuggestions(WebNode(inputElement),
- name, WebString(value));
}
void EditorClientImpl::cancelPendingAutofill()
@@ -803,8 +796,8 @@ void EditorClientImpl::cancelPendingAutofill()
void EditorClientImpl::onAutocompleteSuggestionAccepted(HTMLInputElement* textField)
{
- if (m_webView->client())
- m_webView->client()->didAcceptAutocompleteSuggestion(WebInputElement(textField));
+ if (m_webView->autoFillClient())
+ m_webView->autoFillClient()->didAcceptAutocompleteSuggestion(WebInputElement(textField));
WebFrameImpl* webframe = WebFrameImpl::fromFrame(textField->document()->frame());
if (!webframe)
@@ -817,9 +810,9 @@ bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element,
KeyboardEvent* event)
{
HTMLInputElement* inputElement = toHTMLInputElement(element);
- if (m_webView->client() && inputElement) {
- m_webView->client()->textFieldDidReceiveKeyDown(WebInputElement(inputElement),
- WebKeyboardEventBuilder(*event));
+ if (m_webView->autoFillClient() && inputElement) {
+ m_webView->autoFillClient()->textFieldDidReceiveKeyDown(WebInputElement(inputElement),
+ WebKeyboardEventBuilder(*event));
}
// Remember if backspace was pressed for the autofill. It is not clear how to
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 7056a0a..44efeea 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -97,6 +97,7 @@
#include "UserGestureIndicator.h"
#include "Vector.h"
#include "WebAccessibilityObject.h"
+#include "WebAutoFillClient.h"
#include "WebDevToolsAgentPrivate.h"
#include "WebDevToolsAgentImpl.h"
#include "WebDragData.h"
@@ -212,13 +213,13 @@ static bool shouldUseExternalPopupMenus = false;
// WebView ----------------------------------------------------------------
-WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
+WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient)
{
// Keep runtime flag for device motion turned off until it's implemented.
WebRuntimeFeatures::enableDeviceMotion(false);
// Pass the WebViewImpl's self-reference to the caller.
- return adoptRef(new WebViewImpl(client, devToolsClient)).leakRef();
+ return adoptRef(new WebViewImpl(client, devToolsClient, autoFillClient)).leakRef();
}
void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus)
@@ -270,8 +271,9 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient)
SecurityOrigin::setLocalLoadPolicy(SecurityOrigin::AllowLocalLoadsForLocalOnly);
}
-WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
+WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient)
: m_client(client)
+ , m_autoFillClient(autoFillClient)
, m_backForwardListClientImpl(this)
, m_chromeClientImpl(this)
, m_contextMenuClientImpl(this)
@@ -664,7 +666,7 @@ bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event)
WebString name = WebInputElement(static_cast<HTMLInputElement*>(element)).nameForAutofill();
WebString value = m_autoFillPopupClient->itemText(selectedIndex);
- m_client->removeAutofillSuggestions(name, value);
+ m_autoFillClient->removeAutocompleteSuggestion(name, value);
// Update the entries in the currently showing popup to reflect the
// deletion.
m_autoFillPopupClient->removeSuggestionAtIndex(selectedIndex);
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 0857d11..c9ecc16 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -220,6 +220,11 @@ public:
return m_client;
}
+ WebAutoFillClient* autoFillClient()
+ {
+ return m_autoFillClient;
+ }
+
// Returns the page object associated with this view. This may be null when
// the page is shutting down, but will be valid at all other times.
WebCore::Page* page() const
@@ -362,7 +367,7 @@ private:
DragOver
};
- WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient);
+ WebViewImpl(WebViewClient*, WebDevToolsAgentClient*, WebAutoFillClient*);
~WebViewImpl();
// Returns true if the event was actually processed.
@@ -403,6 +408,7 @@ private:
#endif
WebViewClient* m_client;
+ WebAutoFillClient* m_autoFillClient;
BackForwardListClientImpl m_backForwardListClientImpl;
ChromeClientImpl m_chromeClientImpl;
diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp
index de4858c..06eb7b1 100644
--- a/WebKit/chromium/src/WebWorkerBase.cpp
+++ b/WebKit/chromium/src/WebWorkerBase.cpp
@@ -170,7 +170,7 @@ void WebWorkerBase::initializeLoader(const WebURL& url)
// loading requests from the worker context to the rest of WebKit and Chromium
// infrastructure.
ASSERT(!m_webView);
- m_webView = WebView::create(0, 0);
+ m_webView = WebView::create(0, 0, 0);
m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled());
m_webView->initializeMainFrame(this);
diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp
index 4b6b123..dab5ff9 100644
--- a/WebKit/chromium/tests/PopupMenuTest.cpp
+++ b/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -181,7 +181,7 @@ public:
protected:
virtual void SetUp()
{
- m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient, 0));
+ m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient, 0, 0));
m_webView->initializeMainFrame(&m_webFrameClient);
m_popupMenu = adoptRef(new PopupMenuChromium(&m_popupMenuClient));
}
diff --git a/WebKit/chromium/tests/WebFrameTest.cpp b/WebKit/chromium/tests/WebFrameTest.cpp
index cf91cb4..540fa1b 100644
--- a/WebKit/chromium/tests/WebFrameTest.cpp
+++ b/WebKit/chromium/tests/WebFrameTest.cpp
@@ -85,7 +85,7 @@ TEST_F(WebFrameTest, ContentText)
// Create and initialize the WebView.
TestWebFrameClient webFrameClient;
- WebView* webView = WebView::create(0, 0);
+ WebView* webView = WebView::create(0, 0, 0);
webView->initializeMainFrame(&webFrameClient);
// Load the main frame URL.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list