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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // The Rect returned is in the same coordinates of |folder_icon_bounds|. | 52 // The Rect returned is in the same coordinates of |folder_icon_bounds|. |
53 gfx::Rect GetTargetIconRectInFolderForItem( | 53 gfx::Rect GetTargetIconRectInFolderForItem( |
54 AppListItem* item, const gfx::Rect& folder_icon_bounds); | 54 AppListItem* item, const gfx::Rect& folder_icon_bounds); |
55 | 55 |
56 AppListItemList* item_list() { return item_list_.get(); } | 56 AppListItemList* item_list() { return item_list_.get(); } |
57 const AppListItemList* item_list() const { return item_list_.get(); } | 57 const AppListItemList* item_list() const { return item_list_.get(); } |
58 | 58 |
59 FolderType folder_type() const { return folder_type_; } | 59 FolderType folder_type() const { return folder_type_; } |
60 | 60 |
61 // AppListItem | 61 // AppListItem |
62 virtual void Activate(int event_flags) OVERRIDE; | 62 virtual void Activate(int event_flags) override; |
63 virtual const char* GetItemType() const OVERRIDE; | 63 virtual const char* GetItemType() const override; |
64 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; | 64 virtual ui::MenuModel* GetContextMenuModel() override; |
65 virtual AppListItem* FindChildItem(const std::string& id) OVERRIDE; | 65 virtual AppListItem* FindChildItem(const std::string& id) override; |
66 virtual size_t ChildItemCount() const OVERRIDE; | 66 virtual size_t ChildItemCount() const override; |
67 virtual void OnExtensionPreferenceChanged() OVERRIDE; | 67 virtual void OnExtensionPreferenceChanged() override; |
68 virtual bool CompareForTest(const AppListItem* other) const OVERRIDE; | 68 virtual bool CompareForTest(const AppListItem* other) const override; |
69 | 69 |
70 // Calculates the top item icons' bounds inside |folder_icon_bounds|. | 70 // Calculates the top item icons' bounds inside |folder_icon_bounds|. |
71 // Returns the bounds of top item icons in sequence of top left, top right, | 71 // Returns the bounds of top item icons in sequence of top left, top right, |
72 // bottom left, bottom right. | 72 // bottom left, bottom right. |
73 static Rects GetTopIconsBounds(const gfx::Rect& folder_icon_bounds); | 73 static Rects GetTopIconsBounds(const gfx::Rect& folder_icon_bounds); |
74 | 74 |
75 // Returns an id for a new folder. | 75 // Returns an id for a new folder. |
76 static std::string GenerateId(); | 76 static std::string GenerateId(); |
77 | 77 |
78 private: | 78 private: |
79 // AppListItemObserver | 79 // AppListItemObserver |
80 virtual void ItemIconChanged() OVERRIDE; | 80 virtual void ItemIconChanged() override; |
81 | 81 |
82 // AppListItemListObserver | 82 // AppListItemListObserver |
83 virtual void OnListItemAdded(size_t index, AppListItem* item) OVERRIDE; | 83 virtual void OnListItemAdded(size_t index, AppListItem* item) override; |
84 virtual void OnListItemRemoved(size_t index, | 84 virtual void OnListItemRemoved(size_t index, |
85 AppListItem* item) OVERRIDE;; | 85 AppListItem* item) override;; |
86 virtual void OnListItemMoved(size_t from_index, | 86 virtual void OnListItemMoved(size_t from_index, |
87 size_t to_index, | 87 size_t to_index, |
88 AppListItem* item) OVERRIDE; | 88 AppListItem* item) override; |
89 | 89 |
90 void UpdateTopItems(); | 90 void UpdateTopItems(); |
91 | 91 |
92 // The type of folder; may affect behavior of folder views. | 92 // The type of folder; may affect behavior of folder views. |
93 const FolderType folder_type_; | 93 const FolderType folder_type_; |
94 | 94 |
95 // List of items in the folder. | 95 // List of items in the folder. |
96 scoped_ptr<AppListItemList> item_list_; | 96 scoped_ptr<AppListItemList> item_list_; |
97 | 97 |
98 // Top items for generating folder icon. | 98 // Top items for generating folder icon. |
99 std::vector<AppListItem*> top_items_; | 99 std::vector<AppListItem*> top_items_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); | 101 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace app_list | 104 } // namespace app_list |
105 | 105 |
106 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ | 106 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ |
OLD | NEW |