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

Side by Side Diff: chrome/browser/resources/file_manager/js/metadata/metadata_parser.js

Issue 39123003: [Files.app] Split the JavaScript files into subdirectories: common, background, and foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test failure. Created 7 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 'use strict';
6
7 /**
8 * @param {MetadataDispatcher} parent Parent object.
9 * @param {string} type Parser type.
10 * @param {RegExp} urlFilter RegExp to match URLs.
11 * @constructor
12 */
13 function MetadataParser(parent, type, urlFilter) {
14 this.parent_ = parent;
15 this.type = type;
16 this.urlFilter = urlFilter;
17 this.verbose = parent.verbose;
18 this.mimeType = 'unknown';
19 }
20
21 /**
22 * Output an error message.
23 * @param {...Object} var_args Arguments.
24 */
25 MetadataParser.prototype.error = function(var_args) {
26 this.parent_.error.apply(this.parent_, arguments);
27 };
28
29 /**
30 * Output a log message.
31 * @param {...Object} var_args Arguments.
32 */
33 MetadataParser.prototype.log = function(var_args) {
34 this.parent_.log.apply(this.parent_, arguments);
35 };
36
37 /**
38 * Output a log message if |verbose| flag is on.
39 * @param {...Object} var_args Arguments.
40 */
41 MetadataParser.prototype.vlog = function(var_args) {
42 if (this.verbose)
43 this.parent_.log.apply(this.parent_, arguments);
44 };
45
46 /**
47 * @return {Object} Metadata object with the minimal set of properties.
48 */
49 MetadataParser.prototype.createDefaultMetadata = function() {
50 return {
51 type: this.type,
52 mimeType: this.mimeType
53 };
54 };
55
56 /* Base class for image metadata parsers */
57 function ImageParser(parent, type, urlFilter) {
58 MetadataParser.apply(this, arguments);
59 this.mimeType = 'image/' + this.type;
60 }
61
62 ImageParser.prototype = {__proto__: MetadataParser.prototype};
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698