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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // This file provides task related API functions. 5 // This file provides task related API functions.
6 6
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
13 #include "chrome/browser/chromeos/file_manager/file_tasks.h" 13 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
14 #include "chrome/common/extensions/api/file_browser_private.h" 14 #include "chrome/common/extensions/api/file_browser_private.h"
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 // Implements the chrome.fileBrowserPrivate.executeTask method. 18 // Implements the chrome.fileBrowserPrivate.executeTask method.
19 class FileBrowserPrivateExecuteTaskFunction 19 class FileBrowserPrivateExecuteTaskFunction
20 : public LoggedAsyncExtensionFunction { 20 : public LoggedAsyncExtensionFunction {
21 public: 21 public:
22 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.executeTask", 22 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.executeTask",
23 FILEBROWSERPRIVATE_EXECUTETASK) 23 FILEBROWSERPRIVATE_EXECUTETASK)
24 24
25 protected: 25 protected:
26 virtual ~FileBrowserPrivateExecuteTaskFunction() {} 26 virtual ~FileBrowserPrivateExecuteTaskFunction() {}
27 27
28 // AsyncExtensionFunction overrides. 28 // AsyncExtensionFunction overrides.
29 virtual bool RunImpl() OVERRIDE; 29 virtual bool RunAsync() OVERRIDE;
30 30
31 private: 31 private:
32 void OnTaskExecuted( 32 void OnTaskExecuted(
33 extensions::api::file_browser_private::TaskResult success); 33 extensions::api::file_browser_private::TaskResult success);
34 }; 34 };
35 35
36 // Implements the chrome.fileBrowserPrivate.getFileTasks method. 36 // Implements the chrome.fileBrowserPrivate.getFileTasks method.
37 class FileBrowserPrivateGetFileTasksFunction 37 class FileBrowserPrivateGetFileTasksFunction
38 : public LoggedAsyncExtensionFunction { 38 : public LoggedAsyncExtensionFunction {
39 public: 39 public:
40 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getFileTasks", 40 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getFileTasks",
41 FILEBROWSERPRIVATE_GETFILETASKS) 41 FILEBROWSERPRIVATE_GETFILETASKS)
42 42
43 protected: 43 protected:
44 virtual ~FileBrowserPrivateGetFileTasksFunction() {} 44 virtual ~FileBrowserPrivateGetFileTasksFunction() {}
45 45
46 // AsyncExtensionFunction overrides. 46 // AsyncExtensionFunction overrides.
47 virtual bool RunImpl() OVERRIDE; 47 virtual bool RunAsync() OVERRIDE;
48 48
49 private: 49 private:
50 void OnSniffingMimeTypeCompleted( 50 void OnSniffingMimeTypeCompleted(
51 scoped_ptr<app_file_handler_util::PathAndMimeTypeSet> path_mime_set, 51 scoped_ptr<app_file_handler_util::PathAndMimeTypeSet> path_mime_set,
52 scoped_ptr<std::vector<GURL> > file_urls); 52 scoped_ptr<std::vector<GURL> > file_urls);
53 }; 53 };
54 54
55 // Implements the chrome.fileBrowserPrivate.setDefaultTask method. 55 // Implements the chrome.fileBrowserPrivate.setDefaultTask method.
56 class FileBrowserPrivateSetDefaultTaskFunction 56 class FileBrowserPrivateSetDefaultTaskFunction
57 : public ChromeSyncExtensionFunction { 57 : public ChromeSyncExtensionFunction {
58 public: 58 public:
59 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.setDefaultTask", 59 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.setDefaultTask",
60 FILEBROWSERPRIVATE_SETDEFAULTTASK) 60 FILEBROWSERPRIVATE_SETDEFAULTTASK)
61 61
62 protected: 62 protected:
63 virtual ~FileBrowserPrivateSetDefaultTaskFunction() {} 63 virtual ~FileBrowserPrivateSetDefaultTaskFunction() {}
64 64
65 // SyncExtensionFunction overrides. 65 // SyncExtensionFunction overrides.
66 virtual bool RunSync() OVERRIDE; 66 virtual bool RunSync() OVERRIDE;
67 }; 67 };
68 68
69 } // namespace extensions 69 } // namespace extensions
70 70
71 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_ 71 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_TASKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698