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

Side by Side Diff: Source/modules/credentialmanager/CredentialManagerClient.cpp

Issue 573663002: Credential Manager: Wire up the client. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null check. Created 6 years, 3 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "modules/credentialmanager/CredentialManagerClient.h" 6 #include "modules/credentialmanager/CredentialManagerClient.h"
7 7
8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/Document.h"
10 #include "core/dom/ExecutionContext.h"
8 #include "core/page/Page.h" 11 #include "core/page/Page.h"
9 12
10 namespace blink { 13 namespace blink {
11 14
12 CredentialManagerClient::CredentialManagerClient(WebCredentialManagerClient* cli ent) 15 CredentialManagerClient::CredentialManagerClient(WebCredentialManagerClient* cli ent)
13 : m_client(client) 16 : m_client(client)
14 { 17 {
15 } 18 }
16 19
17 CredentialManagerClient::~CredentialManagerClient() 20 CredentialManagerClient::~CredentialManagerClient()
18 { 21 {
19 } 22 }
20 23
21 // static 24 // static
22 const char* CredentialManagerClient::supplementName() 25 const char* CredentialManagerClient::supplementName()
23 { 26 {
24 return "CredentialManagerClient"; 27 return "CredentialManagerClient";
25 } 28 }
26 29
27 // static 30 // static
31 CredentialManagerClient* CredentialManagerClient::from(ExecutionContext* executi onContext)
32 {
33 if (!executionContext->isDocument() || !toDocument(executionContext)->page() )
34 return 0;
35 return from(toDocument(executionContext)->page());
36 }
37
38 // static
28 CredentialManagerClient* CredentialManagerClient::from(Page* page) 39 CredentialManagerClient* CredentialManagerClient::from(Page* page)
29 { 40 {
30 return static_cast<CredentialManagerClient*>(WillBeHeapSupplement<Page>::fro m(page, supplementName())); 41 return static_cast<CredentialManagerClient*>(WillBeHeapSupplement<Page>::fro m(page, supplementName()));
31 } 42 }
32 43
33 void provideCredentialManagerClientTo(Page& page, CredentialManagerClient* clien t) 44 void provideCredentialManagerClientTo(Page& page, CredentialManagerClient* clien t)
34 { 45 {
35 CredentialManagerClient::provideTo(page, CredentialManagerClient::supplement Name(), adoptPtrWillBeNoop(client)); 46 CredentialManagerClient::provideTo(page, CredentialManagerClient::supplement Name(), adoptPtrWillBeNoop(client));
36 } 47 }
37 48
(...skipping 19 matching lines...) Expand all
57 } 68 }
58 69
59 void CredentialManagerClient::dispatchRequest(bool zeroClickOnly, const WebVecto r<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks* callbacks) 70 void CredentialManagerClient::dispatchRequest(bool zeroClickOnly, const WebVecto r<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks* callbacks)
60 { 71 {
61 if (!m_client) 72 if (!m_client)
62 return; 73 return;
63 m_client->dispatchRequest(zeroClickOnly, federations, callbacks); 74 m_client->dispatchRequest(zeroClickOnly, federations, callbacks);
64 } 75 }
65 76
66 } // namespace blink 77 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/credentialmanager/CredentialManagerClient.h ('k') | Source/modules/credentialmanager/CredentialsContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698