• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 A global serializer object which returns the current
7 * ChromeVox system state.
8 */
9
10goog.provide('cvox.Serializer');
11
12goog.require('cvox.ChromeVox');
13goog.require('cvox.ChromeVoxEventWatcher');
14
15/**
16 * @constructor
17 */
18cvox.Serializer = function() { };
19
20/**
21 * Stores state variables in a provided object.
22 *
23 * @param {Object} store The object.
24 */
25cvox.Serializer.prototype.storeOn = function(store) {
26  cvox.ChromeVox.storeOn(store);
27  cvox.ChromeVoxEventWatcher.storeOn(store);
28};
29
30/**
31 * Updates the object with state variables from an earlier storeOn call.
32 *
33 * @param {Object} store The object.
34 */
35cvox.Serializer.prototype.readFrom = function(store) {
36  cvox.ChromeVox.readFrom(store);
37  cvox.ChromeVoxEventWatcher.readFrom(store);
38};
39