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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 #include "extensions/common/manifest_handlers/incognito_info.h" | 59 #include "extensions/common/manifest_handlers/incognito_info.h" |
60 #include "extensions/common/manifest_handlers/offline_enabled_info.h" | 60 #include "extensions/common/manifest_handlers/offline_enabled_info.h" |
61 #include "extensions/common/switches.h" | 61 #include "extensions/common/switches.h" |
62 #include "grit/chromium_strings.h" | 62 #include "grit/chromium_strings.h" |
63 #include "grit/generated_resources.h" | 63 #include "grit/generated_resources.h" |
64 #include "grit/theme_resources.h" | 64 #include "grit/theme_resources.h" |
65 #include "net/base/net_util.h" | 65 #include "net/base/net_util.h" |
66 #include "ui/base/l10n/l10n_util.h" | 66 #include "ui/base/l10n/l10n_util.h" |
67 #include "ui/base/resource/resource_bundle.h" | 67 #include "ui/base/resource/resource_bundle.h" |
68 #include "ui/base/webui/web_ui_util.h" | 68 #include "ui/base/webui/web_ui_util.h" |
69 #include "webkit/browser/fileapi/external_mount_points.h" | |
69 #include "webkit/browser/fileapi/file_system_context.h" | 70 #include "webkit/browser/fileapi/file_system_context.h" |
70 #include "webkit/browser/fileapi/file_system_operation.h" | 71 #include "webkit/browser/fileapi/file_system_operation.h" |
71 #include "webkit/browser/fileapi/file_system_operation_runner.h" | 72 #include "webkit/browser/fileapi/file_system_operation_runner.h" |
72 #include "webkit/common/blob/shareable_file_reference.h" | 73 #include "webkit/common/blob/shareable_file_reference.h" |
73 | 74 |
74 using apps::ShellWindow; | 75 using apps::ShellWindow; |
75 using apps::ShellWindowRegistry; | 76 using apps::ShellWindowRegistry; |
76 using content::RenderViewHost; | 77 using content::RenderViewHost; |
77 | 78 |
78 namespace extensions { | 79 namespace extensions { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 126 |
126 return GetImageURLFromData(contents); | 127 return GetImageURLFromData(contents); |
127 } | 128 } |
128 | 129 |
129 bool ValidateFolderName(const base::FilePath::StringType& name) { | 130 bool ValidateFolderName(const base::FilePath::StringType& name) { |
130 base::FilePath::StringType name_sanitized(name); | 131 base::FilePath::StringType name_sanitized(name); |
131 file_util::ReplaceIllegalCharactersInPath(&name_sanitized, '_'); | 132 file_util::ReplaceIllegalCharactersInPath(&name_sanitized, '_'); |
132 return name == name_sanitized; | 133 return name == name_sanitized; |
133 } | 134 } |
134 | 135 |
135 const Extension* GetExtensionByPath(const extensions::ExtensionSet* extensions, | |
136 const base::FilePath& path) { | |
137 base::FilePath extension_path = base::MakeAbsoluteFilePath(path); | |
138 for (extensions::ExtensionSet::const_iterator iter = extensions->begin(); | |
139 iter != extensions->end(); ++iter) { | |
140 if ((*iter)->path() == extension_path) | |
141 return iter->get(); | |
142 } | |
143 return NULL; | |
144 } | |
145 | |
146 std::string GetExtensionID(const RenderViewHost* render_view_host) { | 136 std::string GetExtensionID(const RenderViewHost* render_view_host) { |
147 if (!render_view_host->GetSiteInstance()) | 137 if (!render_view_host->GetSiteInstance()) |
148 return std::string(); | 138 return std::string(); |
149 | 139 |
150 return render_view_host->GetSiteInstance()->GetSiteURL().host(); | 140 return render_view_host->GetSiteInstance()->GetSiteURL().host(); |
151 } | 141 } |
152 | 142 |
153 } // namespace | 143 } // namespace |
154 | 144 |
155 namespace AllowFileAccess = api::developer_private::AllowFileAccess; | 145 namespace AllowFileAccess = api::developer_private::AllowFileAccess; |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
954 } | 944 } |
955 | 945 |
956 DeveloperPrivatePackDirectoryFunction::DeveloperPrivatePackDirectoryFunction() | 946 DeveloperPrivatePackDirectoryFunction::DeveloperPrivatePackDirectoryFunction() |
957 {} | 947 {} |
958 | 948 |
959 DeveloperPrivatePackDirectoryFunction::~DeveloperPrivatePackDirectoryFunction() | 949 DeveloperPrivatePackDirectoryFunction::~DeveloperPrivatePackDirectoryFunction() |
960 {} | 950 {} |
961 | 951 |
962 DeveloperPrivateLoadUnpackedFunction::~DeveloperPrivateLoadUnpackedFunction() {} | 952 DeveloperPrivateLoadUnpackedFunction::~DeveloperPrivateLoadUnpackedFunction() {} |
963 | 953 |
964 bool DeveloperPrivateExportSyncfsFolderToLocalfsFunction::RunImpl() { | 954 bool DeveloperPrivateLoadDirectoryFunction::RunImpl() { |
965 // TODO(grv) : add unittests. | 955 // TODO(grv) : add unittests. |
966 base::FilePath::StringType project_name; | 956 std::string directory_url_str; |
967 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); | 957 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &directory_url_str)); |
968 if (!ValidateFolderName(project_name)) { | 958 size_t pos = 0; |
969 DVLOG(0) << "Invalid project_name : [" << project_name << "]"; | 959 |
970 return false; | 960 std::string syncfs_url_prefix = "filesystem:chrome-extension://" |
961 + GetExtensionID(render_view_host()) + "/external/syncfs"; | |
962 | |
963 bool is_syncfs_url = (directory_url_str.find(syncfs_url_prefix) | |
964 != std::string::npos); | |
965 | |
966 if (is_syncfs_url) { | |
kinuko
2014/01/16 04:42:24
A preferred way to check this is get FileSystemURL
| |
967 | |
968 base::FilePath::StringType project_name; | |
969 // Parse the project directory name from the project url. The project url is | |
970 // expected to have project name as the suffix. | |
971 if ((pos = directory_url_str.rfind("/")) == std::string::npos) { | |
972 SetError("Invalid Directory entry."); | |
973 return false; | |
974 } | |
975 | |
976 project_name = directory_url_str.substr(pos + 1); | |
977 project_base_url_ = directory_url_str.substr(0, pos + 1); | |
978 | |
979 if (!ValidateFolderName(project_name)) { | |
980 DVLOG(0) << "Invalid project_name : [" << project_name << "]"; | |
981 return false; | |
982 } | |
983 | |
984 context_ = content::BrowserContext::GetStoragePartition( | |
985 GetProfile(), render_view_host()->GetSiteInstance()) | |
986 ->GetFileSystemContext(); | |
987 | |
988 base::FilePath project_path(GetProfile()->GetPath()); | |
989 project_path = project_path.Append(kUnpackedAppsFolder); | |
990 project_path = project_path.Append(project_name); | |
991 | |
992 path_ = project_path; | |
993 | |
994 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, | |
995 base::Bind(&DeveloperPrivateLoadDirectoryFunction:: | |
996 ClearExistingDirectoryContent, | |
997 this, | |
998 path_)); | |
999 } else { | |
1000 | |
1001 base::FilePath::StringType path_str(directory_url_str); | |
1002 path_ = path_.Append(path_str); | |
1003 Load(); | |
971 } | 1004 } |
972 | 1005 |
973 context_ = content::BrowserContext::GetStoragePartition( | |
974 GetProfile(), render_view_host()->GetSiteInstance()) | |
975 ->GetFileSystemContext(); | |
976 | |
977 base::FilePath project_path(GetProfile()->GetPath()); | |
978 project_path = project_path.Append(kUnpackedAppsFolder); | |
979 project_path = project_path.Append(project_name); | |
980 | |
981 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, | |
982 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | |
983 ClearPrexistingDirectoryContent, | |
984 this, | |
985 project_path)); | |
986 | |
987 return true; | 1006 return true; |
988 } | 1007 } |
989 | 1008 |
990 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1009 void DeveloperPrivateLoadDirectoryFunction::Load() { |
991 ClearPrexistingDirectoryContent(const base::FilePath& project_path) { | 1010 |
1011 ExtensionService* service = GetProfile()->GetExtensionService(); | |
1012 UnpackedInstaller::Create(service)->Load(path_); | |
1013 | |
1014 // TODO(grv) : The unpacked installer should fire an event when complete | |
1015 // and return the extension_id. | |
1016 SetResult(new base::StringValue("-1")); | |
1017 SendResponse(true); | |
1018 } | |
1019 | |
1020 void DeveloperPrivateLoadDirectoryFunction::ClearExistingDirectoryContent( | |
1021 const base::FilePath& project_path) { | |
992 | 1022 |
993 // Clear the project directory before copying new files. | 1023 // Clear the project directory before copying new files. |
994 base::DeleteFile(project_path, true/*recursive*/); | 1024 base::DeleteFile(project_path, true/*recursive*/); |
995 | 1025 |
996 pendingCopyOperationsCount_ = 1; | 1026 pending_copy_operations_count_ = 1; |
997 | 1027 |
998 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, | 1028 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, |
999 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1029 base::Bind(&DeveloperPrivateLoadDirectoryFunction:: |
1000 ReadSyncFileSystemDirectory, | 1030 ReadSyncFileSystemDirectory, |
1001 this, project_path, project_path.BaseName())); | 1031 this, project_path, project_path.BaseName())); |
1002 } | 1032 } |
1003 | 1033 |
1004 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1034 void DeveloperPrivateLoadDirectoryFunction::ReadSyncFileSystemDirectory( |
1005 ReadSyncFileSystemDirectory(const base::FilePath& project_path, | 1035 const base::FilePath& project_path, |
1006 const base::FilePath& destination_path) { | 1036 const base::FilePath& destination_path) { |
1007 std::string origin_url( | 1037 |
1008 Extension::GetBaseURLFromExtensionId(extension_id()).spec()); | 1038 project_path_ = context_->CrackURL(GURL(project_base_url_)).path(); |
1009 fileapi::FileSystemURL url(sync_file_system::CreateSyncableFileSystemURL( | 1039 |
1010 GURL(origin_url), | 1040 GURL project_url = GURL(project_base_url_ + destination_path.MaybeAsASCII()); |
1011 destination_path)); | 1041 |
1042 fileapi::FileSystemURL url = context_->CrackURL(project_url); | |
1012 | 1043 |
1013 context_->operation_runner()->ReadDirectory( | 1044 context_->operation_runner()->ReadDirectory( |
1014 url, base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1045 url, base::Bind(&DeveloperPrivateLoadDirectoryFunction:: |
1015 ReadSyncFileSystemDirectoryCb, | 1046 ReadSyncFileSystemDirectoryCb, |
1016 this, project_path, destination_path)); | 1047 this, project_path, destination_path)); |
1017 } | 1048 } |
1018 | 1049 |
1019 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1050 void DeveloperPrivateLoadDirectoryFunction::ReadSyncFileSystemDirectoryCb( |
1020 ReadSyncFileSystemDirectoryCb( | |
1021 const base::FilePath& project_path, | 1051 const base::FilePath& project_path, |
1022 const base::FilePath& destination_path, | 1052 const base::FilePath& destination_path, |
1023 base::PlatformFileError status, | 1053 base::PlatformFileError status, |
1024 const fileapi::FileSystemOperation::FileEntryList& file_list, | 1054 const fileapi::FileSystemOperation::FileEntryList& file_list, |
1025 bool has_more) { | 1055 bool has_more) { |
1026 | 1056 |
1027 if (status != base::PLATFORM_FILE_OK) { | 1057 if (status != base::PLATFORM_FILE_OK) { |
1028 DLOG(ERROR) << "Error in copying files from sync filesystem."; | 1058 DLOG(ERROR) << "Error in copying files from sync filesystem."; |
1029 return; | 1059 return; |
1030 } | 1060 } |
1031 | 1061 |
1032 // We add 1 to the pending copy operations for both files and directories. We | 1062 // We add 1 to the pending copy operations for both files and directories. We |
1033 // release the directory copy operation once all the files under the directory | 1063 // release the directory copy operation once all the files under the directory |
1034 // are added for copying. We do that to ensure that pendingCopyOperationsCount | 1064 // are added for copying. We do that to ensure that pendingCopyOperationsCount |
1035 // does not become zero before all copy operations are finished. | 1065 // does not become zero before all copy operations are finished. |
1036 // In case the directory happens to be executing the last copy operation it | 1066 // In case the directory happens to be executing the last copy operation it |
1037 // will call SendResponse to send the response to the API. The pending copy | 1067 // will call SendResponse to send the response to the API. The pending copy |
1038 // operations of files are released by the CopyFile function. | 1068 // operations of files are released by the CopyFile function. |
1039 pendingCopyOperationsCount_ += file_list.size(); | 1069 pending_copy_operations_count_ += file_list.size(); |
1040 | 1070 |
1041 for (size_t i = 0; i < file_list.size(); ++i) { | 1071 for (size_t i = 0; i < file_list.size(); ++i) { |
1042 if (file_list[i].is_directory) { | 1072 if (file_list[i].is_directory) { |
1043 ReadSyncFileSystemDirectory(project_path.Append(file_list[i].name), | 1073 ReadSyncFileSystemDirectory(project_path.Append(file_list[i].name), |
1044 destination_path.Append(file_list[i].name)); | 1074 destination_path.Append(file_list[i].name)); |
1045 continue; | 1075 continue; |
1046 } | 1076 } |
1047 | 1077 |
1048 std::string origin_url( | 1078 std::string origin_url( |
1049 Extension::GetBaseURLFromExtensionId(extension_id()).spec()); | 1079 Extension::GetBaseURLFromExtensionId(extension_id()).spec()); |
1050 fileapi::FileSystemURL url(sync_file_system::CreateSyncableFileSystemURL( | 1080 fileapi::FileSystemURL url(sync_file_system::CreateSyncableFileSystemURL( |
1051 GURL(origin_url), | 1081 GURL(origin_url), |
1052 destination_path.Append(file_list[i].name))); | 1082 project_path_.Append(destination_path.Append(file_list[i].name)))); |
1053 base::FilePath target_path = project_path; | 1083 base::FilePath target_path = project_path; |
1054 target_path = target_path.Append(file_list[i].name); | 1084 target_path = target_path.Append(file_list[i].name); |
1055 | 1085 |
1056 context_->operation_runner()->CreateSnapshotFile( | 1086 context_->operation_runner()->CreateSnapshotFile( |
1057 url, | 1087 url, |
1058 base::Bind( | 1088 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback, |
1059 &DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | |
1060 SnapshotFileCallback, | |
1061 this, | 1089 this, |
1062 target_path)); | 1090 target_path)); |
1063 | 1091 |
1064 } | 1092 } |
1065 | 1093 |
1066 // Directory copy operation released here. | 1094 // Directory copy operation released here. |
1067 pendingCopyOperationsCount_--; | 1095 pending_copy_operations_count_--; |
1068 | 1096 |
1069 if (!pendingCopyOperationsCount_) { | 1097 if (!pending_copy_operations_count_) { |
1070 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 1098 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
1071 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1099 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SendResponse, |
1072 SendResponse, | |
1073 this, | 1100 this, |
1074 success_)); | 1101 success_)); |
1075 } | 1102 } |
1076 } | 1103 } |
1077 | 1104 |
1078 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::SnapshotFileCallback( | 1105 void DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback( |
1079 const base::FilePath& target_path, | 1106 const base::FilePath& target_path, |
1080 base::PlatformFileError result, | 1107 base::PlatformFileError result, |
1081 const base::PlatformFileInfo& file_info, | 1108 const base::PlatformFileInfo& file_info, |
1082 const base::FilePath& src_path, | 1109 const base::FilePath& src_path, |
1083 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { | 1110 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { |
1084 if (result != base::PLATFORM_FILE_OK) { | 1111 if (result != base::PLATFORM_FILE_OK) { |
1085 SetError("Error in copying files from sync filesystem."); | 1112 SetError("Error in copying files from sync filesystem."); |
1086 success_ = false; | 1113 success_ = false; |
1087 return; | 1114 return; |
1088 } | 1115 } |
1089 | 1116 |
1090 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, | 1117 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, |
1091 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction::CopyFile, | 1118 base::Bind(&DeveloperPrivateLoadDirectoryFunction::CopyFile, |
1092 this, | 1119 this, |
1093 src_path, | 1120 src_path, |
1094 target_path)); | 1121 target_path)); |
1095 } | 1122 } |
1096 | 1123 |
1097 void DeveloperPrivateExportSyncfsFolderToLocalfsFunction::CopyFile( | 1124 void DeveloperPrivateLoadDirectoryFunction::CopyFile( |
1098 const base::FilePath& src_path, | 1125 const base::FilePath& src_path, |
1099 const base::FilePath& target_path) { | 1126 const base::FilePath& target_path) { |
1100 if (!base::CreateDirectory(target_path.DirName())) { | 1127 if (!base::CreateDirectory(target_path.DirName())) { |
1101 SetError("Error in copying files from sync filesystem."); | 1128 SetError("Error in copying files from sync filesystem."); |
1102 success_ = false; | 1129 success_ = false; |
1103 } | 1130 } |
1104 | 1131 |
1105 if (success_) | 1132 if (success_) |
1106 base::CopyFile(src_path, target_path); | 1133 base::CopyFile(src_path, target_path); |
1107 | 1134 |
1108 CHECK(pendingCopyOperationsCount_ > 0); | 1135 CHECK(pending_copy_operations_count_ > 0); |
1109 pendingCopyOperationsCount_--; | 1136 pending_copy_operations_count_--; |
1110 | 1137 |
1111 if (!pendingCopyOperationsCount_) { | 1138 if (!pending_copy_operations_count_) { |
1112 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 1139 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
1113 base::Bind(&DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1140 base::Bind(&DeveloperPrivateLoadDirectoryFunction::Load, |
1114 SendResponse, | 1141 this)); |
1115 this, | |
1116 success_)); | |
1117 } | 1142 } |
1118 } | 1143 } |
1119 | 1144 |
1120 DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1145 DeveloperPrivateLoadDirectoryFunction::DeveloperPrivateLoadDirectoryFunction() |
1121 DeveloperPrivateExportSyncfsFolderToLocalfsFunction() | 1146 : pending_copy_operations_count_(0), success_(true) {} |
1122 : pendingCopyOperationsCount_(0), success_(true) {} | |
1123 | 1147 |
1124 DeveloperPrivateExportSyncfsFolderToLocalfsFunction:: | 1148 DeveloperPrivateLoadDirectoryFunction::~DeveloperPrivateLoadDirectoryFunction() |
1125 ~DeveloperPrivateExportSyncfsFolderToLocalfsFunction() {} | 1149 {} |
1126 | |
1127 bool DeveloperPrivateLoadProjectFunction::RunImpl() { | |
1128 // TODO(grv) : add unit tests. | |
1129 base::FilePath::StringType project_name; | |
1130 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &project_name)); | |
1131 if (!ValidateFolderName(project_name)) { | |
1132 DVLOG(0) << "Invalid project_name : [" << project_name << "]"; | |
1133 return false; | |
1134 } | |
1135 | |
1136 base::FilePath path(GetProfile()->GetPath()); | |
1137 path = path.Append(kUnpackedAppsFolder); | |
1138 // TODO(grv) : Sanitize / check project_name. | |
1139 path = path.Append(project_name); | |
1140 ExtensionService* service = GetProfile()->GetExtensionService(); | |
1141 UnpackedInstaller::Create(service)->Load(path); | |
1142 | |
1143 const extensions::ExtensionSet* extensions = service->extensions(); | |
1144 // Released by GetUnpackedExtension. | |
1145 AddRef(); | |
1146 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE, | |
1147 base::Bind(&DeveloperPrivateLoadProjectFunction::GetUnpackedExtension, | |
1148 this, path, extensions)); | |
1149 return true; | |
1150 } | |
1151 | |
1152 void DeveloperPrivateLoadProjectFunction::GetUnpackedExtension( | |
1153 const base::FilePath& path, | |
1154 const extensions::ExtensionSet* extensions) { | |
1155 const Extension* extension = GetExtensionByPath(extensions, path); | |
1156 bool success = true; | |
1157 if (extension) { | |
1158 SetResult(new base::StringValue(extension->id())); | |
1159 } else { | |
1160 SetError("unable to load the project"); | |
1161 success = false; | |
1162 } | |
1163 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | |
1164 base::Bind(&DeveloperPrivateLoadProjectFunction::SendResponse, | |
1165 this, | |
1166 success)); | |
1167 Release(); | |
1168 } | |
1169 | |
1170 DeveloperPrivateLoadProjectFunction::DeveloperPrivateLoadProjectFunction() {} | |
1171 | |
1172 DeveloperPrivateLoadProjectFunction::~DeveloperPrivateLoadProjectFunction() {} | |
1173 | 1150 |
1174 bool DeveloperPrivateChoosePathFunction::RunImpl() { | 1151 bool DeveloperPrivateChoosePathFunction::RunImpl() { |
1175 | 1152 |
1176 scoped_ptr<developer::ChoosePath::Params> params( | 1153 scoped_ptr<developer::ChoosePath::Params> params( |
1177 developer::ChoosePath::Params::Create(*args_)); | 1154 developer::ChoosePath::Params::Create(*args_)); |
1178 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); | 1155 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); |
1179 | 1156 |
1180 ui::SelectFileDialog::Type type = ui::SelectFileDialog::SELECT_FOLDER; | 1157 ui::SelectFileDialog::Type type = ui::SelectFileDialog::SELECT_FOLDER; |
1181 ui::SelectFileDialog::FileTypeInfo info; | 1158 ui::SelectFileDialog::FileTypeInfo info; |
1182 if (params->select_type == developer::SELECT_TYPE_FILE) { | 1159 if (params->select_type == developer::SELECT_TYPE_FILE) { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1345 return true; | 1322 return true; |
1346 } | 1323 } |
1347 | 1324 |
1348 DeveloperPrivateIsProfileManagedFunction:: | 1325 DeveloperPrivateIsProfileManagedFunction:: |
1349 ~DeveloperPrivateIsProfileManagedFunction() { | 1326 ~DeveloperPrivateIsProfileManagedFunction() { |
1350 } | 1327 } |
1351 | 1328 |
1352 } // namespace api | 1329 } // namespace api |
1353 | 1330 |
1354 } // namespace extensions | 1331 } // namespace extensions |
OLD | NEW |