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

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

Issue 8538009: Cleaning up and updating mock_chrome.js (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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/metadata_provider.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** 5 /**
6 * Mock out the chrome.fileBrowserPrivate API for use in the harness. 6 * Mock out the chrome.fileBrowserPrivate API for use in the harness.
7 */ 7 */
8 chrome.fileBrowserPrivate = { 8 chrome.fileBrowserPrivate = {
9 9
10 /** 10 /**
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 /** 46 /**
47 * Cancel the dialog without selecting anything. 47 * Cancel the dialog without selecting anything.
48 */ 48 */
49 cancelDialog: function() { 49 cancelDialog: function() {
50 console.log('cancelDialog called'); 50 console.log('cancelDialog called');
51 }, 51 },
52 52
53 /** 53 /**
54 * Disk mount/unmount notification. 54 * Disk mount/unmount notification.
55 */ 55 */
56 onDiskChanged: {
57 callbacks: [],
58 addListener: function(cb) { this.callbacks.push(cb) }
59 },
60
61 onMountCompleted: { 56 onMountCompleted: {
62 callbacks: [], 57 callbacks: [],
63 addListener: function(cb) { this.callbacks.push(cb) } 58 addListener: function(cb) { this.callbacks.push(cb) }
64 }, 59 },
65 60
66 /** 61 /**
67 * Returns common tasks for a given list of files. 62 * Returns common tasks for a given list of files.
68 */ 63 */
69 getFileTasks: function(urlList, callback) { 64 getFileTasks: function(urlList, callback) {
70 if (urlList.length == 0) 65 if (urlList.length == 0)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 type: '', 178 type: '',
184 mountPath: mountPoint 179 mountPath: mountPoint
185 } 180 }
186 }; 181 };
187 var listeners = chrome.fileBrowserPrivate.onDiskChanged.listeners_; 182 var listeners = chrome.fileBrowserPrivate.onDiskChanged.listeners_;
188 for (var listener, index = 0; listener = listeners[index]; ++index) { 183 for (var listener, index = 0; listener = listeners[index]; ++index) {
189 listener(event); 184 listener(event);
190 } 185 }
191 }, 186 },
192 187
188 getSizeStats: function() {},
189
193 /** 190 /**
194 * Return localized strings. 191 * Return localized strings.
195 */ 192 */
196 getStrings: function(callback) { 193 getStrings: function(callback) {
197 // Keep this list in sync with the strings in generated_resources.grd and 194 // Keep this list in sync with the strings in generated_resources.grd and
198 // extension_file_browser_private_api.cc! 195 // extension_file_browser_private_api.cc!
199 callback({ 196 callback({
200 // These two are from locale_settings*.grd 197 // These two are from locale_settings*.grd
201 WEB_FONT_FAMILY: 'Chrome Droid Sans,Droid Sans Fallback,sans-serif', 198 WEB_FONT_FAMILY: 'Chrome Droid Sans,Droid Sans Fallback,sans-serif',
202 WEB_FONT_SIZE: '84%', 199 WEB_FONT_SIZE: '84%',
(...skipping 25 matching lines...) Expand all
228 225
229 EJECT_BUTTON: 'Eject', 226 EJECT_BUTTON: 'Eject',
230 IMAGE_DIMENSIONS: 'Image Dimensions', 227 IMAGE_DIMENSIONS: 'Image Dimensions',
231 VOLUME_LABEL: 'Volume Label', 228 VOLUME_LABEL: 'Volume Label',
232 READ_ONLY: 'Read Only', 229 READ_ONLY: 'Read Only',
233 230
234 MOUNT_ARCHIVE: 'Open archive', 231 MOUNT_ARCHIVE: 'Open archive',
235 UNMOUNT_ARCHIVE: 'Close archive', 232 UNMOUNT_ARCHIVE: 'Close archive',
236 FORMAT_DEVICE: 'Format device', 233 FORMAT_DEVICE: 'Format device',
237 234
235 ENABLE_PHOTO_EDITOR: 'true',
238 GALLERY: 'View and Edit', 236 GALLERY: 'View and Edit',
239 GALLERY_EDIT: 'Edit', 237 GALLERY_EDIT: 'Edit',
240 GALLERY_SHARE: 'Share', 238 GALLERY_SHARE: 'Share',
241 GALLERY_AUTOFIX: 'Auto-fix', 239 GALLERY_AUTOFIX: 'Auto-fix',
242 GALLERY_FIXED: 'Fixed', 240 GALLERY_FIXED: 'Fixed',
243 GALLERY_CROP: 'Crop', 241 GALLERY_CROP: 'Crop',
244 GALLERY_EXPOSURE: 'Brightness', 242 GALLERY_EXPOSURE: 'Brightness',
245 GALLERY_BRIGHTNESS: 'Brightness', 243 GALLERY_BRIGHTNESS: 'Brightness',
246 GALLERY_CONTRAST: 'Contrast', 244 GALLERY_CONTRAST: 'Contrast',
247 GALLERY_ROTATE_LEFT: 'Left', 245 GALLERY_ROTATE_LEFT: 'Left',
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 VIDEO_FILE_TYPE: '$1 video file', 343 VIDEO_FILE_TYPE: '$1 video file',
346 AUDIO_FILE_TYPE: '$1 audio file', 344 AUDIO_FILE_TYPE: '$1 audio file',
347 HTML_DOCUMENT_FILE_TYPE: 'HTML document', 345 HTML_DOCUMENT_FILE_TYPE: 'HTML document',
348 ZIP_ARCHIVE_FILE_TYPE: 'Zip archive', 346 ZIP_ARCHIVE_FILE_TYPE: 'Zip archive',
349 PLAIN_TEXT_FILE_TYPE: 'Plain text file', 347 PLAIN_TEXT_FILE_TYPE: 'Plain text file',
350 PDF_DOCUMENT_FILE_TYPE: 'PDF document' 348 PDF_DOCUMENT_FILE_TYPE: 'PDF document'
351 }); 349 });
352 } 350 }
353 }; 351 };
354 352
355 chrome.fileBrowserHandler = {
356 onExecute: {
357 callbacks: [],
358 addListener: function(cb) { this.callbacks.push(cb) }
359 }
360 };
361
362 chrome.extension = { 353 chrome.extension = {
363 getURL: function(path) { 354 getURL: function(path) {
364 return path || document.location.href; 355 return path || document.location.href;
365 } 356 }
366 }; 357 };
367 358
368 chrome.test = { 359 chrome.test = {
369 verbose: false, 360 verbose: false,
370 361
371 sendMessage: function(msg) { 362 sendMessage: function(msg) {
(...skipping 16 matching lines...) Expand all
388 window.open(createOptions.url); 379 window.open(createOptions.url);
389 } 380 }
390 }; 381 };
391 382
392 chrome.experimental = { 383 chrome.experimental = {
393 metrics: { 384 metrics: {
394 recordTime: function() {}, 385 recordTime: function() {},
395 recordUserAction: function() {} 386 recordUserAction: function() {}
396 } 387 }
397 }; 388 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/metadata_provider.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698