| 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/CredentialsContainer.h" | 6 #include "modules/credentialmanager/CredentialsContainer.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 class RequestCallbacks : public WebCredentialManager::RequestCallbacks { | 57 class RequestCallbacks : public WebCredentialManager::RequestCallbacks { |
| 58 WTF_MAKE_NONCOPYABLE(RequestCallbacks); | 58 WTF_MAKE_NONCOPYABLE(RequestCallbacks); |
| 59 public: | 59 public: |
| 60 explicit RequestCallbacks(PassRefPtr<ScriptPromiseResolver> resolver) : m_re
solver(resolver) { } | 60 explicit RequestCallbacks(PassRefPtr<ScriptPromiseResolver> resolver) : m_re
solver(resolver) { } |
| 61 virtual ~RequestCallbacks() { } | 61 virtual ~RequestCallbacks() { } |
| 62 | 62 |
| 63 virtual void onSuccess(WebCredential* credential) OVERRIDE | 63 virtual void onSuccess(WebCredential* credential) OVERRIDE |
| 64 { | 64 { |
| 65 // FIXME: Split this into Local/Federated types. |
| 65 m_resolver->resolve(Credential::create(credential->id(), credential->nam
e(), credential->avatarURL())); | 66 m_resolver->resolve(Credential::create(credential->id(), credential->nam
e(), credential->avatarURL())); |
| 66 } | 67 } |
| 67 | 68 |
| 68 virtual void onError(WebCredentialManagerError* reason) OVERRIDE | 69 virtual void onError(WebCredentialManagerError* reason) OVERRIDE |
| 69 { | 70 { |
| 70 rejectDueToCredentialManagerError(m_resolver, reason); | 71 rejectDueToCredentialManagerError(m_resolver, reason); |
| 71 } | 72 } |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 const RefPtr<ScriptPromiseResolver> m_resolver; | 75 const RefPtr<ScriptPromiseResolver> m_resolver; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 { | 123 { |
| 123 return stubImplementation(scriptState); | 124 return stubImplementation(scriptState); |
| 124 } | 125 } |
| 125 | 126 |
| 126 ScriptPromise CredentialsContainer::notifySignedOut(ScriptState* scriptState) | 127 ScriptPromise CredentialsContainer::notifySignedOut(ScriptState* scriptState) |
| 127 { | 128 { |
| 128 return stubImplementation(scriptState); | 129 return stubImplementation(scriptState); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace blink | 132 } // namespace blink |
| OLD | NEW |