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

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

Issue 14232018: Add API to load project from localfs into syncfs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@load_api
Patch Set: . Created 7 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
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 "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" 9 #include "chrome/browser/extensions/api/developer_private/entry_picker.h"
10 #include "chrome/browser/extensions/api/file_system/file_system_api.h" 10 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
(...skipping 19 matching lines...) Expand all
30 30
31 namespace api { 31 namespace api {
32 32
33 class EntryPicker; 33 class EntryPicker;
34 class EntryPickerClient; 34 class EntryPickerClient;
35 35
36 namespace developer_private { 36 namespace developer_private {
37 37
38 struct ItemInfo; 38 struct ItemInfo;
39 struct ItemInspectView; 39 struct ItemInspectView;
40 struct ProjectInfo;
40 41
41 } 42 }
42 43
43 } // namespace api 44 } // namespace api
44 45
45 } // namespace extensions 46 } // namespace extensions
46 47
47 namespace developer = extensions::api::developer_private; 48 namespace developer = extensions::api::developer_private;
48 49
49 typedef std::vector<linked_ptr<developer::ItemInfo> > ItemInfoList; 50 typedef std::vector<linked_ptr<developer::ItemInfo> > ItemInfoList;
51 typedef std::vector<linked_ptr<developer::ProjectInfo> > ProjectInfoList;
50 typedef std::vector<linked_ptr<developer::ItemInspectView> > 52 typedef std::vector<linked_ptr<developer::ItemInspectView> >
51 ItemInspectViewList; 53 ItemInspectViewList;
52 54
53 namespace extensions { 55 namespace extensions {
54 56
55 // The profile-keyed service that manages the DeveloperPrivate API. 57 // The profile-keyed service that manages the DeveloperPrivate API.
56 class DeveloperPrivateAPI : public ProfileKeyedService, 58 class DeveloperPrivateAPI : public ProfileKeyedService,
57 public content::NotificationObserver { 59 public content::NotificationObserver {
58 public: 60 public:
59 // Convenience method to get the DeveloperPrivateAPI for a profile. 61 // Convenience method to get the DeveloperPrivateAPI for a profile.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 const base::PlatformFileInfo& file_info, 363 const base::PlatformFileInfo& file_info,
362 const base::FilePath& platform_path, 364 const base::FilePath& platform_path,
363 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); 365 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
364 366
365 void CopyFile(const base::FilePath& src_path, 367 void CopyFile(const base::FilePath& src_path,
366 const base::FilePath& dest_path); 368 const base::FilePath& dest_path);
367 369
368 scoped_refptr<fileapi::FileSystemContext> context_; 370 scoped_refptr<fileapi::FileSystemContext> context_;
369 }; 371 };
370 372
373 class DeveloperPrivateLoadProjectToSyncfsFunction
374 : public SyncExtensionFunction {
375 public:
376 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadProjectToSyncfs",
377 DEVELOPERPRIVATE_LOADPROJECTTOSYNCFS);
378
379 DeveloperPrivateLoadProjectToSyncfsFunction();
380
381 protected:
382 virtual ~DeveloperPrivateLoadProjectToSyncfsFunction();
383
384 // ExtensionFunction
385 virtual bool RunImpl() OVERRIDE;
386
387 void CopyFolder(const base::FilePath::StringType& project_name);
388
389 void CopyFiles(const std::vector<base::FilePath>& paths);
390
391 void CopyFilesCallback(const base::PlatformFileError result);
392
393 scoped_refptr<fileapi::FileSystemContext> context_;
394 };
395
396 class DeveloperPrivateGetProjectsInfoFunction : public AsyncExtensionFunction {
397 public:
398 DECLARE_EXTENSION_FUNCTION("developerPrivate.getProjectsInfo",
399 DEVELOPERPRIVATE_GETPROJECTSINFO);
400
401 DeveloperPrivateGetProjectsInfoFunction();
402
403 protected:
404 virtual ~DeveloperPrivateGetProjectsInfoFunction();
405
406 void ReadFolder();
407
408 // ExtensionFunction
409 virtual bool RunImpl() OVERRIDE;
410 };
411
412 class DeveloperPrivateLoadProjectFunction : public SyncExtensionFunction {
413 public:
414 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadProject",
415 DEVELOPERPRIVATE_LOADPROJECT);
416
417 DeveloperPrivateLoadProjectFunction();
418
419 protected:
420 virtual ~DeveloperPrivateLoadProjectFunction();
421
422 // ExtensionFunction
423 virtual bool RunImpl() OVERRIDE;
424 };
425
426
427
kinuko 2013/04/18 08:15:12 nit: extra empty lines
Gaurav 2013/04/18 23:08:46 Done.
371 } // namespace api 428 } // namespace api
372 429
373 } // namespace extensions 430 } // namespace extensions
374 431
375 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_ 432 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698