OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/password_manager/core/browser/fake_affiliation_fetcher.h" | 5 #include "components/password_manager/core/browser/fake_affiliation_fetcher.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 namespace password_manager { | 9 namespace password_manager { |
8 | 10 |
9 password_manager::FakeAffiliationFetcher::FakeAffiliationFetcher( | 11 password_manager::FakeAffiliationFetcher::FakeAffiliationFetcher( |
10 net::URLRequestContextGetter* request_context_getter, | 12 net::URLRequestContextGetter* request_context_getter, |
11 const std::vector<FacetURI>& facet_ids, | 13 const std::vector<FacetURI>& facet_ids, |
12 AffiliationFetcherDelegate* delegate) | 14 AffiliationFetcherDelegate* delegate) |
13 : AffiliationFetcher(request_context_getter, facet_ids, delegate) { | 15 : AffiliationFetcher(request_context_getter, facet_ids, delegate) { |
14 } | 16 } |
15 | 17 |
16 password_manager::FakeAffiliationFetcher::~FakeAffiliationFetcher() { | 18 password_manager::FakeAffiliationFetcher::~FakeAffiliationFetcher() { |
17 } | 19 } |
18 | 20 |
19 void password_manager::FakeAffiliationFetcher::SimulateSuccess( | 21 void password_manager::FakeAffiliationFetcher::SimulateSuccess( |
20 scoped_ptr<AffiliationFetcherDelegate::Result> fake_result) { | 22 scoped_ptr<AffiliationFetcherDelegate::Result> fake_result) { |
21 delegate()->OnFetchSucceeded(fake_result.Pass()); | 23 delegate()->OnFetchSucceeded(std::move(fake_result)); |
22 } | 24 } |
23 | 25 |
24 void password_manager::FakeAffiliationFetcher::SimulateFailure() { | 26 void password_manager::FakeAffiliationFetcher::SimulateFailure() { |
25 delegate()->OnFetchFailed(); | 27 delegate()->OnFetchFailed(); |
26 } | 28 } |
27 | 29 |
28 void password_manager::FakeAffiliationFetcher::StartRequest() { | 30 void password_manager::FakeAffiliationFetcher::StartRequest() { |
29 // Fake. Does nothing. | 31 // Fake. Does nothing. |
30 } | 32 } |
31 | 33 |
(...skipping 23 matching lines...) Expand all Loading... |
55 net::URLRequestContextGetter* request_context_getter, | 57 net::URLRequestContextGetter* request_context_getter, |
56 const std::vector<FacetURI>& facet_ids, | 58 const std::vector<FacetURI>& facet_ids, |
57 AffiliationFetcherDelegate* delegate) { | 59 AffiliationFetcherDelegate* delegate) { |
58 FakeAffiliationFetcher* fetcher = | 60 FakeAffiliationFetcher* fetcher = |
59 new FakeAffiliationFetcher(request_context_getter, facet_ids, delegate); | 61 new FakeAffiliationFetcher(request_context_getter, facet_ids, delegate); |
60 pending_fetchers_.push(fetcher); | 62 pending_fetchers_.push(fetcher); |
61 return fetcher; | 63 return fetcher; |
62 } | 64 } |
63 | 65 |
64 } // namespace password_manager | 66 } // namespace password_manager |
OLD | NEW |