| 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_APPS_MODEL_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 class AppsModelBuilder : public ui::ListModelObserver, | 30 class AppsModelBuilder : public ui::ListModelObserver, |
| 31 public extensions::InstallObserver { | 31 public extensions::InstallObserver { |
| 32 public: | 32 public: |
| 33 AppsModelBuilder(Profile* profile, | 33 AppsModelBuilder(Profile* profile, |
| 34 app_list::AppListModel::Apps* model, | 34 app_list::AppListModel::Apps* model, |
| 35 AppListControllerDelegate* controller); | 35 AppListControllerDelegate* controller); |
| 36 virtual ~AppsModelBuilder(); | 36 virtual ~AppsModelBuilder(); |
| 37 | 37 |
| 38 // Populates the model. | 38 ExtensionAppItem* GetApp(const std::string& extension_id); |
| 39 void Build(); | |
| 40 | 39 |
| 41 // Returns app instance with id |extension_id|. | 40 // Rebuilds the model with the given profile. |
| 42 ExtensionAppItem* GetApp(const std::string& extension_id); | 41 void SwitchProfile(Profile* profile); |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 typedef std::vector<ExtensionAppItem*> Apps; | 44 typedef std::vector<ExtensionAppItem*> Apps; |
| 46 | 45 |
| 47 // Overridden from extensions::InstallObserver: | 46 // Overridden from extensions::InstallObserver: |
| 48 virtual void OnBeginExtensionInstall(const std::string& extension_id, | 47 virtual void OnBeginExtensionInstall(const std::string& extension_id, |
| 49 const std::string& extension_name, | 48 const std::string& extension_name, |
| 50 const gfx::ImageSkia& installing_icon, | 49 const gfx::ImageSkia& installing_icon, |
| 51 bool is_app, | 50 bool is_app, |
| 52 bool is_platform_app) OVERRIDE; | 51 bool is_platform_app) OVERRIDE; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // True to ignore |model_| changes. | 117 // True to ignore |model_| changes. |
| 119 bool ignore_changes_; | 118 bool ignore_changes_; |
| 120 | 119 |
| 121 // We listen to this to show app installing progress. | 120 // We listen to this to show app installing progress. |
| 122 extensions::InstallTracker* tracker_; | 121 extensions::InstallTracker* tracker_; |
| 123 | 122 |
| 124 DISALLOW_COPY_AND_ASSIGN(AppsModelBuilder); | 123 DISALLOW_COPY_AND_ASSIGN(AppsModelBuilder); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 #endif // CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_ | 126 #endif // CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_ |
| OLD | NEW |