| OLD | NEW |
| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 base::FilePath last_unpacked_directory_; | 155 base::FilePath last_unpacked_directory_; |
| 156 | 156 |
| 157 // Created lazily upon OnListenerAdded. | 157 // Created lazily upon OnListenerAdded. |
| 158 scoped_ptr<DeveloperPrivateEventRouter> developer_private_event_router_; | 158 scoped_ptr<DeveloperPrivateEventRouter> developer_private_event_router_; |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateAPI); | 160 DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateAPI); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 namespace api { | 163 namespace api { |
| 164 | 164 |
| 165 class DeveloperPrivateAPIFunction : public UIThreadExtensionFunction { |
| 166 protected: |
| 167 ~DeveloperPrivateAPIFunction() override; |
| 168 |
| 169 // Returns the extension with the given |id| from the registry, including |
| 170 // all possible extensions (enabled, disabled, terminated, etc). |
| 171 const Extension* GetExtensionById(const std::string& id); |
| 172 }; |
| 173 |
| 165 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { | 174 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { |
| 166 public: | 175 public: |
| 167 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", | 176 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", |
| 168 DEVELOPERPRIVATE_AUTOUPDATE) | 177 DEVELOPERPRIVATE_AUTOUPDATE) |
| 169 | 178 |
| 170 protected: | 179 protected: |
| 171 ~DeveloperPrivateAutoUpdateFunction() override; | 180 ~DeveloperPrivateAutoUpdateFunction() override; |
| 172 | 181 |
| 173 // ExtensionFunction: | 182 // ExtensionFunction: |
| 174 bool RunSync() override; | 183 bool RunSync() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 DEVELOPERPRIVATE_INSPECT) | 230 DEVELOPERPRIVATE_INSPECT) |
| 222 | 231 |
| 223 protected: | 232 protected: |
| 224 ~DeveloperPrivateInspectFunction() override; | 233 ~DeveloperPrivateInspectFunction() override; |
| 225 | 234 |
| 226 // ExtensionFunction: | 235 // ExtensionFunction: |
| 227 bool RunSync() override; | 236 bool RunSync() override; |
| 228 }; | 237 }; |
| 229 | 238 |
| 230 class DeveloperPrivateAllowFileAccessFunction | 239 class DeveloperPrivateAllowFileAccessFunction |
| 231 : public ChromeSyncExtensionFunction { | 240 : public DeveloperPrivateAPIFunction { |
| 232 public: | 241 public: |
| 233 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess", | 242 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess", |
| 234 DEVELOPERPRIVATE_ALLOWFILEACCESS); | 243 DEVELOPERPRIVATE_ALLOWFILEACCESS); |
| 235 | 244 |
| 236 protected: | 245 protected: |
| 237 ~DeveloperPrivateAllowFileAccessFunction() override; | 246 ~DeveloperPrivateAllowFileAccessFunction() override; |
| 238 | 247 |
| 239 // ExtensionFunction: | 248 // ExtensionFunction: |
| 240 bool RunSync() override; | 249 ResponseAction Run() override; |
| 241 }; | 250 }; |
| 242 | 251 |
| 243 class DeveloperPrivateAllowIncognitoFunction | 252 class DeveloperPrivateAllowIncognitoFunction |
| 244 : public UIThreadExtensionFunction { | 253 : public DeveloperPrivateAPIFunction { |
| 245 public: | 254 public: |
| 246 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito", | 255 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito", |
| 247 DEVELOPERPRIVATE_ALLOWINCOGNITO); | 256 DEVELOPERPRIVATE_ALLOWINCOGNITO); |
| 248 | 257 |
| 249 protected: | 258 protected: |
| 250 ~DeveloperPrivateAllowIncognitoFunction() override; | 259 ~DeveloperPrivateAllowIncognitoFunction() override; |
| 251 | 260 |
| 252 // UIThreadExtensionFunction: | 261 // UIThreadExtensionFunction: |
| 253 ResponseAction Run() override; | 262 ResponseAction Run() override; |
| 254 }; | 263 }; |
| 255 | 264 |
| 256 class DeveloperPrivateReloadFunction : public ChromeSyncExtensionFunction { | 265 class DeveloperPrivateReloadFunction : public DeveloperPrivateAPIFunction { |
| 257 public: | 266 public: |
| 258 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload", | 267 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload", |
| 259 DEVELOPERPRIVATE_RELOAD); | 268 DEVELOPERPRIVATE_RELOAD); |
| 260 | 269 |
| 261 protected: | 270 protected: |
| 262 ~DeveloperPrivateReloadFunction() override; | 271 ~DeveloperPrivateReloadFunction() override; |
| 263 | 272 |
| 264 // ExtensionFunction: | 273 // ExtensionFunction: |
| 265 bool RunSync() override; | 274 ResponseAction Run() override; |
| 266 }; | 275 }; |
| 267 | 276 |
| 268 class DeveloperPrivateShowPermissionsDialogFunction | 277 class DeveloperPrivateShowPermissionsDialogFunction |
| 269 : public ChromeSyncExtensionFunction, | 278 : public ChromeSyncExtensionFunction, |
| 270 public ExtensionInstallPrompt::Delegate { | 279 public ExtensionInstallPrompt::Delegate { |
| 271 public: | 280 public: |
| 272 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", | 281 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", |
| 273 DEVELOPERPRIVATE_PERMISSIONS); | 282 DEVELOPERPRIVATE_PERMISSIONS); |
| 274 | 283 |
| 275 DeveloperPrivateShowPermissionsDialogFunction(); | 284 DeveloperPrivateShowPermissionsDialogFunction(); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 469 |
| 461 // ExtensionFunction: | 470 // ExtensionFunction: |
| 462 bool RunAsync() override; | 471 bool RunAsync() override; |
| 463 }; | 472 }; |
| 464 | 473 |
| 465 } // namespace api | 474 } // namespace api |
| 466 | 475 |
| 467 } // namespace extensions | 476 } // namespace extensions |
| 468 | 477 |
| 469 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 478 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
| OLD | NEW |