OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "components/password_manager/core/browser/affiliation_utils.h" |
| 12 |
| 13 namespace password_manager { |
| 14 |
| 15 // Interface that users of AffiliationFetcher should implement to get results of |
| 16 // the fetch. It is safe to destroy the fetcher in any of the event handlers. |
| 17 class AffiliationFetcherDelegate { |
| 18 public: |
| 19 // Encapsulates the response to an affiliations request. |
| 20 typedef std::vector<AffiliatedFacets> Result; |
| 21 |
| 22 // Called when affiliation information has been successfully retrieved. The |
| 23 // |result| will contain at most as many equivalence class as facet URIs in |
| 24 // the request, and each requested facet URI will appear in exactly one |
| 25 // equivalence class. |
| 26 virtual void OnFetchSucceeded(scoped_ptr<Result> result) = 0; |
| 27 |
| 28 // Called when affiliation information could not be fetched due to network or |
| 29 // server error. |
| 30 virtual void OnFetchFailed() = 0; |
| 31 |
| 32 // This will be called when an affiliation response was received, but it was |
| 33 // gravely malformed. |
| 34 virtual void OnMalformedResponse() = 0; |
| 35 |
| 36 protected: |
| 37 virtual ~AffiliationFetcherDelegate() {} |
| 38 }; |
| 39 |
| 40 } // namespace password_manager |
| 41 |
| 42 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE
_H_ |
OLD | NEW |