Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / file_manager / file_manager / foreground / js / main.js
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 /**
6  * @type {FileManager}
7  */
8 var fileManager;
9
10 /**
11  * Indicates if the DOM and scripts have been already loaded.
12  * @type {boolean}
13  */
14 var pageLoaded = false;
15
16 /**
17  * Kick off the file manager dialog.
18  * Called by main.html after the DOM has been parsed.
19  */
20 function init() {
21   // Initializes UI and starts the File Manager dialog.
22   fileManager.initializeUI(document.body, function() {
23     util.testSendMessage('ready');
24     metrics.recordInterval('Load.Total');
25   });
26 }
27
28 // Create the File Manager object. Note, that the DOM, nor any external
29 // scripts may not be ready yet.
30 fileManager = new FileManager();
31
32 // Initialize the core stuff, which doesn't require access to DOM nor to
33 // additional scripts.
34 fileManager.initializeCore();
35
36 // Final initialization is performed after all scripts and DOM is loaded.
37 util.addPageLoadHandler(init);
38
39 metrics.recordInterval('Load.Script');  // Must be the last line.