OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/credentialmanager/PasswordCredential.h" | 6 #include "modules/credentialmanager/PasswordCredential.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 PasswordCredential::PasswordCredential(const String& id, const String& password,
const String& name, const KURL& icon) | 39 PasswordCredential::PasswordCredential(const String& id, const String& password,
const String& name, const KURL& icon) |
40 : Credential(PlatformPasswordCredential::create(id, password, name, icon)) | 40 : Credential(PlatformPasswordCredential::create(id, password, name, icon)) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 FormData* PasswordCredential::toFormData(ScriptState* scriptState, const FormDat
aOptions& options) | 44 FormData* PasswordCredential::toFormData(ScriptState* scriptState, const FormDat
aOptions& options) |
45 { | 45 { |
46 FormData* fd = FormData::create(); | 46 FormData* fd = FormData::create(); |
47 | 47 |
48 String errorMessage; | 48 String errorMessage; |
49 if (!scriptState->executionContext()->isPrivilegedContext(errorMessage)) | 49 if (!scriptState->executionContext()->isSecureContext(errorMessage)) |
50 return fd; | 50 return fd; |
51 | 51 |
52 fd->append(options.idName(), id()); | 52 fd->append(options.idName(), id()); |
53 fd->append(options.passwordName(), password()); | 53 fd->append(options.passwordName(), password()); |
54 fd->makeOpaque(); | 54 fd->makeOpaque(); |
55 return fd; | 55 return fd; |
56 } | 56 } |
57 | 57 |
58 const String& PasswordCredential::password() const | 58 const String& PasswordCredential::password() const |
59 { | 59 { |
60 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())-
>password(); | 60 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())-
>password(); |
61 } | 61 } |
62 | 62 |
63 DEFINE_TRACE(PasswordCredential) | 63 DEFINE_TRACE(PasswordCredential) |
64 { | 64 { |
65 Credential::trace(visitor); | 65 Credential::trace(visitor); |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
OLD | NEW |