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

Side by Side Diff: chrome/browser/resources/file_manager/js/util.js

Issue 16207004: Files.app: Fix errors when launching Files.app via "chrome://files" (2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 6 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
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698