| 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 FileBrowserPrivateLogoutUserForReauthenticationFunction | 23 class FileBrowserPrivateLogoutUserForReauthenticationFunction |
| 24 : public ChromeSyncExtensionFunction { | 24 : public ChromeSyncExtensionFunction { |
| 25 public: | 25 public: |
| 26 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.logoutUserForReauthentication", | 26 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.logoutUserForReauthentication", |
| 27 FILEBROWSERPRIVATE_LOGOUTUSERFORREAUTHENTICATION) | 27 FILEBROWSERPRIVATE_LOGOUTUSERFORREAUTHENTICATION) |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 virtual ~FileBrowserPrivateLogoutUserForReauthenticationFunction() {} | 30 virtual ~FileBrowserPrivateLogoutUserForReauthenticationFunction() {} |
| 31 | 31 |
| 32 // SyncExtensionFunction overrides. | 32 // SyncExtensionFunction overrides. |
| 33 virtual bool RunImpl() OVERRIDE; | 33 virtual bool RunSync() OVERRIDE; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Implements the chrome.fileBrowserPrivate.getPreferences method. | 36 // Implements the chrome.fileBrowserPrivate.getPreferences method. |
| 37 // Gets settings for Files.app. | 37 // Gets settings for Files.app. |
| 38 class FileBrowserPrivateGetPreferencesFunction | 38 class FileBrowserPrivateGetPreferencesFunction |
| 39 : public ChromeSyncExtensionFunction { | 39 : public ChromeSyncExtensionFunction { |
| 40 public: | 40 public: |
| 41 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getPreferences", | 41 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getPreferences", |
| 42 FILEBROWSERPRIVATE_GETPREFERENCES) | 42 FILEBROWSERPRIVATE_GETPREFERENCES) |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~FileBrowserPrivateGetPreferencesFunction() {} | 45 virtual ~FileBrowserPrivateGetPreferencesFunction() {} |
| 46 | 46 |
| 47 virtual bool RunImpl() OVERRIDE; | 47 virtual bool RunSync() OVERRIDE; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // Implements the chrome.fileBrowserPrivate.setPreferences method. | 50 // Implements the chrome.fileBrowserPrivate.setPreferences method. |
| 51 // Sets settings for Files.app. | 51 // Sets settings for Files.app. |
| 52 class FileBrowserPrivateSetPreferencesFunction | 52 class FileBrowserPrivateSetPreferencesFunction |
| 53 : public ChromeSyncExtensionFunction { | 53 : public ChromeSyncExtensionFunction { |
| 54 public: | 54 public: |
| 55 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.setPreferences", | 55 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.setPreferences", |
| 56 FILEBROWSERPRIVATE_SETPREFERENCES) | 56 FILEBROWSERPRIVATE_SETPREFERENCES) |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~FileBrowserPrivateSetPreferencesFunction() {} | 59 virtual ~FileBrowserPrivateSetPreferencesFunction() {} |
| 60 | 60 |
| 61 virtual bool RunImpl() OVERRIDE; | 61 virtual bool RunSync() OVERRIDE; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Implements the chrome.fileBrowserPrivate.zipSelection method. | 64 // Implements the chrome.fileBrowserPrivate.zipSelection method. |
| 65 // Creates a zip file for the selected files. | 65 // Creates a zip file for the selected files. |
| 66 class FileBrowserPrivateZipSelectionFunction | 66 class FileBrowserPrivateZipSelectionFunction |
| 67 : public LoggedAsyncExtensionFunction, | 67 : public LoggedAsyncExtensionFunction, |
| 68 public file_manager::ZipFileCreator::Observer { | 68 public file_manager::ZipFileCreator::Observer { |
| 69 public: | 69 public: |
| 70 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.zipSelection", | 70 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.zipSelection", |
| 71 FILEBROWSERPRIVATE_ZIPSELECTION) | 71 FILEBROWSERPRIVATE_ZIPSELECTION) |
| 72 | 72 |
| 73 FileBrowserPrivateZipSelectionFunction(); | 73 FileBrowserPrivateZipSelectionFunction(); |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 virtual ~FileBrowserPrivateZipSelectionFunction(); | 76 virtual ~FileBrowserPrivateZipSelectionFunction(); |
| 77 | 77 |
| 78 // AsyncExtensionFunction overrides. | 78 // AsyncExtensionFunction overrides. |
| 79 virtual bool RunImpl() OVERRIDE; | 79 virtual bool RunSync() OVERRIDE; |
| 80 | 80 |
| 81 // extensions::ZipFileCreator::Delegate overrides. | 81 // extensions::ZipFileCreator::Delegate overrides. |
| 82 virtual void OnZipDone(bool success) OVERRIDE; | 82 virtual void OnZipDone(bool success) OVERRIDE; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 scoped_refptr<file_manager::ZipFileCreator> zip_file_creator_; | 85 scoped_refptr<file_manager::ZipFileCreator> zip_file_creator_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // Implements the chrome.fileBrowserPrivate.zoom method. | 88 // Implements the chrome.fileBrowserPrivate.zoom method. |
| 89 // Changes the zoom level of the file manager by internally calling | 89 // Changes the zoom level of the file manager by internally calling |
| 90 // RenderViewHost::Zoom(). TODO(hirono): Remove this function once the zoom | 90 // RenderViewHost::Zoom(). TODO(hirono): Remove this function once the zoom |
| 91 // level change is supported for all apps. crbug.com/227175. | 91 // level change is supported for all apps. crbug.com/227175. |
| 92 class FileBrowserPrivateZoomFunction : public ChromeSyncExtensionFunction { | 92 class FileBrowserPrivateZoomFunction : public ChromeSyncExtensionFunction { |
| 93 public: | 93 public: |
| 94 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.zoom", | 94 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.zoom", |
| 95 FILEBROWSERPRIVATE_ZOOM); | 95 FILEBROWSERPRIVATE_ZOOM); |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 virtual ~FileBrowserPrivateZoomFunction() {} | 98 virtual ~FileBrowserPrivateZoomFunction() {} |
| 99 | 99 |
| 100 // AsyncExtensionFunction overrides. | 100 // AsyncExtensionFunction overrides. |
| 101 virtual bool RunImpl() OVERRIDE; | 101 virtual bool RunSync() OVERRIDE; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Implements the chrome.fileBrowserPrivate.installWebstoreItem method. | 104 // Implements the chrome.fileBrowserPrivate.installWebstoreItem method. |
| 105 class FileBrowserPrivateInstallWebstoreItemFunction | 105 class FileBrowserPrivateInstallWebstoreItemFunction |
| 106 : public LoggedAsyncExtensionFunction { | 106 : public LoggedAsyncExtensionFunction { |
| 107 public: | 107 public: |
| 108 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.installWebstoreItem", | 108 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.installWebstoreItem", |
| 109 FILEBROWSERPRIVATE_INSTALLWEBSTOREITEM); | 109 FILEBROWSERPRIVATE_INSTALLWEBSTOREITEM); |
| 110 | 110 |
| 111 protected: | 111 protected: |
| 112 virtual ~FileBrowserPrivateInstallWebstoreItemFunction() {} | 112 virtual ~FileBrowserPrivateInstallWebstoreItemFunction() {} |
| 113 | 113 |
| 114 // AsyncExtensionFunction overrides. | 114 // AsyncExtensionFunction overrides. |
| 115 virtual bool RunImpl() OVERRIDE; | 115 virtual bool RunSync() OVERRIDE; |
| 116 void OnInstallComplete(bool success, const std::string& error); | 116 void OnInstallComplete(bool success, const std::string& error); |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 std::string webstore_item_id_; | 119 std::string webstore_item_id_; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 class FileBrowserPrivateRequestWebStoreAccessTokenFunction | 122 class FileBrowserPrivateRequestWebStoreAccessTokenFunction |
| 123 : public LoggedAsyncExtensionFunction { | 123 : public LoggedAsyncExtensionFunction { |
| 124 public: | 124 public: |
| 125 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.requestWebStoreAccessToken", | 125 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.requestWebStoreAccessToken", |
| 126 FILEBROWSERPRIVATE_REQUESTWEBSTOREACCESSTOKEN); | 126 FILEBROWSERPRIVATE_REQUESTWEBSTOREACCESSTOKEN); |
| 127 | 127 |
| 128 FileBrowserPrivateRequestWebStoreAccessTokenFunction(); | 128 FileBrowserPrivateRequestWebStoreAccessTokenFunction(); |
| 129 | 129 |
| 130 protected: | 130 protected: |
| 131 virtual ~FileBrowserPrivateRequestWebStoreAccessTokenFunction(); | 131 virtual ~FileBrowserPrivateRequestWebStoreAccessTokenFunction(); |
| 132 virtual bool RunImpl() OVERRIDE; | 132 virtual bool RunSync() OVERRIDE; |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 scoped_ptr<google_apis::AuthServiceInterface> auth_service_; | 135 scoped_ptr<google_apis::AuthServiceInterface> auth_service_; |
| 136 | 136 |
| 137 void OnAccessTokenFetched(google_apis::GDataErrorCode code, | 137 void OnAccessTokenFetched(google_apis::GDataErrorCode code, |
| 138 const std::string& access_token); | 138 const std::string& access_token); |
| 139 | 139 |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 class FileBrowserPrivateGetProfilesFunction | 142 class FileBrowserPrivateGetProfilesFunction |
| 143 : public ChromeSyncExtensionFunction { | 143 : public ChromeSyncExtensionFunction { |
| 144 public: | 144 public: |
| 145 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getProfiles", | 145 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.getProfiles", |
| 146 FILEBROWSERPRIVATE_GETPROFILES); | 146 FILEBROWSERPRIVATE_GETPROFILES); |
| 147 | 147 |
| 148 protected: | 148 protected: |
| 149 virtual ~FileBrowserPrivateGetProfilesFunction() {} | 149 virtual ~FileBrowserPrivateGetProfilesFunction() {} |
| 150 | 150 |
| 151 // AsyncExtensionFunction overrides. | 151 // AsyncExtensionFunction overrides. |
| 152 virtual bool RunImpl() OVERRIDE; | 152 virtual bool RunSync() OVERRIDE; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 class FileBrowserPrivateVisitDesktopFunction | 155 class FileBrowserPrivateVisitDesktopFunction |
| 156 : public ChromeSyncExtensionFunction { | 156 : public ChromeSyncExtensionFunction { |
| 157 public: | 157 public: |
| 158 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.visitDesktop", | 158 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.visitDesktop", |
| 159 FILEBROWSERPRIVATE_VISITDESKTOP); | 159 FILEBROWSERPRIVATE_VISITDESKTOP); |
| 160 | 160 |
| 161 protected: | 161 protected: |
| 162 virtual ~FileBrowserPrivateVisitDesktopFunction() {} | 162 virtual ~FileBrowserPrivateVisitDesktopFunction() {} |
| 163 | 163 |
| 164 // AsyncExtensionFunction overrides. | 164 // AsyncExtensionFunction overrides. |
| 165 virtual bool RunImpl() OVERRIDE; | 165 virtual bool RunSync() OVERRIDE; |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace extensions | 168 } // namespace extensions |
| 169 | 169 |
| 170 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ | 170 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_MISC_H_ |
| OLD | NEW |