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 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
9 * @type {number} | 9 * @type {number} |
10 */ | 10 */ |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 // Get the command line option. | 173 // Get the command line option. |
174 group.add(function(done) { | 174 group.add(function(done) { |
175 chrome.commandLinePrivate.hasSwitch( | 175 chrome.commandLinePrivate.hasSwitch( |
176 'file-manager-show-checkboxes', function(flag) { | 176 'file-manager-show-checkboxes', function(flag) { |
177 this.showCheckboxes_ = flag; | 177 this.showCheckboxes_ = flag; |
178 done(); | 178 done(); |
179 }.bind(this)); | 179 }.bind(this)); |
180 }.bind(this)); | 180 }.bind(this)); |
181 | 181 |
182 // TODO(yoshiki): Remove the flag when the feature is launched. | 182 // TODO(yoshiki): Now the integration is always enabled. Remove this code |
183 this.enableExperimentalWebstoreIntegration_ = false; | 183 // when the feature is launched successfully in M31. Until then, we keep it |
184 group.add(function(done) { | 184 // just in case. |
185 chrome.commandLinePrivate.hasSwitch( | 185 this.enableExperimentalWebstoreIntegration_ = true; |
186 'file-manager-enable-webstore-integration', function(flag) { | |
187 this.enableExperimentalWebstoreIntegration_ = flag; | |
188 done(); | |
189 }.bind(this)); | |
190 }.bind(this)); | |
191 | 186 |
192 group.run(callback); | 187 group.run(callback); |
193 }; | 188 }; |
194 | 189 |
195 /** | 190 /** |
196 * Request local file system, resolve roots and init_ after that. | 191 * Request local file system, resolve roots and init_ after that. |
197 * Warning, you can't use DOM nor any external scripts here, since it may not | 192 * Warning, you can't use DOM nor any external scripts here, since it may not |
198 * be loaded yet. Functions in util.* and metrics.* are available and can | 193 * be loaded yet. Functions in util.* and metrics.* are available and can |
199 * be used. | 194 * be used. |
200 * | 195 * |
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 extension == 'exe' ? 'NO_ACTION_FOR_EXECUTABLE' : | 2267 extension == 'exe' ? 'NO_ACTION_FOR_EXECUTABLE' : |
2273 'NO_ACTION_FOR_FILE'; | 2268 'NO_ACTION_FOR_FILE'; |
2274 var webStoreUrl = FileTasks.createWebStoreLink(extension, mimeType); | 2269 var webStoreUrl = FileTasks.createWebStoreLink(extension, mimeType); |
2275 var text = loadTimeData.getStringF( | 2270 var text = loadTimeData.getStringF( |
2276 messageString, | 2271 messageString, |
2277 webStoreUrl, | 2272 webStoreUrl, |
2278 FileTasks.NO_ACTION_FOR_FILE_URL); | 2273 FileTasks.NO_ACTION_FOR_FILE_URL); |
2279 this.alert.showHtml(filename, text, function() {}); | 2274 this.alert.showHtml(filename, text, function() {}); |
2280 }.bind(this); | 2275 }.bind(this); |
2281 | 2276 |
| 2277 // TODO(yoshiki): Now the integration is always enabled. Remove this |
| 2278 // code when the feature is launched successfully in M31. |
2282 if (!this.enableExperimentalWebstoreIntegration_) { | 2279 if (!this.enableExperimentalWebstoreIntegration_) { |
2283 showAlert(); | 2280 showAlert(); |
2284 return; | 2281 return; |
2285 } | 2282 } |
2286 | 2283 |
2287 this.openSuggestAppsDialog_(urls, | 2284 this.openSuggestAppsDialog_(urls, |
2288 // Success callback. | 2285 // Success callback. |
2289 function() { | 2286 function() { |
2290 var tasks = new FileTasks(this); | 2287 var tasks = new FileTasks(this); |
2291 tasks.init(urls, mimeTypes); | 2288 tasks.init(urls, mimeTypes); |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3939 */ | 3936 */ |
3940 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3937 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3941 this.ctrlKeyPressed_ = flag; | 3938 this.ctrlKeyPressed_ = flag; |
3942 // Before the DOM is constructed, the key event can be handled. | 3939 // Before the DOM is constructed, the key event can be handled. |
3943 var cacheClearCommand = | 3940 var cacheClearCommand = |
3944 this.document_.querySelector('#drive-clear-local-cache'); | 3941 this.document_.querySelector('#drive-clear-local-cache'); |
3945 if (cacheClearCommand) | 3942 if (cacheClearCommand) |
3946 cacheClearCommand.canExecuteChange(); | 3943 cacheClearCommand.canExecuteChange(); |
3947 }; | 3944 }; |
3948 })(); | 3945 })(); |
OLD | NEW |