Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.h

Issue 252653002: Rename (Chrome)SyncExtensionFunction::RunImpl to RunSync so that the RunImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { 143 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction {
144 public: 144 public:
145 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", 145 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate",
146 DEVELOPERPRIVATE_AUTOUPDATE) 146 DEVELOPERPRIVATE_AUTOUPDATE)
147 147
148 protected: 148 protected:
149 virtual ~DeveloperPrivateAutoUpdateFunction(); 149 virtual ~DeveloperPrivateAutoUpdateFunction();
150 150
151 // ExtensionFunction: 151 // ExtensionFunction:
152 virtual bool RunImpl() OVERRIDE; 152 virtual bool RunSync() OVERRIDE;
153 }; 153 };
154 154
155 class DeveloperPrivateGetItemsInfoFunction 155 class DeveloperPrivateGetItemsInfoFunction
156 : public ChromeAsyncExtensionFunction { 156 : public ChromeAsyncExtensionFunction {
157 public: 157 public:
158 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", 158 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo",
159 DEVELOPERPRIVATE_GETITEMSINFO) 159 DEVELOPERPRIVATE_GETITEMSINFO)
160 160
161 protected: 161 protected:
162 virtual ~DeveloperPrivateGetItemsInfoFunction(); 162 virtual ~DeveloperPrivateGetItemsInfoFunction();
163 163
164 // ExtensionFunction: 164 // ExtensionFunction:
165 virtual bool RunImpl() OVERRIDE; 165 virtual bool RunSync() OVERRIDE;
166 166
167 private: 167 private:
168 scoped_ptr<developer::ItemInfo> CreateItemInfo(const Extension& item, 168 scoped_ptr<developer::ItemInfo> CreateItemInfo(const Extension& item,
169 bool item_is_enabled); 169 bool item_is_enabled);
170 170
171 void GetIconsOnFileThread( 171 void GetIconsOnFileThread(
172 ItemInfoList item_list, 172 ItemInfoList item_list,
173 std::map<std::string, ExtensionResource> itemIdToIconResourceMap); 173 std::map<std::string, ExtensionResource> itemIdToIconResourceMap);
174 174
175 // Helper that lists the current inspectable html pages for the extension. 175 // Helper that lists the current inspectable html pages for the extension.
(...skipping 19 matching lines...) Expand all
195 195
196 class DeveloperPrivateInspectFunction : public ChromeSyncExtensionFunction { 196 class DeveloperPrivateInspectFunction : public ChromeSyncExtensionFunction {
197 public: 197 public:
198 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", 198 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect",
199 DEVELOPERPRIVATE_INSPECT) 199 DEVELOPERPRIVATE_INSPECT)
200 200
201 protected: 201 protected:
202 virtual ~DeveloperPrivateInspectFunction(); 202 virtual ~DeveloperPrivateInspectFunction();
203 203
204 // ExtensionFunction: 204 // ExtensionFunction:
205 virtual bool RunImpl() OVERRIDE; 205 virtual bool RunSync() OVERRIDE;
206 }; 206 };
207 207
208 class DeveloperPrivateAllowFileAccessFunction 208 class DeveloperPrivateAllowFileAccessFunction
209 : public ChromeSyncExtensionFunction { 209 : public ChromeSyncExtensionFunction {
210 public: 210 public:
211 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess", 211 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess",
212 DEVELOPERPRIVATE_ALLOWFILEACCESS); 212 DEVELOPERPRIVATE_ALLOWFILEACCESS);
213 213
214 protected: 214 protected:
215 virtual ~DeveloperPrivateAllowFileAccessFunction(); 215 virtual ~DeveloperPrivateAllowFileAccessFunction();
216 216
217 // ExtensionFunction: 217 // ExtensionFunction:
218 virtual bool RunImpl() OVERRIDE; 218 virtual bool RunSync() OVERRIDE;
219 }; 219 };
220 220
221 class DeveloperPrivateAllowIncognitoFunction 221 class DeveloperPrivateAllowIncognitoFunction
222 : public ChromeSyncExtensionFunction { 222 : public ChromeSyncExtensionFunction {
223 public: 223 public:
224 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito", 224 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito",
225 DEVELOPERPRIVATE_ALLOWINCOGNITO); 225 DEVELOPERPRIVATE_ALLOWINCOGNITO);
226 226
227 protected: 227 protected:
228 virtual ~DeveloperPrivateAllowIncognitoFunction(); 228 virtual ~DeveloperPrivateAllowIncognitoFunction();
229 229
230 // ExtensionFunction: 230 // ExtensionFunction:
231 virtual bool RunImpl() OVERRIDE; 231 virtual bool RunSync() OVERRIDE;
232 }; 232 };
233 233
234 class DeveloperPrivateReloadFunction : public ChromeSyncExtensionFunction { 234 class DeveloperPrivateReloadFunction : public ChromeSyncExtensionFunction {
235 public: 235 public:
236 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload", 236 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload",
237 DEVELOPERPRIVATE_RELOAD); 237 DEVELOPERPRIVATE_RELOAD);
238 238
239 protected: 239 protected:
240 virtual ~DeveloperPrivateReloadFunction(); 240 virtual ~DeveloperPrivateReloadFunction();
241 241
242 // ExtensionFunction: 242 // ExtensionFunction:
243 virtual bool RunImpl() OVERRIDE; 243 virtual bool RunSync() OVERRIDE;
244 }; 244 };
245 245
246 class DeveloperPrivateShowPermissionsDialogFunction 246 class DeveloperPrivateShowPermissionsDialogFunction
247 : public ChromeSyncExtensionFunction, 247 : public ChromeSyncExtensionFunction,
248 public ExtensionInstallPrompt::Delegate { 248 public ExtensionInstallPrompt::Delegate {
249 public: 249 public:
250 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", 250 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog",
251 DEVELOPERPRIVATE_PERMISSIONS); 251 DEVELOPERPRIVATE_PERMISSIONS);
252 252
253 DeveloperPrivateShowPermissionsDialogFunction(); 253 DeveloperPrivateShowPermissionsDialogFunction();
254 protected: 254 protected:
255 virtual ~DeveloperPrivateShowPermissionsDialogFunction(); 255 virtual ~DeveloperPrivateShowPermissionsDialogFunction();
256 256
257 // ExtensionFunction: 257 // ExtensionFunction:
258 virtual bool RunImpl() OVERRIDE; 258 virtual bool RunSync() OVERRIDE;
259 259
260 // Overridden from ExtensionInstallPrompt::Delegate 260 // Overridden from ExtensionInstallPrompt::Delegate
261 virtual void InstallUIProceed() OVERRIDE; 261 virtual void InstallUIProceed() OVERRIDE;
262 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; 262 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
263 263
264 scoped_ptr<ExtensionInstallPrompt> prompt_; 264 scoped_ptr<ExtensionInstallPrompt> prompt_;
265 std::string extension_id_; 265 std::string extension_id_;
266 }; 266 };
267 267
268 class DeveloperPrivateEnableFunction 268 class DeveloperPrivateEnableFunction
269 : public ChromeSyncExtensionFunction, 269 : public ChromeSyncExtensionFunction,
270 public base::SupportsWeakPtr<DeveloperPrivateEnableFunction> { 270 public base::SupportsWeakPtr<DeveloperPrivateEnableFunction> {
271 public: 271 public:
272 DECLARE_EXTENSION_FUNCTION("developerPrivate.enable", 272 DECLARE_EXTENSION_FUNCTION("developerPrivate.enable",
273 DEVELOPERPRIVATE_ENABLE); 273 DEVELOPERPRIVATE_ENABLE);
274 274
275 DeveloperPrivateEnableFunction(); 275 DeveloperPrivateEnableFunction();
276 276
277 protected: 277 protected:
278 virtual ~DeveloperPrivateEnableFunction(); 278 virtual ~DeveloperPrivateEnableFunction();
279 279
280 // Callback for requirements checker. 280 // Callback for requirements checker.
281 void OnRequirementsChecked(std::string extension_id, 281 void OnRequirementsChecked(std::string extension_id,
282 std::vector<std::string> requirements_errors); 282 std::vector<std::string> requirements_errors);
283 // ExtensionFunction: 283 // ExtensionFunction:
284 virtual bool RunImpl() OVERRIDE; 284 virtual bool RunSync() OVERRIDE;
285 285
286 private: 286 private:
287 scoped_ptr<RequirementsChecker> requirements_checker_; 287 scoped_ptr<RequirementsChecker> requirements_checker_;
288 }; 288 };
289 289
290 class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction, 290 class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction,
291 public EntryPickerClient { 291 public EntryPickerClient {
292 protected: 292 protected:
293 virtual ~DeveloperPrivateChooseEntryFunction(); 293 virtual ~DeveloperPrivateChooseEntryFunction();
294 virtual bool RunImpl() OVERRIDE; 294 virtual bool RunSync() OVERRIDE;
295 bool ShowPicker(ui::SelectFileDialog::Type picker_type, 295 bool ShowPicker(ui::SelectFileDialog::Type picker_type,
296 const base::FilePath& last_directory, 296 const base::FilePath& last_directory,
297 const base::string16& select_title, 297 const base::string16& select_title,
298 const ui::SelectFileDialog::FileTypeInfo& info, 298 const ui::SelectFileDialog::FileTypeInfo& info,
299 int file_type_index); 299 int file_type_index);
300 300
301 // EntryPickerClient functions. 301 // EntryPickerClient functions.
302 virtual void FileSelected(const base::FilePath& path) = 0; 302 virtual void FileSelected(const base::FilePath& path) = 0;
303 virtual void FileSelectionCanceled() = 0; 303 virtual void FileSelectionCanceled() = 0;
304 }; 304 };
305 305
306 306
307 class DeveloperPrivateLoadUnpackedFunction 307 class DeveloperPrivateLoadUnpackedFunction
308 : public DeveloperPrivateChooseEntryFunction { 308 : public DeveloperPrivateChooseEntryFunction {
309 public: 309 public:
310 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadUnpacked", 310 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadUnpacked",
311 DEVELOPERPRIVATE_LOADUNPACKED); 311 DEVELOPERPRIVATE_LOADUNPACKED);
312 312
313 protected: 313 protected:
314 virtual ~DeveloperPrivateLoadUnpackedFunction(); 314 virtual ~DeveloperPrivateLoadUnpackedFunction();
315 virtual bool RunImpl() OVERRIDE; 315 virtual bool RunSync() OVERRIDE;
316 316
317 // EntryPickerCLient implementation. 317 // EntryPickerCLient implementation.
318 virtual void FileSelected(const base::FilePath& path) OVERRIDE; 318 virtual void FileSelected(const base::FilePath& path) OVERRIDE;
319 virtual void FileSelectionCanceled() OVERRIDE; 319 virtual void FileSelectionCanceled() OVERRIDE;
320 }; 320 };
321 321
322 class DeveloperPrivateChoosePathFunction 322 class DeveloperPrivateChoosePathFunction
323 : public DeveloperPrivateChooseEntryFunction { 323 : public DeveloperPrivateChooseEntryFunction {
324 public: 324 public:
325 DECLARE_EXTENSION_FUNCTION("developerPrivate.choosePath", 325 DECLARE_EXTENSION_FUNCTION("developerPrivate.choosePath",
326 DEVELOPERPRIVATE_CHOOSEPATH); 326 DEVELOPERPRIVATE_CHOOSEPATH);
327 327
328 protected: 328 protected:
329 virtual ~DeveloperPrivateChoosePathFunction(); 329 virtual ~DeveloperPrivateChoosePathFunction();
330 virtual bool RunImpl() OVERRIDE; 330 virtual bool RunSync() OVERRIDE;
331 331
332 // EntryPickerClient functions. 332 // EntryPickerClient functions.
333 virtual void FileSelected(const base::FilePath& path) OVERRIDE; 333 virtual void FileSelected(const base::FilePath& path) OVERRIDE;
334 virtual void FileSelectionCanceled() OVERRIDE; 334 virtual void FileSelectionCanceled() OVERRIDE;
335 }; 335 };
336 336
337 class DeveloperPrivatePackDirectoryFunction 337 class DeveloperPrivatePackDirectoryFunction
338 : public ChromeAsyncExtensionFunction, 338 : public ChromeAsyncExtensionFunction,
339 public PackExtensionJob::Client { 339 public PackExtensionJob::Client {
340 340
341 public: 341 public:
342 DECLARE_EXTENSION_FUNCTION("developerPrivate.packDirectory", 342 DECLARE_EXTENSION_FUNCTION("developerPrivate.packDirectory",
343 DEVELOPERPRIVATE_PACKDIRECTORY); 343 DEVELOPERPRIVATE_PACKDIRECTORY);
344 344
345 DeveloperPrivatePackDirectoryFunction(); 345 DeveloperPrivatePackDirectoryFunction();
346 346
347 // ExtensionPackJob::Client implementation. 347 // ExtensionPackJob::Client implementation.
348 virtual void OnPackSuccess(const base::FilePath& crx_file, 348 virtual void OnPackSuccess(const base::FilePath& crx_file,
349 const base::FilePath& key_file) OVERRIDE; 349 const base::FilePath& key_file) OVERRIDE;
350 virtual void OnPackFailure(const std::string& error, 350 virtual void OnPackFailure(const std::string& error,
351 ExtensionCreator::ErrorType error_type) OVERRIDE; 351 ExtensionCreator::ErrorType error_type) OVERRIDE;
352 352
353 protected: 353 protected:
354 virtual ~DeveloperPrivatePackDirectoryFunction(); 354 virtual ~DeveloperPrivatePackDirectoryFunction();
355 virtual bool RunImpl() OVERRIDE; 355 virtual bool RunSync() OVERRIDE;
356 356
357 private: 357 private:
358 scoped_refptr<PackExtensionJob> pack_job_; 358 scoped_refptr<PackExtensionJob> pack_job_;
359 std::string item_path_str_; 359 std::string item_path_str_;
360 std::string key_path_str_; 360 std::string key_path_str_;
361 }; 361 };
362 362
363 class DeveloperPrivateIsProfileManagedFunction 363 class DeveloperPrivateIsProfileManagedFunction
364 : public ChromeSyncExtensionFunction { 364 : public ChromeSyncExtensionFunction {
365 public: 365 public:
366 DECLARE_EXTENSION_FUNCTION("developerPrivate.isProfileManaged", 366 DECLARE_EXTENSION_FUNCTION("developerPrivate.isProfileManaged",
367 DEVELOPERPRIVATE_ISPROFILEMANAGED); 367 DEVELOPERPRIVATE_ISPROFILEMANAGED);
368 368
369 protected: 369 protected:
370 virtual ~DeveloperPrivateIsProfileManagedFunction(); 370 virtual ~DeveloperPrivateIsProfileManagedFunction();
371 371
372 // ExtensionFunction: 372 // ExtensionFunction:
373 virtual bool RunImpl() OVERRIDE; 373 virtual bool RunSync() OVERRIDE;
374 }; 374 };
375 375
376 class DeveloperPrivateLoadDirectoryFunction 376 class DeveloperPrivateLoadDirectoryFunction
377 : public ChromeAsyncExtensionFunction { 377 : public ChromeAsyncExtensionFunction {
378 public: 378 public:
379 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadDirectory", 379 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadDirectory",
380 DEVELOPERPRIVATE_LOADUNPACKEDCROS); 380 DEVELOPERPRIVATE_LOADUNPACKEDCROS);
381 381
382 DeveloperPrivateLoadDirectoryFunction(); 382 DeveloperPrivateLoadDirectoryFunction();
383 383
384 protected: 384 protected:
385 virtual ~DeveloperPrivateLoadDirectoryFunction(); 385 virtual ~DeveloperPrivateLoadDirectoryFunction();
386 386
387 // ExtensionFunction: 387 // ExtensionFunction:
388 virtual bool RunImpl() OVERRIDE; 388 virtual bool RunSync() OVERRIDE;
389 389
390 void ClearExistingDirectoryContent(const base::FilePath& project_path); 390 void ClearExistingDirectoryContent(const base::FilePath& project_path);
391 391
392 void ReadSyncFileSystemDirectory(const base::FilePath& project_path, 392 void ReadSyncFileSystemDirectory(const base::FilePath& project_path,
393 const base::FilePath& destination_path); 393 const base::FilePath& destination_path);
394 394
395 void ReadSyncFileSystemDirectoryCb( 395 void ReadSyncFileSystemDirectoryCb(
396 const base::FilePath& project_path, 396 const base::FilePath& project_path,
397 const base::FilePath& destination_path, 397 const base::FilePath& destination_path,
398 base::File::Error result, 398 base::File::Error result,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 public: 435 public:
436 DECLARE_EXTENSION_FUNCTION("developerPrivate.requestFileSource", 436 DECLARE_EXTENSION_FUNCTION("developerPrivate.requestFileSource",
437 DEVELOPERPRIVATE_REQUESTFILESOURCE); 437 DEVELOPERPRIVATE_REQUESTFILESOURCE);
438 438
439 DeveloperPrivateRequestFileSourceFunction(); 439 DeveloperPrivateRequestFileSourceFunction();
440 440
441 protected: 441 protected:
442 virtual ~DeveloperPrivateRequestFileSourceFunction(); 442 virtual ~DeveloperPrivateRequestFileSourceFunction();
443 443
444 // ExtensionFunction: 444 // ExtensionFunction:
445 virtual bool RunImpl() OVERRIDE; 445 virtual bool RunSync() OVERRIDE;
446 446
447 private: 447 private:
448 void LaunchCallback(const base::DictionaryValue& results); 448 void LaunchCallback(const base::DictionaryValue& results);
449 }; 449 };
450 450
451 class DeveloperPrivateOpenDevToolsFunction 451 class DeveloperPrivateOpenDevToolsFunction
452 : public ChromeAsyncExtensionFunction { 452 : public ChromeAsyncExtensionFunction {
453 public: 453 public:
454 DECLARE_EXTENSION_FUNCTION("developerPrivate.openDevTools", 454 DECLARE_EXTENSION_FUNCTION("developerPrivate.openDevTools",
455 DEVELOPERPRIVATE_OPENDEVTOOLS); 455 DEVELOPERPRIVATE_OPENDEVTOOLS);
456 456
457 DeveloperPrivateOpenDevToolsFunction(); 457 DeveloperPrivateOpenDevToolsFunction();
458 458
459 protected: 459 protected:
460 virtual ~DeveloperPrivateOpenDevToolsFunction(); 460 virtual ~DeveloperPrivateOpenDevToolsFunction();
461 461
462 // ExtensionFunction: 462 // ExtensionFunction:
463 virtual bool RunImpl() OVERRIDE; 463 virtual bool RunSync() OVERRIDE;
464 }; 464 };
465 465
466 } // namespace api 466 } // namespace api
467 467
468 } // namespace extensions 468 } // namespace extensions
469 469
470 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_ 470 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698