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

Unified Diff: chrome/browser/ui/views/aura/app_list/extension_item_model.h

Issue 8890049: [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and refactored Created 9 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/views/aura/app_list/extension_item_model.h
diff --git a/chrome/browser/ui/views/aura/app_list/extension_item_model.h b/chrome/browser/ui/views/aura/app_list/extension_item_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..2845331bca59ff55c28044452fb143cd83435292
--- /dev/null
+++ b/chrome/browser/ui/views/aura/app_list/extension_item_model.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 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_VIEWS_AURA_APP_LIST_EXTENSION_ITEM_MODEL_H_
+#define CHROME_BROWSER_UI_VIEWS_AURA_APP_LIST_EXTENSION_ITEM_MODEL_H_
+#pragma once
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/image_loading_tracker.h"
+#include "ui/aura_shell/app_list/app_list_item_model.h"
+
+class Extension;
+class ExtensionResource;
+class ExtensionService;
+class SkBitmap;
+
+// ExtensionItemModel represents an extension app in app list.
+class ExtensionItemModel : public aura_shell::AppListItemModel,
Evan Stade 2011/12/14 22:59:20 I don't understand what else there are besides ext
xiyuan 2011/12/20 00:14:42 From what I have heard from UX people, app list wo
Evan Stade 2011/12/20 00:21:22 sounds like it should be called an app list then
Evan Stade 2011/12/20 00:26:35 should not*
+ public ImageLoadingTracker::Observer {
+ public:
+ ExtensionItemModel(ExtensionService* service,
+ const Extension* extension);
sky 2011/12/14 16:51:33 I don't know enough about the extension side of th
Evan Stade 2011/12/14 22:59:20 you'll get notified if it gets unloaded
xiyuan 2011/12/20 00:14:42 Changed to only keep extension_id around and check
xiyuan 2011/12/20 00:14:42 Not sure if we will setup notification for app lis
Evan Stade 2011/12/20 00:21:22 sure, but you have to be careful because the apps
+
+ const Extension* extension() const {
+ return extension_;
+ }
+
+ private:
+ // Loads extension icon.
+ void LoadImage();
+
+ // Loads default extension icon.
+ void LoadDefaultImage();
+
+ // Overridden from aura_shell::AppListItemModel:
+ virtual void Activate(int event_flags) OVERRIDE;
+
+ // Overridden from ImageLoadingTracker::Observer
+ virtual void OnImageLoaded(SkBitmap* image,
+ const ExtensionResource& resource,
+ int tracker_index) OVERRIDE;
+
+ ExtensionService* service_;
+ const Extension* extension_;
+ scoped_ptr<ImageLoadingTracker> tracker_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionItemModel);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_AURA_APP_LIST_EXTENSION_ITEM_MODEL_H_

Powered by Google App Engine
This is Rietveld 408576698