Index: chrome/browser/ui/app_list/extension_app_model_builder.h |
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.h b/chrome/browser/ui/app_list/extension_app_model_builder.h |
index 8b327e27155ccee948526aa964d310a6ca53b803..9303e386e61ea37d1cdc10c716785299c4050aaf 100644 |
--- a/chrome/browser/ui/app_list/extension_app_model_builder.h |
+++ b/chrome/browser/ui/app_list/extension_app_model_builder.h |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -9,19 +9,13 @@ |
#include <vector> |
#include "base/prefs/pref_change_registrar.h" |
-#include "base/scoped_observer.h" |
#include "chrome/browser/extensions/install_observer.h" |
+#include "chrome/browser/ui/app_list/app_list_model_builder.h" |
#include "extensions/browser/extension_registry_observer.h" |
-#include "ui/app_list/app_list_model.h" |
#include "ui/base/models/list_model_observer.h" |
class AppListControllerDelegate; |
class ExtensionAppItem; |
-class Profile; |
- |
-namespace app_list { |
-class AppListSyncableService; |
-} |
namespace extensions { |
class Extension; |
@@ -34,28 +28,20 @@ namespace gfx { |
class ImageSkia; |
} |
-// This class populates and maintains the given |model| with information from |
-// |profile|. |
-class ExtensionAppModelBuilder : public extensions::InstallObserver, |
- public extensions::ExtensionRegistryObserver, |
- public app_list::AppListItemListObserver { |
+// This class populates and maintains the given |model| for extension items |
+// with information from |profile|. |
+class ExtensionAppModelBuilder : public AppListModelBuilder, |
+ public extensions::InstallObserver, |
+ public extensions::ExtensionRegistryObserver { |
public: |
explicit ExtensionAppModelBuilder(AppListControllerDelegate* controller); |
~ExtensionAppModelBuilder() override; |
- // Initialize to use app-list sync and sets |service_| to |service|. |
- void InitializeWithService(app_list::AppListSyncableService* service, |
- app_list::AppListModel* model); |
- |
- // Initialize to use extension sync and sets |service_| to NULL. Used in |
- // tests and when AppList sync is not enabled. |
- void InitializeWithProfile(Profile* profile, app_list::AppListModel* model); |
- |
private: |
typedef std::vector<ExtensionAppItem*> ExtensionAppList; |
- // Builds the model with the current profile. |
- void BuildModel(); |
+ // AppListModelBuilder |
+ void BuildModel() override; |
// extensions::InstallObserver. |
void OnBeginExtensionInstall(const ExtensionInstallParams& params) override; |
@@ -92,9 +78,6 @@ class ExtensionAppModelBuilder : public extensions::InstallObserver, |
// Populates the model with apps. |
void PopulateApps(); |
- // Inserts an app based on app ordinal prefs. |
- void InsertApp(scoped_ptr<ExtensionAppItem> app); |
- |
// Returns app instance matching |extension_id| or NULL. |
ExtensionAppItem* GetExtensionAppItem(const std::string& extension_id); |
@@ -110,27 +93,17 @@ class ExtensionAppModelBuilder : public extensions::InstallObserver, |
// Handles extension prefs changes. |
void OnExtensionPreferenceChanged(); |
- // Unowned pointers to the service that owns this and associated profile. |
- app_list::AppListSyncableService* service_; |
- Profile* profile_; |
- |
// Registrar used to monitor the profile prefs. |
PrefChangeRegistrar profile_pref_change_registrar_; |
// Registrar used to monitor the extension prefs. |
PrefChangeRegistrar extension_pref_change_registrar_; |
- // Unowned pointer to the app list controller. |
- AppListControllerDelegate* controller_; |
- |
- // Unowned pointer to the app list model. |
- app_list::AppListModel* model_; |
- |
// We listen to this to show app installing progress. |
- extensions::InstallTracker* tracker_; |
+ extensions::InstallTracker* tracker_ = nullptr; |
// Listen extension's load, unload, uninstalled. |
- extensions::ExtensionRegistry* extension_registry_; |
+ extensions::ExtensionRegistry* extension_registry_ = nullptr; |
DISALLOW_COPY_AND_ASSIGN(ExtensionAppModelBuilder); |
}; |