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 "components/test_runner/mock_credential_manager_client.h" | 5 #include "components/test_runner/mock_credential_manager_client.h" |
6 | 6 |
| 7 #include <memory> |
| 8 #include <utility> |
| 9 |
7 #include "third_party/WebKit/public/platform/WebCredential.h" | 10 #include "third_party/WebKit/public/platform/WebCredential.h" |
8 #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" | |
9 | 11 |
10 namespace test_runner { | 12 namespace test_runner { |
11 | 13 |
12 MockCredentialManagerClient::MockCredentialManagerClient() | 14 MockCredentialManagerClient::MockCredentialManagerClient() |
13 : error_(blink::WebCredentialManagerNoError) {} | 15 : error_(blink::WebCredentialManagerNoError) {} |
14 | 16 |
15 MockCredentialManagerClient::~MockCredentialManagerClient() { | 17 MockCredentialManagerClient::~MockCredentialManagerClient() { |
16 } | 18 } |
17 | 19 |
18 void MockCredentialManagerClient::SetResponse( | 20 void MockCredentialManagerClient::SetResponse( |
(...skipping 26 matching lines...) Expand all Loading... |
45 } | 47 } |
46 | 48 |
47 void MockCredentialManagerClient::dispatchGet( | 49 void MockCredentialManagerClient::dispatchGet( |
48 bool zero_click_only, | 50 bool zero_click_only, |
49 bool include_passwords, | 51 bool include_passwords, |
50 const blink::WebVector<blink::WebURL>& federations, | 52 const blink::WebVector<blink::WebURL>& federations, |
51 RequestCallbacks* callbacks) { | 53 RequestCallbacks* callbacks) { |
52 if (error_ != blink::WebCredentialManagerNoError) | 54 if (error_ != blink::WebCredentialManagerNoError) |
53 callbacks->onError(error_); | 55 callbacks->onError(error_); |
54 else | 56 else |
55 callbacks->onSuccess(adoptWebPtr(credential_.release())); | 57 callbacks->onSuccess(std::move(credential_)); |
56 delete callbacks; | 58 delete callbacks; |
57 } | 59 } |
58 | 60 |
59 } // namespace test_runner | 61 } // namespace test_runner |
OLD | NEW |