| 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/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
| 9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
| 10 #include "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/devtools/devtools_window.h" | 21 #include "chrome/browser/devtools/devtools_window.h" |
| 22 #include "chrome/browser/extensions/api/developer_private/developer_private_api_
factory.h" | 22 #include "chrome/browser/extensions/api/developer_private/developer_private_api_
factory.h" |
| 23 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" | 23 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" |
| 24 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 24 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 25 #include "chrome/browser/extensions/devtools_util.h" | 25 #include "chrome/browser/extensions/devtools_util.h" |
| 26 #include "chrome/browser/extensions/extension_disabled_ui.h" | 26 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 27 #include "chrome/browser/extensions/extension_error_reporter.h" | 27 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 28 #include "chrome/browser/extensions/extension_service.h" | 28 #include "chrome/browser/extensions/extension_service.h" |
| 29 #include "chrome/browser/extensions/extension_system.h" | 29 #include "chrome/browser/extensions/extension_system.h" |
| 30 #include "chrome/browser/extensions/extension_util.h" | 30 #include "chrome/browser/extensions/extension_util.h" |
| 31 #include "chrome/browser/extensions/management_policy.h" | |
| 32 #include "chrome/browser/extensions/unpacked_installer.h" | 31 #include "chrome/browser/extensions/unpacked_installer.h" |
| 33 #include "chrome/browser/extensions/updater/extension_updater.h" | 32 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 34 #include "chrome/browser/platform_util.h" | 33 #include "chrome/browser/platform_util.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_servi
ce.h" | 35 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_servi
ce.h" |
| 37 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 36 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
| 38 #include "chrome/browser/ui/chrome_select_file_policy.h" | 37 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 39 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 40 #include "chrome/common/extensions/api/developer_private.h" | 39 #include "chrome/common/extensions/api/developer_private.h" |
| 41 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 40 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 42 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 41 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 43 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" | 42 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h" |
| 44 #include "chrome/common/extensions/manifest_url_handler.h" | 43 #include "chrome/common/extensions/manifest_url_handler.h" |
| 45 #include "chrome/common/url_constants.h" | 44 #include "chrome/common/url_constants.h" |
| 46 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 47 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/render_process_host.h" | 47 #include "content/public/browser/render_process_host.h" |
| 49 #include "content/public/browser/render_view_host.h" | 48 #include "content/public/browser/render_view_host.h" |
| 50 #include "content/public/browser/site_instance.h" | 49 #include "content/public/browser/site_instance.h" |
| 51 #include "content/public/browser/storage_partition.h" | 50 #include "content/public/browser/storage_partition.h" |
| 52 #include "content/public/browser/web_contents.h" | 51 #include "content/public/browser/web_contents.h" |
| 52 #include "extensions/browser/management_policy.h" |
| 53 #include "extensions/browser/view_type_utils.h" | 53 #include "extensions/browser/view_type_utils.h" |
| 54 #include "extensions/common/constants.h" | 54 #include "extensions/common/constants.h" |
| 55 #include "extensions/common/extension_resource.h" | 55 #include "extensions/common/extension_resource.h" |
| 56 #include "extensions/common/install_warning.h" | 56 #include "extensions/common/install_warning.h" |
| 57 #include "extensions/common/manifest_handlers/background_info.h" | 57 #include "extensions/common/manifest_handlers/background_info.h" |
| 58 #include "extensions/common/manifest_handlers/incognito_info.h" | 58 #include "extensions/common/manifest_handlers/incognito_info.h" |
| 59 #include "extensions/common/switches.h" | 59 #include "extensions/common/switches.h" |
| 60 #include "grit/chromium_strings.h" | 60 #include "grit/chromium_strings.h" |
| 61 #include "grit/generated_resources.h" | 61 #include "grit/generated_resources.h" |
| 62 #include "grit/theme_resources.h" | 62 #include "grit/theme_resources.h" |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 DeveloperPrivatePackDirectoryFunction::~DeveloperPrivatePackDirectoryFunction() | 955 DeveloperPrivatePackDirectoryFunction::~DeveloperPrivatePackDirectoryFunction() |
| 956 {} | 956 {} |
| 957 | 957 |
| 958 DeveloperPrivateLoadUnpackedFunction::~DeveloperPrivateLoadUnpackedFunction() {} | 958 DeveloperPrivateLoadUnpackedFunction::~DeveloperPrivateLoadUnpackedFunction() {} |
| 959 | 959 |
| 960 bool DeveloperPrivateExportSyncfsFolderToLocalfsFunction::RunImpl() { | 960 bool DeveloperPrivateExportSyncfsFolderToLocalfsFunction::RunImpl() { |
| 961 // TODO(grv) : add unittests. | 961 // TODO(grv) : add unittests. |
| 962 base::FilePath::StringType project_name; | 962 base::FilePath::StringType project_name; |
| 963 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); | 963 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); |
| 964 if (!ValidateFolderName(project_name)) { | 964 if (!ValidateFolderName(project_name)) { |
| 965 DLOG(INFO) << "Invalid project_name : [" << project_name << "]"; | 965 DVLOG(0) << "Invalid project_name : [" << project_name << "]"; |
| 966 return false; | 966 return false; |
| 967 } | 967 } |
| 968 | 968 |
| 969 context_ = content::BrowserContext::GetStoragePartition( | 969 context_ = content::BrowserContext::GetStoragePartition( |
| 970 GetProfile(), render_view_host()->GetSiteInstance()) | 970 GetProfile(), render_view_host()->GetSiteInstance()) |
| 971 ->GetFileSystemContext(); | 971 ->GetFileSystemContext(); |
| 972 | 972 |
| 973 base::FilePath project_path(GetProfile()->GetPath()); | 973 base::FilePath project_path(GetProfile()->GetPath()); |
| 974 project_path = project_path.Append(kUnpackedAppsFolder); | 974 project_path = project_path.Append(kUnpackedAppsFolder); |
| 975 project_path = project_path.Append(project_name); | 975 project_path = project_path.Append(project_name); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 : pendingCopyOperationsCount_(0), success_(true) {} | 1118 : pendingCopyOperationsCount_(0), success_(true) {} |
| 1119 | 1119 |
| 1120 DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1120 DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: |
| 1121 ~DeveloperPrivateExportSyncfsFolderToLocalfsFunction() {} | 1121 ~DeveloperPrivateExportSyncfsFolderToLocalfsFunction() {} |
| 1122 | 1122 |
| 1123 bool DeveloperPrivateLoadProjectFunction::RunImpl() { | 1123 bool DeveloperPrivateLoadProjectFunction::RunImpl() { |
| 1124 // TODO(grv) : add unit tests. | 1124 // TODO(grv) : add unit tests. |
| 1125 base::FilePath::StringType project_name; | 1125 base::FilePath::StringType project_name; |
| 1126 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); | 1126 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); |
| 1127 if (!ValidateFolderName(project_name)) { | 1127 if (!ValidateFolderName(project_name)) { |
| 1128 DLOG(INFO) << "Invalid project_name : [" << project_name << "]"; | 1128 DVLOG(0) << "Invalid project_name : [" << project_name << "]"; |
| 1129 return false; | 1129 return false; |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 base::FilePath path(GetProfile()->GetPath()); | 1132 base::FilePath path(GetProfile()->GetPath()); |
| 1133 path = path.Append(kUnpackedAppsFolder); | 1133 path = path.Append(kUnpackedAppsFolder); |
| 1134 // TODO(grv) : Sanitize / check project_name. | 1134 // TODO(grv) : Sanitize / check project_name. |
| 1135 path = path.Append(project_name); | 1135 path = path.Append(project_name); |
| 1136 ExtensionService* service = GetProfile()->GetExtensionService(); | 1136 ExtensionService* service = GetProfile()->GetExtensionService(); |
| 1137 UnpackedInstaller::Create(service)->Load(path); | 1137 UnpackedInstaller::Create(service)->Load(path); |
| 1138 | 1138 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 return true; | 1341 return true; |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 DeveloperPrivateIsProfileManagedFunction:: | 1344 DeveloperPrivateIsProfileManagedFunction:: |
| 1345 ~DeveloperPrivateIsProfileManagedFunction() { | 1345 ~DeveloperPrivateIsProfileManagedFunction() { |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 } // namespace api | 1348 } // namespace api |
| 1349 | 1349 |
| 1350 } // namespace extensions | 1350 } // namespace extensions |
| OLD | NEW |