| Index: chrome/browser/ui/app_list/apps_model_builder.h
|
| diff --git a/chrome/browser/ui/app_list/apps_model_builder.h b/chrome/browser/ui/app_list/apps_model_builder.h
|
| index 97e2350f34277910de95138b98c98426ab442a19..876431d06109f7194554e26ee66f05c78c3ec627 100644
|
| --- a/chrome/browser/ui/app_list/apps_model_builder.h
|
| +++ b/chrome/browser/ui/app_list/apps_model_builder.h
|
| @@ -6,14 +6,15 @@
|
| #define CHROME_BROWSER_UI_APP_LIST_APPS_MODEL_BUILDER_H_
|
|
|
| #include <string>
|
| -#include <vector>
|
|
|
| #include "base/gtest_prod_util.h"
|
| +#include "chrome/browser/api/prefs/pref_change_registrar.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "ui/app_list/app_list_model.h"
|
|
|
| class AppListController;
|
| +class ExtensionAppItem;
|
| class Profile;
|
|
|
| class AppsModelBuilder : public content::NotificationObserver {
|
| @@ -27,17 +28,14 @@ class AppsModelBuilder : public content::NotificationObserver {
|
| void Build();
|
|
|
| private:
|
| - typedef std::vector<app_list::AppListItemModel*> Apps;
|
| + // Populates the model with apps.
|
| + void PopulateApps();
|
|
|
| - FRIEND_TEST_ALL_PREFIXES(AppsModelBuilderTest, GetExtensionApps);
|
| - FRIEND_TEST_ALL_PREFIXES(AppsModelBuilderTest, SortAndPopulateModel);
|
| - FRIEND_TEST_ALL_PREFIXES(AppsModelBuilderTest, InsertItemByTitle);
|
| + // Re-sort apps in case app ordinal prefs are changed.
|
| + void ResortApps();
|
|
|
| - void SortAndPopulateModel(const Apps& apps);
|
| - void InsertItemByTitle(app_list::AppListItemModel* app);
|
| -
|
| - void GetExtensionApps(Apps* apps);
|
| - void CreateSpecialApps();
|
| + // Inserts an app based on app ordinal prefs.
|
| + void InsertApp(ExtensionAppItem* app);
|
|
|
| // Returns the index of the application app with |app_id| in |model_|. If
|
| // no match is found, returns -1.
|
| @@ -48,6 +46,9 @@ class AppsModelBuilder : public content::NotificationObserver {
|
| // is highlighted once per install notification.
|
| void HighlightApp();
|
|
|
| + // Returns app instance at given |index|.
|
| + ExtensionAppItem* GetAppAt(size_t index);
|
| +
|
| // content::NotificationObserver
|
| virtual void Observe(int type,
|
| const content::NotificationSource& source,
|
| @@ -59,13 +60,10 @@ class AppsModelBuilder : public content::NotificationObserver {
|
| // Sub apps model of AppListModel that represents apps grid view.
|
| app_list::AppListModel::Apps* model_;
|
|
|
| - // Number of special apps in the model. Special apps index should be ranged
|
| - // from [0, special_apps_count_ - 1].
|
| - int special_apps_count_;
|
| -
|
| std::string highlight_app_id_;
|
|
|
| content::NotificationRegistrar registrar_;
|
| + PrefChangeRegistrar pref_change_registrar_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AppsModelBuilder);
|
| };
|
|
|