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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
79 CredentialsContainer* CredentialsContainer::create() | 79 CredentialsContainer* CredentialsContainer::create() |
80 { | 80 { |
81 return new CredentialsContainer(); | 81 return new CredentialsContainer(); |
82 } | 82 } |
83 | 83 |
84 CredentialsContainer::CredentialsContainer() | 84 CredentialsContainer::CredentialsContainer() |
85 { | 85 { |
86 ScriptWrappable::init(this); | |
87 } | 86 } |
88 | 87 |
89 static bool canAccessCredentialManagerAPI(ScriptState* scriptState, PassRefPtr<S
criptPromiseResolver> resolver) | 88 static bool canAccessCredentialManagerAPI(ScriptState* scriptState, PassRefPtr<S
criptPromiseResolver> resolver) |
90 { | 89 { |
91 SecurityOrigin* securityOrigin = scriptState->executionContext()->securityOr
igin(); | 90 SecurityOrigin* securityOrigin = scriptState->executionContext()->securityOr
igin(); |
92 String errorMessage; | 91 String errorMessage; |
93 if (!securityOrigin->canAccessFeatureRequiringSecureOrigin(errorMessage)) { | 92 if (!securityOrigin->canAccessFeatureRequiringSecureOrigin(errorMessage)) { |
94 resolver->reject(DOMException::create(SecurityError, errorMessage)); | 93 resolver->reject(DOMException::create(SecurityError, errorMessage)); |
95 return false; | 94 return false; |
96 } | 95 } |
(...skipping 26 matching lines...) Expand all Loading... |
123 { | 122 { |
124 return stubImplementation(scriptState); | 123 return stubImplementation(scriptState); |
125 } | 124 } |
126 | 125 |
127 ScriptPromise CredentialsContainer::notifySignedOut(ScriptState* scriptState) | 126 ScriptPromise CredentialsContainer::notifySignedOut(ScriptState* scriptState) |
128 { | 127 { |
129 return stubImplementation(scriptState); | 128 return stubImplementation(scriptState); |
130 } | 129 } |
131 | 130 |
132 } // namespace blink | 131 } // namespace blink |
OLD | NEW |