| 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 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 std::string extension_id; | 26 std::string extension_id; |
| 27 std::string extension_name; | 27 std::string extension_name; |
| 28 gfx::ImageSkia installing_icon; | 28 gfx::ImageSkia installing_icon; |
| 29 bool is_app; | 29 bool is_app; |
| 30 bool is_platform_app; | 30 bool is_platform_app; |
| 31 bool is_ephemeral; | 31 bool is_ephemeral; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // Called at the beginning of the complete installation process, i.e., this | 34 // Called at the beginning of the complete installation process, i.e., this |
| 35 // is called before the extension download begins. | 35 // is called before the extension download begins. |
| 36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params); | 36 virtual void OnBeginExtensionInstall(const ExtensionInstallParams& params) {} |
| 37 |
| 38 // Called when the Extension begins the download process. This typically |
| 39 // happens right after OnBeginExtensionInstall(), unless the extension has |
| 40 // already been downloaded. |
| 41 virtual void OnBeginExtensionDownload(const std::string& extension_id) {} |
| 37 | 42 |
| 38 // Called whenever the extension download is updated. | 43 // Called whenever the extension download is updated. |
| 39 // Note: Some extensions have multiple modules, so the percent included here | 44 // Note: Some extensions have multiple modules, so the percent included here |
| 40 // is a simple calculation of: | 45 // is a simple calculation of: |
| 41 // (finished_files * 100 + current_file_progress) / (total files * 100). | 46 // (finished_files * 100 + current_file_progress) / (total files * 100). |
| 42 virtual void OnDownloadProgress(const std::string& extension_id, | 47 virtual void OnDownloadProgress(const std::string& extension_id, |
| 43 int percent_downloaded); | 48 int percent_downloaded) {} |
| 49 |
| 50 // Called when the necessary downloads have completed, and the crx |
| 51 // installation is due to start. |
| 52 virtual void OnBeginCrxInstall(const std::string& extension_id) {} |
| 44 | 53 |
| 45 // Called if the extension fails to install. | 54 // Called if the extension fails to install. |
| 46 virtual void OnInstallFailure(const std::string& extension_id); | 55 virtual void OnInstallFailure(const std::string& extension_id) {} |
| 47 | 56 |
| 48 // Called if the installation succeeds. | 57 // Called if the installation succeeds. |
| 49 virtual void OnExtensionInstalled(const Extension* extension); | 58 virtual void OnExtensionInstalled(const Extension* extension) {} |
| 50 | 59 |
| 51 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is | 60 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is |
| 52 // installed to the app list. These are simply forwarded from the | 61 // installed to the app list. These are simply forwarded from the |
| 53 // chrome::NOTIFICATIONs. | 62 // chrome::NOTIFICATIONs. |
| 54 virtual void OnExtensionLoaded(const Extension* extension); | 63 virtual void OnExtensionLoaded(const Extension* extension) {} |
| 55 virtual void OnExtensionUnloaded(const Extension* extension); | 64 virtual void OnExtensionUnloaded(const Extension* extension) {} |
| 56 virtual void OnExtensionUninstalled(const Extension* extension); | 65 virtual void OnExtensionUninstalled(const Extension* extension) {} |
| 57 virtual void OnAppInstalledToAppList(const std::string& extension_id); | 66 virtual void OnAppInstalledToAppList(const std::string& extension_id) {} |
| 58 | 67 |
| 59 // Called when the app list is reordered. | 68 // Called when the app list is reordered. |
| 60 virtual void OnAppsReordered(); | 69 virtual void OnAppsReordered() {} |
| 61 | 70 |
| 62 // Notifies observers that the observed object is going away. | 71 // Notifies observers that the observed object is going away. |
| 63 virtual void OnShutdown(); | 72 virtual void OnShutdown() {} |
| 64 | 73 |
| 65 protected: | 74 protected: |
| 66 virtual ~InstallObserver() {} | 75 virtual ~InstallObserver() {} |
| 67 }; | 76 }; |
| 68 | 77 |
| 69 } // namespace extensions | 78 } // namespace extensions |
| 70 | 79 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ |
| OLD | NEW |