Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1956)

Unified Diff: chrome/browser/ui/app_list/extension_app_model_builder.h

Issue 1413153007: arc-app-launcher: Minimal support for ARC app launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing links to BUILD.gn Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_unittest.cc ('k') | chrome/browser/ui/app_list/extension_app_model_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698