| 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 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <utime.h> | 10 #include <utime.h> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/lifetime/application_lifetime.h" | 52 #include "chrome/browser/lifetime/application_lifetime.h" |
| 53 #include "chrome/browser/profiles/profile.h" | 53 #include "chrome/browser/profiles/profile.h" |
| 54 #include "chrome/browser/ui/browser.h" | 54 #include "chrome/browser/ui/browser.h" |
| 55 #include "chrome/browser/ui/browser_window.h" | 55 #include "chrome/browser/ui/browser_window.h" |
| 56 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 56 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 57 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 57 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 58 #include "chrome/common/extensions/api/icons/icons_handler.h" | 58 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 59 #include "chrome/common/extensions/extension.h" | 59 #include "chrome/common/extensions/extension.h" |
| 60 #include "chrome/common/extensions/extension_constants.h" | 60 #include "chrome/common/extensions/extension_constants.h" |
| 61 #include "chrome/common/extensions/extension_icon_set.h" | 61 #include "chrome/common/extensions/extension_icon_set.h" |
| 62 #include "chrome/common/extensions/extension_manifest_constants.h" | |
| 63 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 64 #include "chromeos/disks/disk_mount_manager.h" | 63 #include "chromeos/disks/disk_mount_manager.h" |
| 65 #include "content/public/browser/child_process_security_policy.h" | 64 #include "content/public/browser/child_process_security_policy.h" |
| 66 #include "content/public/browser/render_process_host.h" | 65 #include "content/public/browser/render_process_host.h" |
| 67 #include "content/public/browser/render_view_host.h" | 66 #include "content/public/browser/render_view_host.h" |
| 68 #include "content/public/browser/storage_partition.h" | 67 #include "content/public/browser/storage_partition.h" |
| 69 #include "googleurl/src/gurl.h" | 68 #include "googleurl/src/gurl.h" |
| 70 #include "grit/app_locale_settings.h" | 69 #include "grit/app_locale_settings.h" |
| 71 #include "grit/generated_resources.h" | 70 #include "grit/generated_resources.h" |
| 72 #include "grit/platform_locale_settings.h" | 71 #include "grit/platform_locale_settings.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 556 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 558 // Renderer process id. | 557 // Renderer process id. |
| 559 int child_id_; | 558 int child_id_; |
| 560 // Extension source URL. | 559 // Extension source URL. |
| 561 scoped_refptr<const Extension> extension_; | 560 scoped_refptr<const Extension> extension_; |
| 562 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemCallbackDispatcher); | 561 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemCallbackDispatcher); |
| 563 }; | 562 }; |
| 564 | 563 |
| 565 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) | 564 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) |
| 566 : event_router_(make_scoped_refptr(new FileBrowserEventRouter(profile))) { | 565 : event_router_(make_scoped_refptr(new FileBrowserEventRouter(profile))) { |
| 567 extensions::ManifestHandler::Register( | 566 (new FileBrowserHandlerParser)->Register(); |
| 568 extension_manifest_keys::kFileBrowserHandlers, | |
| 569 make_linked_ptr(new FileBrowserHandlerParser)); | |
| 570 | 567 |
| 571 ExtensionFunctionRegistry* registry = | 568 ExtensionFunctionRegistry* registry = |
| 572 ExtensionFunctionRegistry::GetInstance(); | 569 ExtensionFunctionRegistry::GetInstance(); |
| 573 registry->RegisterFunction<LogoutUserFunction>(); | 570 registry->RegisterFunction<LogoutUserFunction>(); |
| 574 registry->RegisterFunction<CancelFileDialogFunction>(); | 571 registry->RegisterFunction<CancelFileDialogFunction>(); |
| 575 registry->RegisterFunction<ExecuteTasksFileBrowserFunction>(); | 572 registry->RegisterFunction<ExecuteTasksFileBrowserFunction>(); |
| 576 registry->RegisterFunction<SetDefaultTaskFileBrowserFunction>(); | 573 registry->RegisterFunction<SetDefaultTaskFileBrowserFunction>(); |
| 577 registry->RegisterFunction<FileDialogStringsFunction>(); | 574 registry->RegisterFunction<FileDialogStringsFunction>(); |
| 578 registry->RegisterFunction<GetFileTasksFileBrowserFunction>(); | 575 registry->RegisterFunction<GetFileTasksFileBrowserFunction>(); |
| 579 registry->RegisterFunction<GetVolumeMetadataFunction>(); | 576 registry->RegisterFunction<GetVolumeMetadataFunction>(); |
| (...skipping 2656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3236 this, name.size())); | 3233 this, name.size())); |
| 3237 return true; | 3234 return true; |
| 3238 } | 3235 } |
| 3239 | 3236 |
| 3240 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( | 3237 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( |
| 3241 size_t current_length, | 3238 size_t current_length, |
| 3242 size_t max_length) { | 3239 size_t max_length) { |
| 3243 SetResult(new base::FundamentalValue(current_length <= max_length)); | 3240 SetResult(new base::FundamentalValue(current_length <= max_length)); |
| 3244 SendResponse(true); | 3241 SendResponse(true); |
| 3245 } | 3242 } |
| OLD | NEW |