summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp')
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
index ef9d598..1aecef1 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
@@ -44,6 +44,7 @@
#include "WebUrlLoaderClient.h"
#include "WebViewCore.h"
+#define NO_PROFILE_SET 0
#define FORM_NOT_AUTOFILLABLE -1
namespace android
@@ -56,6 +57,7 @@ static URLRequestContext* webAutoFillContextGetter()
WebAutoFill::WebAutoFill()
: mWebViewCore(0)
+ , mUniqueProfileId(NO_PROFILE_SET)
{
mFormManager = new FormManager();
mQueryId = 1;
@@ -172,6 +174,7 @@ void WebAutoFill::setProfile(int id, const string16& fullName, const string16& e
const string16& state, const string16& zipCode, const string16& country, const string16& phoneNumber)
{
AutoFillProfile autoFillProfile;
+ mUniqueProfileId = id;
autoFillProfile.set_unique_id(id);
// Constants for AutoFill field types are found in external/chromium/chrome/browser/autofill/field_types.h.
@@ -191,6 +194,17 @@ void WebAutoFill::setProfile(int id, const string16& fullName, const string16& e
mTabContents->profile()->GetPersonalDataManager()->SetProfiles(&profiles);
}
+void WebAutoFill::clearProfiles()
+{
+ // For now Chromium only ever knows about one profile, so we can just
+ // remove it by unique id. If we support multiple profiles in the future
+ // we need to remove them all here.
+ if (mUniqueProfileId != NO_PROFILE_SET) {
+ mTabContents->profile()->GetPersonalDataManager()->RemoveProfile(mUniqueProfileId);
+ mUniqueProfileId = NO_PROFILE_SET;
+ }
+}
+
}
#endif