| OLD | NEW |
| 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 miscellaneous API functions, which don't belong to | 5 // This file provides miscellaneous API functions, which don't belong to |
| 6 // other files. | 6 // other files. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ | 8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ |
| 9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ | 9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class FileManagerPrivateLogoutUserForReauthenticationFunction | 23 class FileManagerPrivateLogoutUserForReauthenticationFunction |
| 24 : public ChromeSyncExtensionFunction { | 24 : public ChromeSyncExtensionFunction { |
| 25 public: | 25 public: |
| 26 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.logoutUserForReauthentication", | 26 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.logoutUserForReauthentication", |
| 27 FILEMANAGERPRIVATE_LOGOUTUSERFORREAUTHENTICATION) | 27 FILEMANAGERPRIVATE_LOGOUTUSERFORREAUTHENTICATION) |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 virtual ~FileManagerPrivateLogoutUserForReauthenticationFunction() {} | 30 virtual ~FileManagerPrivateLogoutUserForReauthenticationFunction() {} |
| 31 | 31 |
| 32 // SyncExtensionFunction overrides. | 32 // SyncExtensionFunction overrides. |
| 33 virtual bool RunSync() OVERRIDE; | 33 virtual bool RunSync() override; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Implements the chrome.fileManagerPrivate.getPreferences method. | 36 // Implements the chrome.fileManagerPrivate.getPreferences method. |
| 37 // Gets settings for Files.app. | 37 // Gets settings for Files.app. |
| 38 class FileManagerPrivateGetPreferencesFunction | 38 class FileManagerPrivateGetPreferencesFunction |
| 39 : public ChromeSyncExtensionFunction { | 39 : public ChromeSyncExtensionFunction { |
| 40 public: | 40 public: |
| 41 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getPreferences", | 41 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getPreferences", |
| 42 FILEMANAGERPRIVATE_GETPREFERENCES) | 42 FILEMANAGERPRIVATE_GETPREFERENCES) |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~FileManagerPrivateGetPreferencesFunction() {} | 45 virtual ~FileManagerPrivateGetPreferencesFunction() {} |
| 46 | 46 |
| 47 virtual bool RunSync() OVERRIDE; | 47 virtual bool RunSync() override; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // Implements the chrome.fileManagerPrivate.setPreferences method. | 50 // Implements the chrome.fileManagerPrivate.setPreferences method. |
| 51 // Sets settings for Files.app. | 51 // Sets settings for Files.app. |
| 52 class FileManagerPrivateSetPreferencesFunction | 52 class FileManagerPrivateSetPreferencesFunction |
| 53 : public ChromeSyncExtensionFunction { | 53 : public ChromeSyncExtensionFunction { |
| 54 public: | 54 public: |
| 55 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.setPreferences", | 55 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.setPreferences", |
| 56 FILEMANAGERPRIVATE_SETPREFERENCES) | 56 FILEMANAGERPRIVATE_SETPREFERENCES) |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~FileManagerPrivateSetPreferencesFunction() {} | 59 virtual ~FileManagerPrivateSetPreferencesFunction() {} |
| 60 | 60 |
| 61 virtual bool RunSync() OVERRIDE; | 61 virtual bool RunSync() override; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Implements the chrome.fileManagerPrivate.zipSelection method. | 64 // Implements the chrome.fileManagerPrivate.zipSelection method. |
| 65 // Creates a zip file for the selected files. | 65 // Creates a zip file for the selected files. |
| 66 class FileManagerPrivateZipSelectionFunction | 66 class FileManagerPrivateZipSelectionFunction |
| 67 : public LoggedAsyncExtensionFunction { | 67 : public LoggedAsyncExtensionFunction { |
| 68 public: | 68 public: |
| 69 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zipSelection", | 69 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zipSelection", |
| 70 FILEMANAGERPRIVATE_ZIPSELECTION) | 70 FILEMANAGERPRIVATE_ZIPSELECTION) |
| 71 | 71 |
| 72 FileManagerPrivateZipSelectionFunction(); | 72 FileManagerPrivateZipSelectionFunction(); |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 virtual ~FileManagerPrivateZipSelectionFunction(); | 75 virtual ~FileManagerPrivateZipSelectionFunction(); |
| 76 | 76 |
| 77 // AsyncExtensionFunction overrides. | 77 // AsyncExtensionFunction overrides. |
| 78 virtual bool RunAsync() OVERRIDE; | 78 virtual bool RunAsync() override; |
| 79 | 79 |
| 80 // Receives the result from ZipFileCreator. | 80 // Receives the result from ZipFileCreator. |
| 81 void OnZipDone(bool success); | 81 void OnZipDone(bool success); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 // Implements the chrome.fileManagerPrivate.zoom method. | 84 // Implements the chrome.fileManagerPrivate.zoom method. |
| 85 // Changes the zoom level of the file manager by internally calling | 85 // Changes the zoom level of the file manager by internally calling |
| 86 // RenderViewHost::Zoom(). TODO(hirono): Remove this function once the zoom | 86 // RenderViewHost::Zoom(). TODO(hirono): Remove this function once the zoom |
| 87 // level change is supported for all apps. crbug.com/227175. | 87 // level change is supported for all apps. crbug.com/227175. |
| 88 class FileManagerPrivateZoomFunction : public ChromeSyncExtensionFunction { | 88 class FileManagerPrivateZoomFunction : public ChromeSyncExtensionFunction { |
| 89 public: | 89 public: |
| 90 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zoom", | 90 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.zoom", |
| 91 FILEMANAGERPRIVATE_ZOOM); | 91 FILEMANAGERPRIVATE_ZOOM); |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 virtual ~FileManagerPrivateZoomFunction() {} | 94 virtual ~FileManagerPrivateZoomFunction() {} |
| 95 | 95 |
| 96 // AsyncExtensionFunction overrides. | 96 // AsyncExtensionFunction overrides. |
| 97 virtual bool RunSync() OVERRIDE; | 97 virtual bool RunSync() override; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // Implements the chrome.fileManagerPrivate.installWebstoreItem method. | 100 // Implements the chrome.fileManagerPrivate.installWebstoreItem method. |
| 101 class FileManagerPrivateInstallWebstoreItemFunction | 101 class FileManagerPrivateInstallWebstoreItemFunction |
| 102 : public LoggedAsyncExtensionFunction { | 102 : public LoggedAsyncExtensionFunction { |
| 103 public: | 103 public: |
| 104 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.installWebstoreItem", | 104 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.installWebstoreItem", |
| 105 FILEMANAGERPRIVATE_INSTALLWEBSTOREITEM); | 105 FILEMANAGERPRIVATE_INSTALLWEBSTOREITEM); |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 virtual ~FileManagerPrivateInstallWebstoreItemFunction() {} | 108 virtual ~FileManagerPrivateInstallWebstoreItemFunction() {} |
| 109 | 109 |
| 110 // AsyncExtensionFunction overrides. | 110 // AsyncExtensionFunction overrides. |
| 111 virtual bool RunAsync() OVERRIDE; | 111 virtual bool RunAsync() override; |
| 112 void OnInstallComplete(bool success, | 112 void OnInstallComplete(bool success, |
| 113 const std::string& error, | 113 const std::string& error, |
| 114 extensions::webstore_install::Result result); | 114 extensions::webstore_install::Result result); |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 std::string webstore_item_id_; | 117 std::string webstore_item_id_; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 class FileManagerPrivateRequestWebStoreAccessTokenFunction | 120 class FileManagerPrivateRequestWebStoreAccessTokenFunction |
| 121 : public LoggedAsyncExtensionFunction { | 121 : public LoggedAsyncExtensionFunction { |
| 122 public: | 122 public: |
| 123 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestWebStoreAccessToken", | 123 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestWebStoreAccessToken", |
| 124 FILEMANAGERPRIVATE_REQUESTWEBSTOREACCESSTOKEN); | 124 FILEMANAGERPRIVATE_REQUESTWEBSTOREACCESSTOKEN); |
| 125 | 125 |
| 126 FileManagerPrivateRequestWebStoreAccessTokenFunction(); | 126 FileManagerPrivateRequestWebStoreAccessTokenFunction(); |
| 127 | 127 |
| 128 protected: | 128 protected: |
| 129 virtual ~FileManagerPrivateRequestWebStoreAccessTokenFunction(); | 129 virtual ~FileManagerPrivateRequestWebStoreAccessTokenFunction(); |
| 130 virtual bool RunAsync() OVERRIDE; | 130 virtual bool RunAsync() override; |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 scoped_ptr<google_apis::AuthServiceInterface> auth_service_; | 133 scoped_ptr<google_apis::AuthServiceInterface> auth_service_; |
| 134 | 134 |
| 135 void OnAccessTokenFetched(google_apis::GDataErrorCode code, | 135 void OnAccessTokenFetched(google_apis::GDataErrorCode code, |
| 136 const std::string& access_token); | 136 const std::string& access_token); |
| 137 | 137 |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 class FileManagerPrivateGetProfilesFunction | 140 class FileManagerPrivateGetProfilesFunction |
| 141 : public ChromeSyncExtensionFunction { | 141 : public ChromeSyncExtensionFunction { |
| 142 public: | 142 public: |
| 143 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getProfiles", | 143 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.getProfiles", |
| 144 FILEMANAGERPRIVATE_GETPROFILES); | 144 FILEMANAGERPRIVATE_GETPROFILES); |
| 145 | 145 |
| 146 protected: | 146 protected: |
| 147 virtual ~FileManagerPrivateGetProfilesFunction() {} | 147 virtual ~FileManagerPrivateGetProfilesFunction() {} |
| 148 | 148 |
| 149 // AsyncExtensionFunction overrides. | 149 // AsyncExtensionFunction overrides. |
| 150 virtual bool RunSync() OVERRIDE; | 150 virtual bool RunSync() override; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class FileManagerPrivateVisitDesktopFunction | 153 class FileManagerPrivateVisitDesktopFunction |
| 154 : public ChromeSyncExtensionFunction { | 154 : public ChromeSyncExtensionFunction { |
| 155 public: | 155 public: |
| 156 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.visitDesktop", | 156 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.visitDesktop", |
| 157 FILEMANAGERPRIVATE_VISITDESKTOP); | 157 FILEMANAGERPRIVATE_VISITDESKTOP); |
| 158 | 158 |
| 159 protected: | 159 protected: |
| 160 virtual ~FileManagerPrivateVisitDesktopFunction() {} | 160 virtual ~FileManagerPrivateVisitDesktopFunction() {} |
| 161 | 161 |
| 162 // AsyncExtensionFunction overrides. | 162 // AsyncExtensionFunction overrides. |
| 163 virtual bool RunSync() OVERRIDE; | 163 virtual bool RunSync() override; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 // Implements the chrome.fileManagerPrivate.openInspector method. | 166 // Implements the chrome.fileManagerPrivate.openInspector method. |
| 167 class FileManagerPrivateOpenInspectorFunction | 167 class FileManagerPrivateOpenInspectorFunction |
| 168 : public ChromeSyncExtensionFunction { | 168 : public ChromeSyncExtensionFunction { |
| 169 public: | 169 public: |
| 170 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.openInspector", | 170 DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.openInspector", |
| 171 FILEMANAGERPRIVATE_OPENINSPECTOR); | 171 FILEMANAGERPRIVATE_OPENINSPECTOR); |
| 172 | 172 |
| 173 protected: | 173 protected: |
| 174 virtual ~FileManagerPrivateOpenInspectorFunction() {} | 174 virtual ~FileManagerPrivateOpenInspectorFunction() {} |
| 175 | 175 |
| 176 virtual bool RunSync() OVERRIDE; | 176 virtual bool RunSync() override; |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 } // namespace extensions | 179 } // namespace extensions |
| 180 | 180 |
| 181 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ | 181 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ |
| OLD | NEW |