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

Unified Diff: ui/app_list/app_list_folder_item.h

Issue 682843004: Experimental app list: "All apps" button has a folder-like icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares-allapps-button
Patch Set: Created 6 years, 2 months 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: ui/app_list/app_list_folder_item.h
diff --git a/ui/app_list/app_list_folder_item.h b/ui/app_list/app_list_folder_item.h
index cd572e71dbba2c43bfad6f7f407c49d72efef12c..32607c1eef15248f474d4bb5fbc9e5bdc1cf69b2 100644
--- a/ui/app_list/app_list_folder_item.h
+++ b/ui/app_list/app_list_folder_item.h
@@ -12,8 +12,10 @@
#include "ui/app_list/app_list_item.h"
#include "ui/app_list/app_list_item_list_observer.h"
#include "ui/app_list/app_list_item_observer.h"
+#include "ui/app_list/folder_image.h"
namespace gfx {
+class ImageSkia;
class Rect;
}
@@ -23,8 +25,7 @@ class AppListItemList;
// AppListFolderItem implements the model/controller for folders.
class APP_LIST_EXPORT AppListFolderItem : public AppListItem,
- public AppListItemListObserver,
- public AppListItemObserver {
+ public FolderImageObserver {
public:
// The folder type affects folder behavior.
enum FolderType {
@@ -39,9 +40,6 @@ class APP_LIST_EXPORT AppListFolderItem : public AppListItem,
AppListFolderItem(const std::string& id, FolderType folder_type);
~AppListFolderItem() override;
- // Updates the folder's icon.
- void UpdateIcon();
-
// Returns the icon of one of the top items with |item_index|.
const gfx::ImageSkia& GetTopIcon(size_t item_index);
@@ -71,28 +69,18 @@ class APP_LIST_EXPORT AppListFolderItem : public AppListItem,
// Returns an id for a new folder.
static std::string GenerateId();
- private:
- // AppListItemObserver
- void ItemIconChanged() override;
-
- // AppListItemListObserver
- void OnListItemAdded(size_t index, AppListItem* item) override;
- void OnListItemRemoved(size_t index, AppListItem* item) override;
- ;
- void OnListItemMoved(size_t from_index,
- size_t to_index,
- AppListItem* item) override;
-
- void UpdateTopItems();
+ protected:
+ // FolderImageObserver overrides:
calamity 2014/10/28 05:12:57 Overridden from FolderImageObserver:
Matt Giuca 2014/10/29 07:11:23 Doesn't matter (as long as its per-file consistent
+ void OnFolderImageUpdated(const gfx::ImageSkia& icon) override;
calamity 2014/10/28 05:12:57 Why protected?
Matt Giuca 2014/10/29 07:11:23 Done.
+ private:
// The type of folder; may affect behavior of folder views.
const FolderType folder_type_;
// List of items in the folder.
scoped_ptr<AppListItemList> item_list_;
- // Top items for generating folder icon.
- std::vector<AppListItem*> top_items_;
+ FolderImage folder_image_;
DISALLOW_COPY_AND_ASSIGN(AppListFolderItem);
};

Powered by Google App Engine
This is Rietveld 408576698