| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ | 6 #define EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "extensions/browser/uninstall_reason.h" | 9 #include "extensions/browser/uninstall_reason.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 const Extension* extension) const = 0; | 71 const Extension* extension) const = 0; |
| 72 | 72 |
| 73 // Parses the manifest and calls back the | 73 // Parses the manifest and calls back the |
| 74 // ManagementGetPermissionWarningsByManifestFunction. | 74 // ManagementGetPermissionWarningsByManifestFunction. |
| 75 virtual void GetPermissionWarningsByManifestFunctionDelegate( | 75 virtual void GetPermissionWarningsByManifestFunctionDelegate( |
| 76 ManagementGetPermissionWarningsByManifestFunction* function, | 76 ManagementGetPermissionWarningsByManifestFunction* function, |
| 77 const std::string& manifest_str) const = 0; | 77 const std::string& manifest_str) const = 0; |
| 78 | 78 |
| 79 // Used to show a dialog prompt in chrome when management.setEnabled extension | 79 // Used to show a dialog prompt in chrome when management.setEnabled extension |
| 80 // function is called. | 80 // function is called. |
| 81 virtual scoped_ptr<InstallPromptDelegate> SetEnabledFunctionDelegate( | 81 virtual std::unique_ptr<InstallPromptDelegate> SetEnabledFunctionDelegate( |
| 82 content::WebContents* web_contents, | 82 content::WebContents* web_contents, |
| 83 content::BrowserContext* browser_context, | 83 content::BrowserContext* browser_context, |
| 84 const Extension* extension, | 84 const Extension* extension, |
| 85 const base::Callback<void(bool)>& callback) const = 0; | 85 const base::Callback<void(bool)>& callback) const = 0; |
| 86 | 86 |
| 87 // Returns a new RequirementsChecker. | 87 // Returns a new RequirementsChecker. |
| 88 virtual scoped_ptr<RequirementsChecker> CreateRequirementsChecker() const = 0; | 88 virtual std::unique_ptr<RequirementsChecker> CreateRequirementsChecker() |
| 89 const = 0; |
| 89 | 90 |
| 90 // Enables the extension identified by |extension_id|. | 91 // Enables the extension identified by |extension_id|. |
| 91 virtual void EnableExtension(content::BrowserContext* context, | 92 virtual void EnableExtension(content::BrowserContext* context, |
| 92 const std::string& extension_id) const = 0; | 93 const std::string& extension_id) const = 0; |
| 93 | 94 |
| 94 // Disables the extension identified by |extension_id|. | 95 // Disables the extension identified by |extension_id|. |
| 95 virtual void DisableExtension( | 96 virtual void DisableExtension( |
| 96 content::BrowserContext* context, | 97 content::BrowserContext* context, |
| 97 const std::string& extension_id, | 98 const std::string& extension_id, |
| 98 Extension::DisableReason disable_reason) const = 0; | 99 Extension::DisableReason disable_reason) const = 0; |
| 99 | 100 |
| 100 // Used to show a confirmation dialog when uninstalling |target_extension|. | 101 // Used to show a confirmation dialog when uninstalling |target_extension|. |
| 101 virtual scoped_ptr<UninstallDialogDelegate> UninstallFunctionDelegate( | 102 virtual std::unique_ptr<UninstallDialogDelegate> UninstallFunctionDelegate( |
| 102 ManagementUninstallFunctionBase* function, | 103 ManagementUninstallFunctionBase* function, |
| 103 const Extension* target_extension, | 104 const Extension* target_extension, |
| 104 bool show_programmatic_uninstall_ui) const = 0; | 105 bool show_programmatic_uninstall_ui) const = 0; |
| 105 | 106 |
| 106 // Uninstalls the extension. | 107 // Uninstalls the extension. |
| 107 virtual bool UninstallExtension(content::BrowserContext* context, | 108 virtual bool UninstallExtension(content::BrowserContext* context, |
| 108 const std::string& transient_extension_id, | 109 const std::string& transient_extension_id, |
| 109 UninstallReason reason, | 110 UninstallReason reason, |
| 110 const base::Closure& deletion_done_callback, | 111 const base::Closure& deletion_done_callback, |
| 111 base::string16* error) const = 0; | 112 base::string16* error) const = 0; |
| 112 | 113 |
| 113 // Creates an app shortcut. | 114 // Creates an app shortcut. |
| 114 virtual bool CreateAppShortcutFunctionDelegate( | 115 virtual bool CreateAppShortcutFunctionDelegate( |
| 115 ManagementCreateAppShortcutFunction* function, | 116 ManagementCreateAppShortcutFunction* function, |
| 116 const Extension* extension) const = 0; | 117 const Extension* extension) const = 0; |
| 117 | 118 |
| 118 // Forwards the call to launch_util::SetLaunchType in chrome. | 119 // Forwards the call to launch_util::SetLaunchType in chrome. |
| 119 virtual void SetLaunchType(content::BrowserContext* context, | 120 virtual void SetLaunchType(content::BrowserContext* context, |
| 120 const std::string& extension_id, | 121 const std::string& extension_id, |
| 121 LaunchType launch_type) const = 0; | 122 LaunchType launch_type) const = 0; |
| 122 | 123 |
| 123 // Creates a bookmark app for |launch_url|. | 124 // Creates a bookmark app for |launch_url|. |
| 124 virtual scoped_ptr<AppForLinkDelegate> GenerateAppForLinkFunctionDelegate( | 125 virtual std::unique_ptr<AppForLinkDelegate> |
| 126 GenerateAppForLinkFunctionDelegate( |
| 125 ManagementGenerateAppForLinkFunction* function, | 127 ManagementGenerateAppForLinkFunction* function, |
| 126 content::BrowserContext* context, | 128 content::BrowserContext* context, |
| 127 const std::string& title, | 129 const std::string& title, |
| 128 const GURL& launch_url) const = 0; | 130 const GURL& launch_url) const = 0; |
| 129 | 131 |
| 130 // Forwards the call to ExtensionIconSource::GetIconURL in chrome. | 132 // Forwards the call to ExtensionIconSource::GetIconURL in chrome. |
| 131 virtual GURL GetIconURL(const Extension* extension, | 133 virtual GURL GetIconURL(const Extension* extension, |
| 132 int icon_size, | 134 int icon_size, |
| 133 ExtensionIconSet::MatchType match, | 135 ExtensionIconSet::MatchType match, |
| 134 bool grayscale, | 136 bool grayscale, |
| 135 bool* exists) const = 0; | 137 bool* exists) const = 0; |
| 136 }; | 138 }; |
| 137 | 139 |
| 138 } // namespace extensions | 140 } // namespace extensions |
| 139 | 141 |
| 140 #endif // EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ | 142 #endif // EXTENSIONS_BROWSER_API_MANAGEMENT_MANAGEMENT_API_DELEGATER_H_ |
| OLD | NEW |