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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.h

Issue 1085113002: [Extensions UI] Use developerPrivate API for repair, options, show path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/scoped_observer.h" 11 #include "base/scoped_observer.h"
12 #include "chrome/browser/extensions/api/developer_private/entry_picker.h" 12 #include "chrome/browser/extensions/api/developer_private/entry_picker.h"
13 #include "chrome/browser/extensions/api/file_system/file_system_api.h" 13 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
14 #include "chrome/browser/extensions/chrome_extension_function.h" 14 #include "chrome/browser/extensions/chrome_extension_function.h"
15 #include "chrome/browser/extensions/error_console/error_console.h" 15 #include "chrome/browser/extensions/error_console/error_console.h"
16 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 16 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
17 #include "chrome/browser/extensions/pack_extension_job.h" 17 #include "chrome/browser/extensions/pack_extension_job.h"
18 #include "chrome/common/extensions/webstore_install_result.h"
18 #include "extensions/browser/browser_context_keyed_api_factory.h" 19 #include "extensions/browser/browser_context_keyed_api_factory.h"
19 #include "extensions/browser/event_router.h" 20 #include "extensions/browser/event_router.h"
20 #include "extensions/browser/extension_registry_observer.h" 21 #include "extensions/browser/extension_registry_observer.h"
21 #include "extensions/browser/process_manager_observer.h" 22 #include "extensions/browser/process_manager_observer.h"
22 #include "storage/browser/fileapi/file_system_context.h" 23 #include "storage/browser/fileapi/file_system_context.h"
23 #include "storage/browser/fileapi/file_system_operation.h" 24 #include "storage/browser/fileapi/file_system_operation.h"
24 #include "ui/shell_dialogs/select_file_dialog.h" 25 #include "ui/shell_dialogs/select_file_dialog.h"
25 26
26 class Profile; 27 class Profile;
27 28
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 168
168 namespace api { 169 namespace api {
169 170
170 class DeveloperPrivateAPIFunction : public ChromeUIThreadExtensionFunction { 171 class DeveloperPrivateAPIFunction : public ChromeUIThreadExtensionFunction {
171 protected: 172 protected:
172 ~DeveloperPrivateAPIFunction() override; 173 ~DeveloperPrivateAPIFunction() override;
173 174
174 // Returns the extension with the given |id| from the registry, including 175 // Returns the extension with the given |id| from the registry, including
175 // all possible extensions (enabled, disabled, terminated, etc). 176 // all possible extensions (enabled, disabled, terminated, etc).
176 const Extension* GetExtensionById(const std::string& id); 177 const Extension* GetExtensionById(const std::string& id);
178
179 // Returns the extension with the given |id| from the registry, only checking
180 // enabled extensions.
181 const Extension* GetEnabledExtensionById(const std::string& id);
177 }; 182 };
178 183
179 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { 184 class DeveloperPrivateAutoUpdateFunction : public DeveloperPrivateAPIFunction {
180 public: 185 public:
181 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", 186 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate",
182 DEVELOPERPRIVATE_AUTOUPDATE) 187 DEVELOPERPRIVATE_AUTOUPDATE)
183 188
184 protected: 189 protected:
185 ~DeveloperPrivateAutoUpdateFunction() override; 190 ~DeveloperPrivateAutoUpdateFunction() override;
186 191 ResponseAction Run() override;
187 // ExtensionFunction:
188 bool RunSync() override;
189 }; 192 };
190 193
191 class DeveloperPrivateGetItemsInfoFunction 194 class DeveloperPrivateGetItemsInfoFunction
192 : public DeveloperPrivateAPIFunction { 195 : public DeveloperPrivateAPIFunction {
193 public: 196 public:
194 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", 197 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo",
195 DEVELOPERPRIVATE_GETITEMSINFO) 198 DEVELOPERPRIVATE_GETITEMSINFO)
196 DeveloperPrivateGetItemsInfoFunction(); 199 DeveloperPrivateGetItemsInfoFunction();
197 200
198 private: 201 private:
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 : public DeveloperPrivateAPIFunction { 472 : public DeveloperPrivateAPIFunction {
470 public: 473 public:
471 DECLARE_EXTENSION_FUNCTION("developerPrivate.deleteExtensionErrors", 474 DECLARE_EXTENSION_FUNCTION("developerPrivate.deleteExtensionErrors",
472 DEVELOPERPRIVATE_DELETEEXTENSIONERRORS); 475 DEVELOPERPRIVATE_DELETEEXTENSIONERRORS);
473 476
474 protected: 477 protected:
475 ~DeveloperPrivateDeleteExtensionErrorsFunction() override; 478 ~DeveloperPrivateDeleteExtensionErrorsFunction() override;
476 ResponseAction Run() override; 479 ResponseAction Run() override;
477 }; 480 };
478 481
482 class DeveloperPrivateRepairExtensionFunction
483 : public DeveloperPrivateAPIFunction {
484 public:
485 DECLARE_EXTENSION_FUNCTION("developerPrivate.repairExtension",
486 DEVELOPERPRIVATE_REPAIREXTENSION);
487
488 protected:
489 ~DeveloperPrivateRepairExtensionFunction() override;
490 ResponseAction Run() override;
491
492 void OnReinstallComplete(bool success,
493 const std::string& error,
494 webstore_install::Result result);
495 };
496
497 class DeveloperPrivateShowOptionsFunction : public DeveloperPrivateAPIFunction {
498 public:
499 DECLARE_EXTENSION_FUNCTION("developerPrivate.showOptions",
500 DEVELOPERPRIVATE_SHOWOPTIONS);
501
502 protected:
503 ~DeveloperPrivateShowOptionsFunction() override;
504 ResponseAction Run() override;
505 };
506
507 class DeveloperPrivateShowPathFunction : public DeveloperPrivateAPIFunction {
508 public:
509 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPath",
510 DEVELOPERPRIVATE_SHOWPATH);
511
512 protected:
513 ~DeveloperPrivateShowPathFunction() override;
514 ResponseAction Run() override;
515 };
516
479 } // namespace api 517 } // namespace api
480 518
481 } // namespace extensions 519 } // namespace extensions
482 520
483 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_ 521 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API _H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/developer_private/developer_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698