OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ |
6 #define UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ | 6 #define UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 explicit AppListFolderItem(const std::string& id); | 30 explicit AppListFolderItem(const std::string& id); |
31 virtual ~AppListFolderItem(); | 31 virtual ~AppListFolderItem(); |
32 | 32 |
33 // Updates the folder's icon. | 33 // Updates the folder's icon. |
34 void UpdateIcon(); | 34 void UpdateIcon(); |
35 | 35 |
36 // Returns the icon of one of the top items with |item_index|. | 36 // Returns the icon of one of the top items with |item_index|. |
37 const gfx::ImageSkia& GetTopIcon(size_t item_index); | 37 const gfx::ImageSkia& GetTopIcon(size_t item_index); |
38 | 38 |
| 39 // Returns the target icon bounds for |item| to fly back to its parent folder |
| 40 // icon in animation UI. If |item| is one of the top item icon, this will |
| 41 // match its corresponding top item icon in the folder icon. Otherwise, |
| 42 // the target icon bounds is centered at the |folder_icon_bounds| with |
| 43 // the same size of the top item icon. |
| 44 // The Rect returned is in the same coordinates of |folder_icon_bounds|. |
| 45 gfx::Rect GetTargetIconRectInFolderForItem( |
| 46 AppListItem* item, const gfx::Rect& folder_icon_bounds); |
| 47 |
39 AppListItemList* item_list() { return item_list_.get(); } | 48 AppListItemList* item_list() { return item_list_.get(); } |
40 const AppListItemList* item_list() const { return item_list_.get(); } | 49 const AppListItemList* item_list() const { return item_list_.get(); } |
41 | 50 |
42 // AppListItem | 51 // AppListItem |
43 virtual void Activate(int event_flags) OVERRIDE; | 52 virtual void Activate(int event_flags) OVERRIDE; |
44 virtual const char* GetItemType() const OVERRIDE; | 53 virtual const char* GetItemType() const OVERRIDE; |
45 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; | 54 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; |
46 virtual AppListItem* FindChildItem(const std::string& id) OVERRIDE; | 55 virtual AppListItem* FindChildItem(const std::string& id) OVERRIDE; |
47 virtual size_t ChildItemCount() const OVERRIDE; | 56 virtual size_t ChildItemCount() const OVERRIDE; |
48 virtual bool CompareForTest(const AppListItem* other) const OVERRIDE; | 57 virtual bool CompareForTest(const AppListItem* other) const OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
76 scoped_ptr<AppListItemList> item_list_; | 85 scoped_ptr<AppListItemList> item_list_; |
77 // Top items for generating folder icon. | 86 // Top items for generating folder icon. |
78 std::vector<AppListItem*> top_items_; | 87 std::vector<AppListItem*> top_items_; |
79 | 88 |
80 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); | 89 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); |
81 }; | 90 }; |
82 | 91 |
83 } // namespace app_list | 92 } // namespace app_list |
84 | 93 |
85 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ | 94 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ |
OLD | NEW |