Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.cpp

Issue 1723583004: CREDENTIAL: Convert federations from URLs to origins throughout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS2 Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "modules/credentialmanager/FederatedCredential.h" 5 #include "modules/credentialmanager/FederatedCredential.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "modules/credentialmanager/FederatedCredentialData.h" 8 #include "modules/credentialmanager/FederatedCredentialData.h"
9 #include "platform/credentialmanager/PlatformFederatedCredential.h" 9 #include "platform/credentialmanager/PlatformFederatedCredential.h"
10 #include "platform/weborigin/SecurityOrigin.h"
10 #include "public/platform/WebFederatedCredential.h" 11 #include "public/platform/WebFederatedCredential.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 FederatedCredential* FederatedCredential::create(WebFederatedCredential* webFede ratedCredential) 15 FederatedCredential* FederatedCredential::create(WebFederatedCredential* webFede ratedCredential)
15 { 16 {
16 return new FederatedCredential(webFederatedCredential); 17 return new FederatedCredential(webFederatedCredential);
17 } 18 }
18 19
19 FederatedCredential* FederatedCredential::create(const FederatedCredentialData& data, ExceptionState& exceptionState) 20 FederatedCredential* FederatedCredential::create(const FederatedCredentialData& data, ExceptionState& exceptionState)
20 { 21 {
21 KURL iconURL = parseStringAsURL(data.iconURL(), exceptionState); 22 KURL iconURL = parseStringAsURL(data.iconURL(), exceptionState);
22 KURL providerURL = parseStringAsURL(data.provider(), exceptionState); 23 KURL providerURL = parseStringAsURL(data.provider(), exceptionState);
23 if (exceptionState.hadException()) 24 if (exceptionState.hadException())
24 return nullptr; 25 return nullptr;
25 return new FederatedCredential(data.id(), providerURL, data.name(), iconURL) ; 26 return new FederatedCredential(data.id(), providerURL, data.name(), iconURL) ;
26 } 27 }
27 28
28 FederatedCredential::FederatedCredential(WebFederatedCredential* webFederatedCre dential) 29 FederatedCredential::FederatedCredential(WebFederatedCredential* webFederatedCre dential)
29 : Credential(webFederatedCredential->platformCredential()) 30 : Credential(webFederatedCredential->platformCredential())
30 { 31 {
31 } 32 }
32 33
33 FederatedCredential::FederatedCredential(const String& id, const KURL& provider, const String& name, const KURL& icon) 34 FederatedCredential::FederatedCredential(const String& id, const KURL& provider, const String& name, const KURL& icon)
34 : Credential(PlatformFederatedCredential::create(id, provider, name, icon)) 35 : Credential(PlatformFederatedCredential::create(id, SecurityOrigin::create( provider), name, icon))
35 { 36 {
36 } 37 }
37 38
38 const KURL& FederatedCredential::provider() const 39 const String FederatedCredential::provider() const
39 { 40 {
40 return static_cast<PlatformFederatedCredential*>(m_platformCredential.get()) ->provider(); 41 return static_cast<PlatformFederatedCredential*>(m_platformCredential.get()) ->provider()->toString();
41 } 42 }
42 43
43 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698