| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 { | 140 { |
| 141 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 141 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
| 142 ScriptPromise promise = resolver->promise(); | 142 ScriptPromise promise = resolver->promise(); |
| 143 if (!checkBoilerplate(resolver)) | 143 if (!checkBoilerplate(resolver)) |
| 144 return promise; | 144 return promise; |
| 145 | 145 |
| 146 CredentialManagerClient::from(scriptState->executionContext())->dispatchSign
edIn(WebCredential::create(credential->platformCredential()), new NotificationCa
llbacks(resolver)); | 146 CredentialManagerClient::from(scriptState->executionContext())->dispatchSign
edIn(WebCredential::create(credential->platformCredential()), new NotificationCa
llbacks(resolver)); |
| 147 return promise; | 147 return promise; |
| 148 } | 148 } |
| 149 | 149 |
| 150 ScriptPromise CredentialsContainer::notifyFailedSignIn(ScriptState* scriptState,
Credential* credential) | |
| 151 { | |
| 152 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | |
| 153 ScriptPromise promise = resolver->promise(); | |
| 154 if (!checkBoilerplate(resolver)) | |
| 155 return promise; | |
| 156 | |
| 157 CredentialManagerClient::from(scriptState->executionContext())->dispatchFail
edSignIn(WebCredential::create(credential->platformCredential()), new Notificati
onCallbacks(resolver)); | |
| 158 return promise; | |
| 159 } | |
| 160 | |
| 161 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat
e) | 150 ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat
e) |
| 162 { | 151 { |
| 163 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 152 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
| 164 ScriptPromise promise = resolver->promise(); | 153 ScriptPromise promise = resolver->promise(); |
| 165 if (!checkBoilerplate(resolver)) | 154 if (!checkBoilerplate(resolver)) |
| 166 return promise; | 155 return promise; |
| 167 | 156 |
| 168 CredentialManagerClient::from(scriptState->executionContext())->dispatchRequ
ireUserMediation(new NotificationCallbacks(resolver)); | 157 CredentialManagerClient::from(scriptState->executionContext())->dispatchRequ
ireUserMediation(new NotificationCallbacks(resolver)); |
| 169 return promise; | 158 return promise; |
| 170 } | 159 } |
| 171 | 160 |
| 172 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |