| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Singleton object representing the main window of the Memory Inspector Chrome | 8 * Singleton object representing the main window of the Memory Inspector Chrome |
| 9 * App. | 9 * App. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 MemoryInspectorWindow.prototype.storeSettings_ = function() { | 307 MemoryInspectorWindow.prototype.storeSettings_ = function() { |
| 308 var settings = {}; | 308 var settings = {}; |
| 309 settings['terminal_visible'] = this.terminalVisible_; | 309 settings['terminal_visible'] = this.terminalVisible_; |
| 310 chrome.storage.local.set(settings); | 310 chrome.storage.local.set(settings); |
| 311 }; | 311 }; |
| 312 | 312 |
| 313 /** | 313 /** |
| 314 * Listener called when main window settings were retrieved from local storage. | 314 * Listener called when main window settings were retrieved from local storage. |
| 315 * It saves them and finally shows the app window. | 315 * It saves them and finally shows the app window. |
| 316 * @private | 316 * @private |
| 317 * @param {Object.<string, *>} settings The retrieved settings. | 317 * @param {Object<string, *>} settings The retrieved settings. |
| 318 */ | 318 */ |
| 319 MemoryInspectorWindow.prototype.onSettingsRetrieved_ = function(settings) { | 319 MemoryInspectorWindow.prototype.onSettingsRetrieved_ = function(settings) { |
| 320 if (chrome.runtime.lastError === undefined && settings['terminal_visible']) { | 320 if (chrome.runtime.lastError === undefined && settings['terminal_visible']) { |
| 321 // Skip CSS animations by temporarily hiding everything. | 321 // Skip CSS animations by temporarily hiding everything. |
| 322 document.body.style.display = 'none'; | 322 document.body.style.display = 'none'; |
| 323 this.showTerminal_(); | 323 this.showTerminal_(); |
| 324 document.body.style.display = 'block'; | 324 document.body.style.display = 'block'; |
| 325 } | 325 } |
| 326 | 326 |
| 327 // We are finally ready to show the window. | 327 // We are finally ready to show the window. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 window.addEventListener('load', function() { | 398 window.addEventListener('load', function() { |
| 399 // Create the singleton MemoryInspectorWindow instance and initialize it. | 399 // Create the singleton MemoryInspectorWindow instance and initialize it. |
| 400 var mainWindow = new MemoryInspectorWindow(); | 400 var mainWindow = new MemoryInspectorWindow(); |
| 401 mainWindow.initialize(); | 401 mainWindow.initialize(); |
| 402 | 402 |
| 403 // Make the instance global for debugging purposes. | 403 // Make the instance global for debugging purposes. |
| 404 window.mainWindow = mainWindow; | 404 window.mainWindow = mainWindow; |
| 405 }); | 405 }); |
| 406 | 406 |
| OLD | NEW |