Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/resources/access_chromevox/common/abstract_logger.js

Issue 6254007: Adding ChromeVox as a component extensions (enabled only for ChromeOS, for no... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 Base class for classes that can log their behavior.
7 */
8
9 goog.provide('cvox.AbstractLogger');
10
11 /**
12 * Creates a new instance.
13 * @constructor
14 */
15 cvox.AbstractLogger = function() {
16 if (this.logEnabled()) {
17 this.debuglog = new Array();
18 }
19 };
20
21 /**
22 * @return {string} The human-readable name of this instance.
23 */
24 cvox.AbstractLogger.prototype.getName = function() {
25 return 'AbstractLogger';
26 };
27
28 /**
29 * @return {boolean} If logging is enabled.
30 */
31 cvox.AbstractLogger.prototype.logEnabled = function() {
32 return true;
33 };
34
35 /**
36 * Debugging function - adds the string to the log of utterances.
37 * @param {string} msgString The string of text to log.
38 */
39 cvox.AbstractLogger.prototype.log = function(msgString) {
40 if (!this.logEnabled()) {
41 return;
42 }
43 this.debuglog.push(msgString);
44 if (console) {
45 console.log(msgString);
46 }
47 };
48
49 /**
50 * Debugging function - returns the log of utterances.
51 * @return {Array} The log of utterances.
52 */
53 cvox.AbstractLogger.prototype.getLog = function() {
54 return this.debuglog;
55 };
56
57 /**
58 * Debugging function - resets the log of utterances.
59 */
60 cvox.AbstractLogger.prototype.resetLog = function() {
61 this.debuglog = new Array();
62 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698