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 /** 6 * @fileoverview Class providing common dependencies for the extension's 7 * top half. 8 */ 9 'use strict'; 10 11 /** 12 * @param {!CountdownFactory} countdownFactory A countdown timer factory. 13 * @param {!OriginChecker} originChecker An origin checker. 14 * @param {!RequestHelper} requestHelper A request helper. 15 * @param {!TextFetcher} textFetcher A text fetcher. 16 * @constructor 17 */ 18 function FactoryRegistry(countdownFactory, originChecker, requestHelper, 19 textFetcher) { 20 /** @private {!CountdownFactory} */ 21 this.countdownFactory_ = countdownFactory; 22 /** @private {!OriginChecker} */ 23 this.originChecker_ = originChecker; 24 /** @private {!RequestHelper} */ 25 this.requestHelper_ = requestHelper; 26 /** @private {!TextFetcher} */ 27 this.textFetcher_ = textFetcher; 28 } 29 30 /** @return {!CountdownFactory} A countdown factory. */ 31 FactoryRegistry.prototype.getCountdownFactory = function() { 32 return this.countdownFactory_; 33 }; 34 35 /** @return {!OriginChecker} An origin checker. */ 36 FactoryRegistry.prototype.getOriginChecker = function() { 37 return this.originChecker_; 38 }; 39 40 /** @return {!RequestHelper} A request helper. */ 41 FactoryRegistry.prototype.getRequestHelper = function() { 42 return this.requestHelper_; 43 }; 44 45 /** @return {!TextFetcher} A text fetcher. */ 46 FactoryRegistry.prototype.getTextFetcher = function() { 47 return this.textFetcher_; 48 }; 49