ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / file_manager / private_api_misc.h
blob9661195f8a475b9d9af98bdecd0d089686ee019d
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
3 // found in the LICENSE file.
4 //
5 // This file provides miscellaneous API functions, which don't belong to
6 // other files.
8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_
9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_
11 #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
12 #include "chrome/common/extensions/webstore_install_result.h"
13 #include "google_apis/drive/drive_api_error_codes.h"
15 namespace google_apis {
16 class AuthServiceInterface;
19 namespace extensions {
21 // Implements the chrome.fileManagerPrivate.logoutUserForReauthentication
22 // method.
23 class FileManagerPrivateLogoutUserForReauthenticationFunction
24 : public ChromeSyncExtensionFunction {
25 public:
26 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.logoutUserForReauthentication",
27 FILEMANAGERPRIVATE_LOGOUTUSERFORREAUTHENTICATION)
29 protected:
30 ~FileManagerPrivateLogoutUserForReauthenticationFunction() override {}
32 // SyncExtensionFunction overrides.
33 bool RunSync() override;
36 // Implements the chrome.fileManagerPrivate.getPreferences method.
37 // Gets settings for Files.app.
38 class FileManagerPrivateGetPreferencesFunction
39 : public ChromeSyncExtensionFunction {
40 public:
41 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getPreferences",
42 FILEMANAGERPRIVATE_GETPREFERENCES)
44 protected:
45 ~FileManagerPrivateGetPreferencesFunction() override {}
47 bool RunSync() override;
50 // Implements the chrome.fileManagerPrivate.setPreferences method.
51 // Sets settings for Files.app.
52 class FileManagerPrivateSetPreferencesFunction
53 : public ChromeSyncExtensionFunction {
54 public:
55 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.setPreferences",
56 FILEMANAGERPRIVATE_SETPREFERENCES)
58 protected:
59 ~FileManagerPrivateSetPreferencesFunction() override {}
61 bool RunSync() override;
64 // Implements the chrome.fileManagerPrivate.zipSelection method.
65 // Creates a zip file for the selected files.
66 class FileManagerPrivateZipSelectionFunction
67 : public LoggedAsyncExtensionFunction {
68 public:
69 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zipSelection",
70 FILEMANAGERPRIVATE_ZIPSELECTION)
72 FileManagerPrivateZipSelectionFunction();
74 protected:
75 ~FileManagerPrivateZipSelectionFunction() override;
77 // AsyncExtensionFunction overrides.
78 bool RunAsync() override;
80 // Receives the result from ZipFileCreator.
81 void OnZipDone(bool success);
84 // Implements the chrome.fileManagerPrivate.zoom method.
85 // Changes the zoom level of the file manager by internally calling
86 // RenderViewHost::Zoom(). TODO(hirono): Remove this function once the zoom
87 // level change is supported for all apps. crbug.com/227175.
88 class FileManagerPrivateZoomFunction : public ChromeSyncExtensionFunction {
89 public:
90 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zoom",
91 FILEMANAGERPRIVATE_ZOOM);
93 protected:
94 ~FileManagerPrivateZoomFunction() override {}
96 // AsyncExtensionFunction overrides.
97 bool RunSync() override;
100 // Implements the chrome.fileManagerPrivate.installWebstoreItem method.
101 class FileManagerPrivateInstallWebstoreItemFunction
102 : public LoggedAsyncExtensionFunction {
103 public:
104 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.installWebstoreItem",
105 FILEMANAGERPRIVATE_INSTALLWEBSTOREITEM);
107 protected:
108 ~FileManagerPrivateInstallWebstoreItemFunction() override {}
110 // AsyncExtensionFunction overrides.
111 bool RunAsync() override;
112 void OnInstallComplete(bool success,
113 const std::string& error,
114 extensions::webstore_install::Result result);
116 private:
117 std::string webstore_item_id_;
120 class FileManagerPrivateRequestWebStoreAccessTokenFunction
121 : public LoggedAsyncExtensionFunction {
122 public:
123 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestWebStoreAccessToken",
124 FILEMANAGERPRIVATE_REQUESTWEBSTOREACCESSTOKEN);
126 FileManagerPrivateRequestWebStoreAccessTokenFunction();
128 protected:
129 ~FileManagerPrivateRequestWebStoreAccessTokenFunction() override;
130 bool RunAsync() override;
132 private:
133 scoped_ptr<google_apis::AuthServiceInterface> auth_service_;
135 void OnAccessTokenFetched(google_apis::DriveApiErrorCode code,
136 const std::string& access_token);
140 class FileManagerPrivateGetProfilesFunction
141 : public ChromeSyncExtensionFunction {
142 public:
143 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getProfiles",
144 FILEMANAGERPRIVATE_GETPROFILES);
146 protected:
147 ~FileManagerPrivateGetProfilesFunction() override {}
149 // AsyncExtensionFunction overrides.
150 bool RunSync() override;
153 // Implements the chrome.fileManagerPrivate.openInspector method.
154 class FileManagerPrivateOpenInspectorFunction
155 : public ChromeSyncExtensionFunction {
156 public:
157 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.openInspector",
158 FILEMANAGERPRIVATE_OPENINSPECTOR);
160 protected:
161 ~FileManagerPrivateOpenInspectorFunction() override {}
163 bool RunSync() override;
166 // Implements the chrome.fileManagerPrivate.getMimeType method.
167 class FileManagerPrivateGetMimeTypeFunction
168 : public LoggedAsyncExtensionFunction {
169 public:
170 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getMimeType",
171 FILEMANAGERPRIVATE_GETMIMETYPE)
173 FileManagerPrivateGetMimeTypeFunction();
175 protected:
176 ~FileManagerPrivateGetMimeTypeFunction() override;
178 // AsyncExtensionFunction overrides.
179 bool RunAsync() override;
181 void OnGetMimeType(const std::string& mimeType);
184 } // namespace extensions
186 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_