* @param {!./deps.DepsDef} deps * @param {!MeterToastApiParams=} params
(
deps,
{
meterClientType = MeterClientTypes.LICENSED_BY_GOOGLE,
meterClientUserAttribute = ANONYMOUS_USER_ATTRIBUTE,
} = {}
)
| 11592 | * @param {!MeterToastApiParams=} params |
| 11593 | */ |
| 11594 | constructor( |
| 11595 | deps, |
| 11596 | { |
| 11597 | meterClientType = MeterClientTypes.LICENSED_BY_GOOGLE, |
| 11598 | meterClientUserAttribute = ANONYMOUS_USER_ATTRIBUTE, |
| 11599 | } = {} |
| 11600 | ) { |
| 11601 | /** @private @const {!./deps.DepsDef} */ |
| 11602 | this.deps_ = deps; |
| 11603 | |
| 11604 | /** @private @const {!Window} */ |
| 11605 | this.win_ = deps.win(); |
| 11606 | |
| 11607 | /** @private @const {!../components/activities.ActivityPorts} */ |
| 11608 | this.activityPorts_ = deps.activities(); |
| 11609 | |
| 11610 | /** @private @const {!../components/dialog-manager.DialogManager} */ |
| 11611 | this.dialogManager_ = deps.dialogManager(); |
| 11612 | |
| 11613 | /** @private @const {!MeterClientTypes} */ |
| 11614 | this.meterClientType_ = meterClientType; |
| 11615 | |
| 11616 | /** @private @const {string} */ |
| 11617 | this.meterClientUserAttribute_ = meterClientUserAttribute; |
| 11618 | |
| 11619 | /** |
| 11620 | * Function this class calls when a user dismisses the toast to consume a |
| 11621 | * free read. |
| 11622 | * @private {?function()} |
| 11623 | */ |
| 11624 | this.onConsumeCallback_ = null; |
| 11625 | |
| 11626 | /** |
| 11627 | * Boolean indicating whether or not the onConsumeCallback_ has been handled |
| 11628 | * (either called or ignored). This is used to protect against unexpected |
| 11629 | * cancellations not consuming a meter. |
| 11630 | * @private {!boolean} |
| 11631 | */ |
| 11632 | this.onConsumeCallbackHandled_ = false; |
| 11633 | |
| 11634 | /** @private {?function()} */ |
| 11635 | this.scrollEventListener_ = null; |
| 11636 | } |
| 11637 | |
| 11638 | /** |
| 11639 | * Shows the user the metering toast. |
nothing calls this directly
no test coverage detected