Index: components/password_manager/core/browser/affiliation_fetcher_factory.h |
diff --git a/components/password_manager/core/browser/affiliation_fetcher_factory.h b/components/password_manager/core/browser/affiliation_fetcher_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..070c235df2abc2575a4abaa0e088203e37a5f3c7 |
--- /dev/null |
+++ b/components/password_manager/core/browser/affiliation_fetcher_factory.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 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_FACTORY_H_ |
+#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_FACTORY_H_ |
+ |
+#include <vector> |
+ |
+namespace net { |
+class URLRequestContextGetter; |
+} // namespace net |
+ |
+namespace password_manager { |
+ |
+class FacetURI; |
+class AffiliationFetcherDelegate; |
+ |
+// Interface for a factory to be used by AffiliationFetcher::Create() to create |
+// custom AffiliationFetcher instances. Intended for testing. |
+// |
+// The factory is registered with AffiliationFetcher::SetFactoryForTesting(). |
+class AffiliationFetcherFactory { |
+ public: |
+ // Constructs a fetcher to retrieve affiliations for each facet in |facet_ids| |
+ // using the specified |request_context_getter|, and will provide the results |
+ // to the |delegate| on the same thread that creates the instance. |
+ virtual AffiliationFetcher* CreateInstance( |
+ net::URLRequestContextGetter* request_context_getter, |
+ const std::vector<FacetURI>& facet_ids, |
+ AffiliationFetcherDelegate* delegate) = 0; |
+ |
+ protected: |
+ virtual ~AffiliationFetcherFactory() {} |
+}; |
+ |
+} // namespace password_manager |
+ |
+#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_FETCHER_FACTORY_H_ |