| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 event_names::kDeveloperPrivateOnItemStateChanged)) | 243 event_names::kDeveloperPrivateOnItemStateChanged)) |
| 244 developer_private_event_router_.reset(NULL); | 244 developer_private_event_router_.reset(NULL); |
| 245 } | 245 } |
| 246 | 246 |
| 247 namespace api { | 247 namespace api { |
| 248 | 248 |
| 249 bool DeveloperPrivateAutoUpdateFunction::RunImpl() { | 249 bool DeveloperPrivateAutoUpdateFunction::RunImpl() { |
| 250 ExtensionUpdater* updater = GetExtensionUpdater(profile()); | 250 ExtensionUpdater* updater = GetExtensionUpdater(profile()); |
| 251 if (updater) | 251 if (updater) |
| 252 updater->CheckNow(ExtensionUpdater::CheckParams()); | 252 updater->CheckNow(ExtensionUpdater::CheckParams()); |
| 253 SetResult(Value::CreateBooleanValue(true)); | 253 SetResult(new base::FundamentalValue(true)); |
| 254 return true; | 254 return true; |
| 255 } | 255 } |
| 256 | 256 |
| 257 DeveloperPrivateAutoUpdateFunction::~DeveloperPrivateAutoUpdateFunction() {} | 257 DeveloperPrivateAutoUpdateFunction::~DeveloperPrivateAutoUpdateFunction() {} |
| 258 | 258 |
| 259 scoped_ptr<developer::ItemInfo> | 259 scoped_ptr<developer::ItemInfo> |
| 260 DeveloperPrivateGetItemsInfoFunction::CreateItemInfo( | 260 DeveloperPrivateGetItemsInfoFunction::CreateItemInfo( |
| 261 const Extension& item, | 261 const Extension& item, |
| 262 bool item_is_enabled) { | 262 bool item_is_enabled) { |
| 263 scoped_ptr<developer::ItemInfo> info(new developer::ItemInfo()); | 263 scoped_ptr<developer::ItemInfo> info(new developer::ItemInfo()); |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 this, path, extensions)); | 1088 this, path, extensions)); |
| 1089 return true; | 1089 return true; |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 void DeveloperPrivateLoadProjectFunction::GetUnpackedExtension( | 1092 void DeveloperPrivateLoadProjectFunction::GetUnpackedExtension( |
| 1093 const base::FilePath& path, | 1093 const base::FilePath& path, |
| 1094 const ExtensionSet* extensions) { | 1094 const ExtensionSet* extensions) { |
| 1095 const Extension* extension = GetExtensionByPath(extensions, path); | 1095 const Extension* extension = GetExtensionByPath(extensions, path); |
| 1096 bool success = true; | 1096 bool success = true; |
| 1097 if (extension) { | 1097 if (extension) { |
| 1098 SetResult(base::Value::CreateStringValue(extension->id())); | 1098 SetResult(new base::StringValue(extension->id())); |
| 1099 } else { | 1099 } else { |
| 1100 SetError("unable to load the project"); | 1100 SetError("unable to load the project"); |
| 1101 success = false; | 1101 success = false; |
| 1102 } | 1102 } |
| 1103 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 1103 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 1104 base::Bind(&DeveloperPrivateLoadProjectFunction::SendResponse, | 1104 base::Bind(&DeveloperPrivateLoadProjectFunction::SendResponse, |
| 1105 this, | 1105 this, |
| 1106 success)); | 1106 success)); |
| 1107 Release(); | 1107 Release(); |
| 1108 } | 1108 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 type, | 1147 type, |
| 1148 DeveloperPrivateAPI::Get(profile())->GetLastUnpackedDirectory(), | 1148 DeveloperPrivateAPI::Get(profile())->GetLastUnpackedDirectory(), |
| 1149 select_title, | 1149 select_title, |
| 1150 info, | 1150 info, |
| 1151 file_type_index); | 1151 file_type_index); |
| 1152 return result; | 1152 return result; |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 void DeveloperPrivateChoosePathFunction::FileSelected( | 1155 void DeveloperPrivateChoosePathFunction::FileSelected( |
| 1156 const base::FilePath& path) { | 1156 const base::FilePath& path) { |
| 1157 SetResult(base::Value::CreateStringValue( | 1157 SetResult(new base::StringValue( |
| 1158 UTF16ToUTF8(path.LossyDisplayName()))); | 1158 UTF16ToUTF8(path.LossyDisplayName()))); |
| 1159 SendResponse(true); | 1159 SendResponse(true); |
| 1160 Release(); | 1160 Release(); |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 void DeveloperPrivateChoosePathFunction::FileSelectionCanceled() { | 1163 void DeveloperPrivateChoosePathFunction::FileSelectionCanceled() { |
| 1164 SendResponse(false); | 1164 SendResponse(false); |
| 1165 Release(); | 1165 Release(); |
| 1166 } | 1166 } |
| 1167 | 1167 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 | 1266 |
| 1267 #undef SET_STRING | 1267 #undef SET_STRING |
| 1268 return true; | 1268 return true; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} | 1271 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} |
| 1272 | 1272 |
| 1273 } // namespace api | 1273 } // namespace api |
| 1274 | 1274 |
| 1275 } // namespace extensions | 1275 } // namespace extensions |
| OLD | NEW |