Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / components / test_runner / mock_credential_manager_client.h
blob85ae81a9278aefc4e1b9d0a944c5b0fa2fbf0c65
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
6 #define COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/WebKit/public/platform/WebCredentialManagerClient.h"
10 #include "third_party/WebKit/public/platform/WebVector.h"
12 namespace blink {
13 class WebCredential;
14 class WebFrame;
15 class WebURL;
18 namespace test_runner {
20 class MockCredentialManagerClient : public blink::WebCredentialManagerClient {
21 public:
22 MockCredentialManagerClient();
23 virtual ~MockCredentialManagerClient();
25 // We take ownership of the |credential|.
26 void SetResponse(blink::WebCredential* credential);
28 // blink::WebCredentialManager:
29 virtual void dispatchStore(const blink::WebCredential& credential,
30 NotificationCallbacks* callbacks);
31 virtual void dispatchRequireUserMediation(NotificationCallbacks* callbacks);
32 virtual void dispatchGet(
33 bool zero_click_only,
34 const blink::WebVector<blink::WebURL>& federations,
35 RequestCallbacks* callbacks);
37 private:
38 scoped_ptr<blink::WebCredential> credential_;
40 DISALLOW_COPY_AND_ASSIGN(MockCredentialManagerClient);
43 } // namespace test_runner
45 #endif // COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_