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

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

Issue 1507873006: Implement base class for app_list items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restor UpdateFromOrdering 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/chrome_app_list_item.h
diff --git a/chrome/browser/ui/app_list/chrome_app_list_item.h b/chrome/browser/ui/app_list/chrome_app_list_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..2aaeda70997ccbd6d1c77eb750cb9d87b02530d4
--- /dev/null
+++ b/chrome/browser/ui/app_list/chrome_app_list_item.h
@@ -0,0 +1,48 @@
+// Copyright 2015 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.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_
+#define CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_
+
+#include <string>
+
+#include "chrome/browser/ui/app_list/app_list_syncable_service.h"
+#include "ui/app_list/app_list_item.h"
+
+class AppListControllerDelegate;
+class Profile;
+
+namespace extensions {
+class AppSorting;
+} // namespace extensions
+
+namespace gfx {
+class ImageSkia;
+} // namespace gfx
xiyuan 2015/12/10 16:57:47 nit: two spaces between "}" and "// namespace gfx"
khmel1 2015/12/11 06:05:48 Done.
+
+// Base class of all chrome app list items.
+class ChromeAppListItem : public app_list::AppListItem {
+ protected:
+ ChromeAppListItem(Profile* profile, const std::string& app_id);
+ ~ChromeAppListItem() override;
+
+ Profile* profile() const { return profile_; }
+
+ extensions::AppSorting* GetAppSorting();
+
+ AppListControllerDelegate* GetController();
+
+ // Updates item position and name from |sync_item|. |sync_item| must be valid.
+ void UpdateFromSync(
+ const app_list::AppListSyncableService::SyncItem* sync_item);
+
+ static gfx::ImageSkia CreateDisabledIcon(const gfx::ImageSkia& icon);
+
+ private:
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeAppListItem);
xiyuan 2015/12/10 16:57:47 nit: #include "base/macros.h"
khmel1 2015/12/11 06:05:48 Done.
+};
+
+#endif // CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698