OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 * Namespace for utility functions. | 8 * Namespace for utility functions. |
9 */ | 9 */ |
10 var util = {}; | 10 var util = {}; |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 */ | 797 */ |
798 v2: function() { | 798 v2: function() { |
799 try { | 799 try { |
800 return !!(chrome.app && chrome.app.runtime); | 800 return !!(chrome.app && chrome.app.runtime); |
801 } catch (e) { | 801 } catch (e) { |
802 return false; | 802 return false; |
803 } | 803 } |
804 }, | 804 }, |
805 | 805 |
806 /** | 806 /** |
| 807 * @return {boolean} True if Files.app is running via "chrome://files". |
| 808 */ |
| 809 runningInBrowser: function() { |
| 810 return util.platform.v2() && !window.appID; |
| 811 }, |
| 812 |
| 813 /** |
807 * @return {boolean} True for the new ui. | 814 * @return {boolean} True for the new ui. |
808 */ | 815 */ |
809 newUI: function() { | 816 newUI: function() { |
810 if (util.platform.newUICached_ === undefined) { | 817 if (util.platform.newUICached_ === undefined) { |
811 var manifest = chrome.runtime.getManifest(); | 818 var manifest = chrome.runtime.getManifest(); |
812 util.platform.newUICached_ = manifest.version >= 3.0; | 819 util.platform.newUICached_ = manifest.version >= 3.0; |
813 } | 820 } |
814 return util.platform.newUICached_; | 821 return util.platform.newUICached_; |
815 }, | 822 }, |
816 | 823 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 console.error( | 1343 console.error( |
1337 'App window not passed. Unable to toggle the full screen mode.'); | 1344 'App window not passed. Unable to toggle the full screen mode.'); |
1338 return; | 1345 return; |
1339 } | 1346 } |
1340 | 1347 |
1341 if (!enabled) | 1348 if (!enabled) |
1342 document.webkitCancelFullScreen(); | 1349 document.webkitCancelFullScreen(); |
1343 else | 1350 else |
1344 document.body.webkitRequestFullScreen(); | 1351 document.body.webkitRequestFullScreen(); |
1345 }; | 1352 }; |
OLD | NEW |