Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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 | 37 |
| 38 // Called when the Extension begins the download process. | |
| 39 // This is typically, but not always, almost immediately after | |
| 40 // OnBeginExtensionInstall(). In some cases, though, the extension may already | |
| 41 // be downloaded, so we don't want to group the two together incorrectly. | |
|
not at google - send to devlin
2014/02/27 21:49:56
nit: this comment has too many commas in it.
Devlin
2014/02/28 18:04:51
Haha fair enough, I suppose, though, really, there
| |
| 42 virtual void OnBeginExtensionDownload(const std::string& extension_id); | |
| 43 | |
| 38 // Called whenever the extension download is updated. | 44 // Called whenever the extension download is updated. |
| 39 // Note: Some extensions have multiple modules, so the percent included here | 45 // Note: Some extensions have multiple modules, so the percent included here |
| 40 // is a simple calculation of: | 46 // is a simple calculation of: |
| 41 // (finished_files * 100 + current_file_progress) / (total files * 100). | 47 // (finished_files * 100 + current_file_progress) / (total files * 100). |
| 42 virtual void OnDownloadProgress(const std::string& extension_id, | 48 virtual void OnDownloadProgress(const std::string& extension_id, |
| 43 int percent_downloaded); | 49 int percent_downloaded); |
| 44 | 50 |
| 51 // Called when the necessary downloads have completed, and the crx | |
|
not at google - send to devlin
2014/02/27 21:49:56
nit: unnecessary comma
Devlin
2014/02/28 18:04:51
I'm defending this one! :P
http://www.hamilton.edu
| |
| 52 // installation is due to start. | |
| 53 virtual void OnBeginCrxInstall(const std::string& extension_id); | |
| 54 | |
| 45 // Called if the extension fails to install. | 55 // Called if the extension fails to install. |
| 46 virtual void OnInstallFailure(const std::string& extension_id); | 56 virtual void OnInstallFailure(const std::string& extension_id); |
| 47 | 57 |
| 48 // Called if the installation succeeds. | 58 // Called if the installation succeeds. |
| 49 virtual void OnExtensionInstalled(const Extension* extension); | 59 virtual void OnExtensionInstalled(const Extension* extension); |
| 50 | 60 |
| 51 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is | 61 // Called when an extension is [Loaded, Unloaded, Uninstalled] or an app is |
| 52 // installed to the app list. These are simply forwarded from the | 62 // installed to the app list. These are simply forwarded from the |
| 53 // chrome::NOTIFICATIONs. | 63 // chrome::NOTIFICATIONs. |
| 54 virtual void OnExtensionLoaded(const Extension* extension); | 64 virtual void OnExtensionLoaded(const Extension* extension); |
| 55 virtual void OnExtensionUnloaded(const Extension* extension); | 65 virtual void OnExtensionUnloaded(const Extension* extension); |
| 56 virtual void OnExtensionUninstalled(const Extension* extension); | 66 virtual void OnExtensionUninstalled(const Extension* extension); |
| 57 virtual void OnAppInstalledToAppList(const std::string& extension_id); | 67 virtual void OnAppInstalledToAppList(const std::string& extension_id); |
| 58 | 68 |
| 59 // Called when the app list is reordered. | 69 // Called when the app list is reordered. |
| 60 virtual void OnAppsReordered(); | 70 virtual void OnAppsReordered(); |
| 61 | 71 |
| 62 // Notifies observers that the observed object is going away. | 72 // Notifies observers that the observed object is going away. |
| 63 virtual void OnShutdown(); | 73 virtual void OnShutdown(); |
| 64 | 74 |
| 65 protected: | 75 protected: |
| 66 virtual ~InstallObserver() {} | 76 virtual ~InstallObserver() {} |
| 67 }; | 77 }; |
| 68 | 78 |
| 69 } // namespace extensions | 79 } // namespace extensions |
| 70 | 80 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ | 81 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_OBSERVER_H_ |
| OLD | NEW |