Commit 77fc94cc authored by estade@chromium.org's avatar estade@chromium.org

revert r171206: "Add transaction detail params to requestAutocomplete()."

Since rAc was adopted into the standard, we revisited this and decided
to do it a different way. This "revert" does keep the minor change
about removing the extra param to
WebAutofillClient::didRequestAutocomplete.

BUG=354897

Review URL: https://codereview.chromium.org/293853002

git-svn-id: svn://svn.chromium.org/blink/trunk@175608 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 75afee65
......@@ -27,7 +27,6 @@
#include <limits>
#include "HTMLNames.h"
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/ScriptEventListener.h"
#include "core/dom/Attribute.h"
......@@ -438,7 +437,7 @@ void HTMLFormElement::reset()
m_isInResetFunction = false;
}
void HTMLFormElement::requestAutocomplete(const Dictionary& details)
void HTMLFormElement::requestAutocomplete()
{
String errorMessage;
......@@ -453,7 +452,7 @@ void HTMLFormElement::requestAutocomplete(const Dictionary& details)
document().addConsoleMessage(RenderingMessageSource, LogMessageLevel, errorMessage);
finishRequestAutocomplete(AutocompleteResultErrorDisabled);
} else {
document().frame()->loader().client()->didRequestAutocomplete(this, details);
document().frame()->loader().client()->didRequestAutocomplete(this);
}
}
......
......@@ -105,7 +105,7 @@ public:
AutocompleteResultErrorInvalid,
};
void requestAutocomplete(const Dictionary&);
void requestAutocomplete();
void finishRequestAutocomplete(AutocompleteResult);
DEFINE_ATTRIBUTE_EVENT_LISTENER(autocomplete);
......
......@@ -40,5 +40,5 @@
[CustomElementCallbacks] void reset();
boolean checkValidity();
[RuntimeEnabled=RequestAutocomplete] void requestAutocomplete([Default=Undefined] optional Dictionary details);
[RuntimeEnabled=RequestAutocomplete] void requestAutocomplete();
};
......@@ -141,7 +141,7 @@ void EmptyTextCheckerClient::requestCheckingOfString(PassRefPtr<TextCheckingRequ
{
}
void EmptyFrameLoaderClient::didRequestAutocomplete(HTMLFormElement*, const Dictionary&)
void EmptyFrameLoaderClient::didRequestAutocomplete(HTMLFormElement*)
{
}
......
......@@ -243,7 +243,7 @@ public:
virtual blink::WebCookieJar* cookieJar() const OVERRIDE { return 0; }
virtual void didRequestAutocomplete(HTMLFormElement*, const Dictionary&) OVERRIDE;
virtual void didRequestAutocomplete(HTMLFormElement*) OVERRIDE;
virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() OVERRIDE;
virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) OVERRIDE;
......
......@@ -53,7 +53,6 @@ class WebApplicationCacheHostClient;
namespace WebCore {
class Color;
class Dictionary;
class DOMWindowExtension;
class DOMWrapperWorld;
class DocumentLoader;
......@@ -205,7 +204,7 @@ namespace WebCore {
virtual void dispatchWillStartUsingPeerConnectionHandler(blink::WebRTCPeerConnectionHandler*) { }
virtual void didRequestAutocomplete(HTMLFormElement*, const Dictionary&) = 0;
virtual void didRequestAutocomplete(HTMLFormElement*) = 0;
virtual bool allowWebGL(bool enabledPerSettings) { return enabledPerSettings; }
// Informs the embedder that a WebGL canvas inside this frame received a lost context
......
......@@ -34,7 +34,6 @@
#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ScriptController.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentFullscreen.h"
......@@ -74,7 +73,6 @@
#include "public/platform/WebURL.h"
#include "public/platform/WebURLError.h"
#include "public/platform/WebVector.h"
#include "public/web/WebAutocompleteParams.h"
#include "public/web/WebAutofillClient.h"
#include "public/web/WebCachedURLRequest.h"
#include "public/web/WebDOMEvent.h"
......@@ -749,10 +747,10 @@ void FrameLoaderClientImpl::dispatchWillStartUsingPeerConnectionHandler(blink::W
m_webFrame->client()->willStartUsingPeerConnectionHandler(webFrame(), handler);
}
void FrameLoaderClientImpl::didRequestAutocomplete(HTMLFormElement* form, const WebCore::Dictionary& details)
void FrameLoaderClientImpl::didRequestAutocomplete(HTMLFormElement* form)
{
if (m_webFrame->viewImpl() && m_webFrame->viewImpl()->autofillClient())
m_webFrame->viewImpl()->autofillClient()->didRequestAutocomplete(WebFormElement(form), WebAutocompleteParams(details));
m_webFrame->viewImpl()->autofillClient()->didRequestAutocomplete(WebFormElement(form));
}
bool FrameLoaderClientImpl::allowWebGL(bool enabledPerSettings)
......
......@@ -146,7 +146,7 @@ public:
virtual void dispatchWillStartUsingPeerConnectionHandler(blink::WebRTCPeerConnectionHandler*) OVERRIDE;
virtual void didRequestAutocomplete(WebCore::HTMLFormElement*, const WebCore::Dictionary&) OVERRIDE;
virtual void didRequestAutocomplete(WebCore::HTMLFormElement*) OVERRIDE;
virtual bool allowWebGL(bool enabledPerSettings) OVERRIDE;
virtual void didLoseWebGLContext(int arbRobustnessContextLostReason) OVERRIDE;
......
/*
* Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "public/web/WebAutocompleteParams.h"
#include "bindings/v8/Dictionary.h"
#include "public/platform/WebString.h"
#include "wtf/text/WTFString.h"
namespace blink {
WebAutocompleteParams::WebAutocompleteParams(const WebCore::Dictionary& details)
: transactionAmount(0)
{
details.get("transactionAmount", transactionAmount);
String currency;
if (details.get("transactionCurrency", currency))
transactionCurrency = WebString(currency);
}
} // namespace blink
......@@ -106,7 +106,6 @@
'WebAXObject.cpp',
'WebArrayBufferConverter.cpp',
'WebArrayBufferView.cpp',
'WebAutocompleteParams.cpp',
'WebBindings.cpp',
'WebBlob.cpp',
'WebCache.cpp',
......
/*
* Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebAutocompleteParams_h
#define WebAutocompleteParams_h
#include "public/platform/WebString.h"
#if BLINK_IMPLEMENTATION
namespace WebCore {
class Dictionary;
}
#endif
namespace blink {
struct WebAutocompleteParams {
double transactionAmount;
WebString transactionCurrency;
WebAutocompleteParams()
: transactionAmount(0) { }
#if BLINK_IMPLEMENTATION
WebAutocompleteParams(const WebCore::Dictionary&);
#endif
};
} // namespace blink
#endif // WebAutocompleteParams_h
......@@ -38,14 +38,13 @@ class WebFormElement;
class WebInputElement;
class WebKeyboardEvent;
class WebNode;
struct WebAutocompleteParams;
template <typename T> class WebVector;
class WebAutofillClient {
public:
// Informs the browser an interactive autocomplete has been requested.
virtual void didRequestAutocomplete(const WebFormElement&, const WebAutocompleteParams&) { }
virtual void didRequestAutocomplete(const WebFormElement&) { }
// These methods are called when the users edits a text-field.
virtual void textFieldDidEndEditing(const WebInputElement&) { }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment