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.
6 * @fileoverview Class providing common dependencies for the extension's
12 * @param {!AppIdCheckerFactory} appIdCheckerFactory An appId checker factory.
13 * @param {!ApprovedOrigins} approvedOrigins An origin approval implementation.
14 * @param {!CountdownFactory} countdownFactory A countdown timer factory.
15 * @param {!OriginChecker} originChecker An origin checker.
16 * @param {!RequestHelper} requestHelper A request helper.
17 * @param {!SystemTimer} sysTimer A system timer implementation.
18 * @param {!TextFetcher} textFetcher A text fetcher.
21 function FactoryRegistry(appIdCheckerFactory, approvedOrigins, countdownFactory,
22 originChecker, requestHelper, sysTimer, textFetcher) {
23 /** @private {!AppIdCheckerFactory} */
24 this.appIdCheckerFactory_ = appIdCheckerFactory;
25 /** @private {!ApprovedOrigins} */
26 this.approvedOrigins_ = approvedOrigins;
27 /** @private {!CountdownFactory} */
28 this.countdownFactory_ = countdownFactory;
29 /** @private {!OriginChecker} */
30 this.originChecker_ = originChecker;
31 /** @private {!RequestHelper} */
32 this.requestHelper_ = requestHelper;
33 /** @private {!SystemTimer} */
34 this.sysTimer_ = sysTimer;
35 /** @private {!TextFetcher} */
36 this.textFetcher_ = textFetcher;
39 /** @return {!AppIdCheckerFactory} An appId checker factory. */
40 FactoryRegistry.prototype.getAppIdCheckerFactory = function() {
41 return this.appIdCheckerFactory_;
44 /** @return {!ApprovedOrigins} An origin approval implementation. */
45 FactoryRegistry.prototype.getApprovedOrigins = function() {
46 return this.approvedOrigins_;
49 /** @return {!CountdownFactory} A countdown factory. */
50 FactoryRegistry.prototype.getCountdownFactory = function() {
51 return this.countdownFactory_;
54 /** @return {!OriginChecker} An origin checker. */
55 FactoryRegistry.prototype.getOriginChecker = function() {
56 return this.originChecker_;
59 /** @return {!RequestHelper} A request helper. */
60 FactoryRegistry.prototype.getRequestHelper = function() {
61 return this.requestHelper_;
64 /** @return {!SystemTimer} A system timer implementation. */
65 FactoryRegistry.prototype.getSystemTimer = function() {
66 return this.sysTimer_;
69 /** @return {!TextFetcher} A text fetcher. */
70 FactoryRegistry.prototype.getTextFetcher = function() {
71 return this.textFetcher_;