blob: c34b11a1ca2e64b736a488e51ea54bb12110a0d2 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PasswordCredential_h
#define PasswordCredential_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/SerializedScriptValue.h"
#include "bindings/modules/v8/UnionTypesModules.h"
#include "modules/credentialmanager/Credential.h"
#include "platform/heap/Handle.h"
#include "platform/network/EncodedFormData.h"
#include "platform/weborigin/KURL.h"
namespace blink {
class FormData;
class FormDataOptions;
class PasswordCredentialData;
class WebPasswordCredential;
using CredentialPostBodyType = FormDataOrURLSearchParams;
class PasswordCredential final : public Credential {
static PasswordCredential* create(const PasswordCredentialData&, ExceptionState&);
static PasswordCredential* create(WebPasswordCredential*);
// PasswordCredential.idl
void setIdName(const String& name) { m_idName = name; }
const String& idName() const { return m_idName; }
void setPasswordName(const String& name) { m_passwordName = name; }
const String& passwordName() const { return m_passwordName; }
void setAdditionalData(const CredentialPostBodyType& data) { m_additionalData = data; }
void additionalData(CredentialPostBodyType& out) const { out = m_additionalData; }
// Internal methods
PassRefPtr<EncodedFormData> encodeFormData(String& contentType) const;
const String& password() const;
PasswordCredential(const String& id, const String& password, const String& name, const KURL& icon);
String m_idName;
String m_passwordName;
CredentialPostBodyType m_additionalData;
} // namespace blink
#endif // PasswordCredential_h