| 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 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ | 6 #define COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "third_party/WebKit/public/platform/WebCredentialManagerClient.h" | 9 #include "third_party/WebKit/public/platform/WebCredentialManagerClient.h" |
| 10 #include "third_party/WebKit/public/platform/WebVector.h" | 10 #include "third_party/WebKit/public/platform/WebVector.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 class WebCredential; | 13 class WebCredential; |
| 14 class WebFrame; | 14 class WebFrame; |
| 15 class WebURL; | 15 class WebURL; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace test_runner { | 18 namespace test_runner { |
| 19 | 19 |
| 20 class MockCredentialManagerClient : public blink::WebCredentialManagerClient { | 20 class MockCredentialManagerClient : public blink::WebCredentialManagerClient { |
| 21 public: | 21 public: |
| 22 MockCredentialManagerClient(); | 22 MockCredentialManagerClient(); |
| 23 virtual ~MockCredentialManagerClient(); | 23 virtual ~MockCredentialManagerClient(); |
| 24 | 24 |
| 25 // We take ownership of the |credential|. | 25 // We take ownership of the |credential|. |
| 26 void SetResponse(blink::WebCredential* credential); | 26 void SetResponse(blink::WebCredential* credential); |
| 27 | 27 |
| 28 // blink::WebCredentialManager: | 28 // blink::WebCredentialManager: |
| 29 virtual void dispatchStore(const blink::WebCredential& credential, | 29 void dispatchStore(const blink::WebCredential& credential, |
| 30 NotificationCallbacks* callbacks); | 30 NotificationCallbacks* callbacks) override; |
| 31 virtual void dispatchRequireUserMediation(NotificationCallbacks* callbacks); | 31 void dispatchRequireUserMediation(NotificationCallbacks* callbacks) override; |
| 32 virtual void dispatchGet( | 32 void dispatchGet(bool zero_click_only, |
| 33 bool zero_click_only, | 33 const blink::WebVector<blink::WebURL>& federations, |
| 34 const blink::WebVector<blink::WebURL>& federations, | 34 RequestCallbacks* callbacks) override; |
| 35 RequestCallbacks* callbacks); | |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 scoped_ptr<blink::WebCredential> credential_; | 37 scoped_ptr<blink::WebCredential> credential_; |
| 39 | 38 |
| 40 DISALLOW_COPY_AND_ASSIGN(MockCredentialManagerClient); | 39 DISALLOW_COPY_AND_ASSIGN(MockCredentialManagerClient); |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 } // namespace test_runner | 42 } // namespace test_runner |
| 44 | 43 |
| 45 #endif // COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ | 44 #endif // COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_ |
| OLD | NEW |