diff options
Diffstat (limited to 'chrome/renderer')
| -rw-r--r-- | chrome/renderer/extensions/extension_dispatcher.cc | 2 | ||||
| -rw-r--r-- | chrome/renderer/renderer_resources.grd | 1 | ||||
| -rw-r--r-- | chrome/renderer/resources/extensions/file_system_custom_bindings.js | 16 |
3 files changed, 19 insertions, 0 deletions
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc index 838746a..1104566 100644 --- a/chrome/renderer/extensions/extension_dispatcher.cc +++ b/chrome/renderer/extensions/extension_dispatcher.cc @@ -570,6 +570,8 @@ void ExtensionDispatcher::PopulateSourceMap() { IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); source_map_.RegisterSource("fileBrowserPrivate", IDR_FILE_BROWSER_PRIVATE_CUSTOM_BINDINGS_JS); + source_map_.RegisterSource("fileSystem", + IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS); source_map_.RegisterSource("i18n", IDR_I18N_CUSTOM_BINDINGS_JS); source_map_.RegisterSource("experimental.input.ime", IDR_INPUT_IME_CUSTOM_BINDINGS_JS); diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd index 421a70d..475bf8c 100644 --- a/chrome/renderer/renderer_resources.grd +++ b/chrome/renderer/renderer_resources.grd @@ -50,6 +50,7 @@ without changes to the corresponding grd file. fb9 --> <include name="IDR_EXTENSION_CUSTOM_BINDINGS_JS" file="resources\extensions\extension_custom_bindings.js" type="BINDATA" /> <include name="IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS" file="resources\extensions\file_browser_handler_custom_bindings.js" type="BINDATA" /> <include name="IDR_FILE_BROWSER_PRIVATE_CUSTOM_BINDINGS_JS" file="resources\extensions\file_browser_private_custom_bindings.js" type="BINDATA" /> + <include name="IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS" file="resources\extensions\file_system_custom_bindings.js" type="BINDATA" /> <include name="IDR_I18N_CUSTOM_BINDINGS_JS" file="resources\extensions\i18n_custom_bindings.js" type="BINDATA" /> <include name="IDR_INPUT_IME_CUSTOM_BINDINGS_JS" file="resources\extensions\input.ime_custom_bindings.js" type="BINDATA" /> <include name="IDR_MEDIA_GALLERY_CUSTOM_BINDINGS_JS" file="resources\extensions\experimental.media_galleries_custom_bindings.js" type="BINDATA" /> diff --git a/chrome/renderer/resources/extensions/file_system_custom_bindings.js b/chrome/renderer/resources/extensions/file_system_custom_bindings.js new file mode 100644 index 0000000..0e6da3a --- /dev/null +++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Custom bindings for the fileSystem API. + +var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); + +chromeHidden.registerCustomHook('fileSystem', function(bindingsAPI) { + bindingsAPI.apiFunctions.setUpdateArgumentsPostValidate( + 'getDisplayPath', function(fileEntry, callback) { + var fileSystemName = fileEntry.filesystem.name; + var relativePath = fileEntry.fullPath.slice(1); + return [fileSystemName, relativePath, callback]; + }); +}); |
