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_handler_util.h" | 5 #include "chrome/browser/chromeos/extensions/file_handler_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 void ExecuteDoneOnUIThread(bool success); | 389 void ExecuteDoneOnUIThread(bool success); |
390 void ExecuteFileActionsOnUIThread(const std::string& file_system_name, | 390 void ExecuteFileActionsOnUIThread(const std::string& file_system_name, |
391 const GURL& file_system_root, | 391 const GURL& file_system_root, |
392 const FileDefinitionList& file_list, | 392 const FileDefinitionList& file_list, |
393 int handler_pid); | 393 int handler_pid); |
394 void SetupPermissionsAndDispatchEvent(const std::string& file_system_name, | 394 void SetupPermissionsAndDispatchEvent(const std::string& file_system_name, |
395 const GURL& file_system_root, | 395 const GURL& file_system_root, |
396 const FileDefinitionList& file_list, | 396 const FileDefinitionList& file_list, |
397 int handler_pid_in, | 397 int handler_pid_in, |
398 ExtensionHost* host); | 398 extensions::ExtensionHost* host); |
399 | 399 |
400 // Populates |handler_host_permissions| with file path-permissions pairs that | 400 // Populates |handler_host_permissions| with file path-permissions pairs that |
401 // will be given to the handler extension host process. | 401 // will be given to the handler extension host process. |
402 void InitHandlerHostFileAccessPermissions( | 402 void InitHandlerHostFileAccessPermissions( |
403 const FileDefinitionList& file_list, | 403 const FileDefinitionList& file_list, |
404 const extensions::Extension* handler_extension, | 404 const extensions::Extension* handler_extension, |
405 const std::string& action_id, | 405 const std::string& action_id, |
406 const base::Closure& callback); | 406 const base::Closure& callback); |
407 | 407 |
408 // Invoked upon completion of InitHandlerHostFileAccessPermissions initiated | 408 // Invoked upon completion of InitHandlerHostFileAccessPermissions initiated |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 this, file_system_name, file_system_root, file_list, | 788 this, file_system_name, file_system_root, file_list, |
789 handler_pid)); | 789 handler_pid)); |
790 } | 790 } |
791 } | 791 } |
792 | 792 |
793 void ExtensionTaskExecutor::SetupPermissionsAndDispatchEvent( | 793 void ExtensionTaskExecutor::SetupPermissionsAndDispatchEvent( |
794 const std::string& file_system_name, | 794 const std::string& file_system_name, |
795 const GURL& file_system_root, | 795 const GURL& file_system_root, |
796 const FileDefinitionList& file_list, | 796 const FileDefinitionList& file_list, |
797 int handler_pid_in, | 797 int handler_pid_in, |
798 ExtensionHost* host) { | 798 extensions::ExtensionHost* host) { |
799 int handler_pid = host ? host->render_process_host()->GetID() : | 799 int handler_pid = host ? host->render_process_host()->GetID() : |
800 handler_pid_in; | 800 handler_pid_in; |
801 | 801 |
802 if (handler_pid <= 0) { | 802 if (handler_pid <= 0) { |
803 ExecuteDoneOnUIThread(false); | 803 ExecuteDoneOnUIThread(false); |
804 return; | 804 return; |
805 } | 805 } |
806 | 806 |
807 extensions::EventRouter* event_router = profile()->GetExtensionEventRouter(); | 807 extensions::EventRouter* event_router = profile()->GetExtensionEventRouter(); |
808 if (!event_router) { | 808 if (!event_router) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 handler_host_permissions_[i].first, | 891 handler_host_permissions_[i].first, |
892 handler_host_permissions_[i].second); | 892 handler_host_permissions_[i].second); |
893 } | 893 } |
894 | 894 |
895 // We don't need this anymore. | 895 // We don't need this anymore. |
896 handler_host_permissions_.clear(); | 896 handler_host_permissions_.clear(); |
897 } | 897 } |
898 | 898 |
899 } // namespace file_handler_util | 899 } // namespace file_handler_util |
900 | 900 |
OLD | NEW |