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 the files.app is running as AppsV2. False if | |
mtomasz
2013/06/04 06:38:44
nit: the files.app -> Files.app (for consistency)
yoshiki
2013/06/04 06:57:34
Done.
| |
808 * running via "chrome://files". | |
809 */ | |
810 runningAsApps: function() { | |
mtomasz
2013/06/04 06:38:44
This naming is confusing. Files.app in chrome://fi
yoshiki
2013/06/04 06:57:34
Done.
| |
811 if (!util.platform.v2() || !util.platform.newUI()) | |
mtomasz
2013/06/04 06:38:44
Remove util.platform.newUI() check?
yoshiki
2013/06/04 06:57:34
Done.
| |
812 return false; | |
813 return (window.appID) ? true : false; | |
mtomasz
2013/06/04 06:38:44
... -> return !!window.appID ?
yoshiki
2013/06/04 06:57:34
Refactored.
| |
814 }, | |
815 | |
816 /** | |
807 * @return {boolean} True for the new ui. | 817 * @return {boolean} True for the new ui. |
808 */ | 818 */ |
809 newUI: function() { | 819 newUI: function() { |
810 if (util.platform.newUICached_ === undefined) { | 820 if (util.platform.newUICached_ === undefined) { |
811 var manifest = chrome.runtime.getManifest(); | 821 var manifest = chrome.runtime.getManifest(); |
812 util.platform.newUICached_ = manifest.version >= 3.0; | 822 util.platform.newUICached_ = manifest.version >= 3.0; |
813 } | 823 } |
814 return util.platform.newUICached_; | 824 return util.platform.newUICached_; |
815 }, | 825 }, |
816 | 826 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1336 console.error( | 1346 console.error( |
1337 'App window not passed. Unable to toggle the full screen mode.'); | 1347 'App window not passed. Unable to toggle the full screen mode.'); |
1338 return; | 1348 return; |
1339 } | 1349 } |
1340 | 1350 |
1341 if (!enabled) | 1351 if (!enabled) |
1342 document.webkitCancelFullScreen(); | 1352 document.webkitCancelFullScreen(); |
1343 else | 1353 else |
1344 document.body.webkitRequestFullScreen(); | 1354 document.body.webkitRequestFullScreen(); |
1345 }; | 1355 }; |
OLD | NEW |