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 {!ApprovedOrigins} approvedOrigins An origin approval implementation.
13 * @param {!CountdownFactory} countdownFactory A countdown timer factory.
14 * @param {!OriginChecker} originChecker An origin checker.
15 * @param {!RequestHelper} requestHelper A request helper.
16 * @param {!TextFetcher} textFetcher A text fetcher.
19 function FactoryRegistry(approvedOrigins
, countdownFactory
, originChecker
,
20 requestHelper
, textFetcher
) {
21 /** @private {!ApprovedOrigins} */
22 this.approvedOrigins_
= approvedOrigins
;
23 /** @private {!CountdownFactory} */
24 this.countdownFactory_
= countdownFactory
;
25 /** @private {!OriginChecker} */
26 this.originChecker_
= originChecker
;
27 /** @private {!RequestHelper} */
28 this.requestHelper_
= requestHelper
;
29 /** @private {!TextFetcher} */
30 this.textFetcher_
= textFetcher
;
33 /** @return {!ApprovedOrigins} An origin approval implementation. */
34 FactoryRegistry
.prototype.getApprovedOrigins = function() {
35 return this.approvedOrigins_
;
38 /** @return {!CountdownFactory} A countdown factory. */
39 FactoryRegistry
.prototype.getCountdownFactory = function() {
40 return this.countdownFactory_
;
43 /** @return {!OriginChecker} An origin checker. */
44 FactoryRegistry
.prototype.getOriginChecker = function() {
45 return this.originChecker_
;
48 /** @return {!RequestHelper} A request helper. */
49 FactoryRegistry
.prototype.getRequestHelper = function() {
50 return this.requestHelper_
;
53 /** @return {!TextFetcher} A text fetcher. */
54 FactoryRegistry
.prototype.getTextFetcher = function() {
55 return this.textFetcher_
;