| 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_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 void InitializeWithProfile(Profile* profile, app_list::AppListModel* model); | 52 void InitializeWithProfile(Profile* profile, app_list::AppListModel* model); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 typedef std::vector<ExtensionAppItem*> ExtensionAppList; | 55 typedef std::vector<ExtensionAppItem*> ExtensionAppList; |
| 56 | 56 |
| 57 // Builds the model with the current profile. | 57 // Builds the model with the current profile. |
| 58 void BuildModel(); | 58 void BuildModel(); |
| 59 | 59 |
| 60 // extensions::InstallObserver. | 60 // extensions::InstallObserver. |
| 61 virtual void OnBeginExtensionInstall( | 61 virtual void OnBeginExtensionInstall( |
| 62 const ExtensionInstallParams& params) OVERRIDE; | 62 const ExtensionInstallParams& params) override; |
| 63 virtual void OnDownloadProgress(const std::string& extension_id, | 63 virtual void OnDownloadProgress(const std::string& extension_id, |
| 64 int percent_downloaded) OVERRIDE; | 64 int percent_downloaded) override; |
| 65 virtual void OnInstallFailure(const std::string& extension_id) OVERRIDE; | 65 virtual void OnInstallFailure(const std::string& extension_id) override; |
| 66 virtual void OnDisabledExtensionUpdated( | 66 virtual void OnDisabledExtensionUpdated( |
| 67 const extensions::Extension* extension) OVERRIDE; | 67 const extensions::Extension* extension) override; |
| 68 virtual void OnAppInstalledToAppList( | 68 virtual void OnAppInstalledToAppList( |
| 69 const std::string& extension_id) OVERRIDE; | 69 const std::string& extension_id) override; |
| 70 virtual void OnShutdown() OVERRIDE; | 70 virtual void OnShutdown() override; |
| 71 | 71 |
| 72 // extensions::ExtensionRegistryObserver. | 72 // extensions::ExtensionRegistryObserver. |
| 73 virtual void OnExtensionLoaded( | 73 virtual void OnExtensionLoaded( |
| 74 content::BrowserContext* browser_context, | 74 content::BrowserContext* browser_context, |
| 75 const extensions::Extension* extension) OVERRIDE; | 75 const extensions::Extension* extension) override; |
| 76 virtual void OnExtensionUnloaded( | 76 virtual void OnExtensionUnloaded( |
| 77 content::BrowserContext* browser_context, | 77 content::BrowserContext* browser_context, |
| 78 const extensions::Extension* extension, | 78 const extensions::Extension* extension, |
| 79 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | 79 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 80 virtual void OnExtensionUninstalled( | 80 virtual void OnExtensionUninstalled( |
| 81 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
| 82 const extensions::Extension* extension, | 82 const extensions::Extension* extension, |
| 83 extensions::UninstallReason reason) OVERRIDE; | 83 extensions::UninstallReason reason) override; |
| 84 virtual void OnShutdown(extensions::ExtensionRegistry* registry) OVERRIDE; | 84 virtual void OnShutdown(extensions::ExtensionRegistry* registry) override; |
| 85 | 85 |
| 86 // AppListItemListObserver. | 86 // AppListItemListObserver. |
| 87 virtual void OnListItemMoved(size_t from_index, | 87 virtual void OnListItemMoved(size_t from_index, |
| 88 size_t to_index, | 88 size_t to_index, |
| 89 app_list::AppListItem* item) OVERRIDE; | 89 app_list::AppListItem* item) override; |
| 90 | 90 |
| 91 scoped_ptr<ExtensionAppItem> CreateAppItem( | 91 scoped_ptr<ExtensionAppItem> CreateAppItem( |
| 92 const std::string& extension_id, | 92 const std::string& extension_id, |
| 93 const std::string& extension_name, | 93 const std::string& extension_name, |
| 94 const gfx::ImageSkia& installing_icon, | 94 const gfx::ImageSkia& installing_icon, |
| 95 bool is_platform_app); | 95 bool is_platform_app); |
| 96 | 96 |
| 97 // Populates the model with apps. | 97 // Populates the model with apps. |
| 98 void PopulateApps(); | 98 void PopulateApps(); |
| 99 | 99 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // We listen to this to show app installing progress. | 150 // We listen to this to show app installing progress. |
| 151 extensions::InstallTracker* tracker_; | 151 extensions::InstallTracker* tracker_; |
| 152 | 152 |
| 153 // Listen extension's load, unload, uninstalled. | 153 // Listen extension's load, unload, uninstalled. |
| 154 extensions::ExtensionRegistry* extension_registry_; | 154 extensions::ExtensionRegistry* extension_registry_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); | 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ | 159 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_MODEL_BUILDER_H_ |
| OLD | NEW |