| Index: components/password_manager/core/browser/affiliation_fetcher_delegate.h
|
| diff --git a/components/password_manager/core/browser/affiliation_fetcher_delegate.h b/components/password_manager/core/browser/affiliation_fetcher_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9d1cd137e7277c0a08dea6586d3fa4eb46a3587f
|
| --- /dev/null
|
| +++ b/components/password_manager/core/browser/affiliation_fetcher_delegate.h
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE_H_
|
| +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "components/password_manager/core/browser/affiliation_utils.h"
|
| +
|
| +namespace password_manager {
|
| +
|
| +// Interface that users of AffiliationFetcher should implement to get results of
|
| +// the fetch. It is safe to destroy the fetcher in any of the event handlers.
|
| +class AffiliationFetcherDelegate {
|
| + public:
|
| + // Encapsulates the response to an affiliations request.
|
| + typedef std::vector<AffiliatedFacets> Result;
|
| +
|
| + // Called when affiliation information has been successfully retrieved. The
|
| + // |result| will contain at most as many equivalence class as facet URIs in
|
| + // the request, and each requested facet URI will appear in exactly one
|
| + // equivalence class.
|
| + virtual void OnFetchSucceeded(scoped_ptr<Result> result) = 0;
|
| +
|
| + // Called when affiliation information could not be fetched due to network or
|
| + // server error.
|
| + virtual void OnFetchFailed() = 0;
|
| +
|
| + // This will be called when an affiliation response was received, but it was
|
| + // gravely malformed.
|
| + virtual void OnMalformedResponse() = 0;
|
| +
|
| + protected:
|
| + virtual ~AffiliationFetcherDelegate() {}
|
| +};
|
| +
|
| +} // namespace password_manager
|
| +
|
| +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_DELEGATE_H_
|
|
|