| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // AppListItem | 62 // AppListItem |
| 63 void Activate(int event_flags) override; | 63 void Activate(int event_flags) override; |
| 64 const char* GetItemType() const override; | 64 const char* GetItemType() const override; |
| 65 ui::MenuModel* GetContextMenuModel() override; | 65 ui::MenuModel* GetContextMenuModel() override; |
| 66 AppListItem* FindChildItem(const std::string& id) override; | 66 AppListItem* FindChildItem(const std::string& id) override; |
| 67 size_t ChildItemCount() const override; | 67 size_t ChildItemCount() const override; |
| 68 void OnExtensionPreferenceChanged() override; | 68 void OnExtensionPreferenceChanged() override; |
| 69 bool CompareForTest(const AppListItem* other) const override; | 69 bool CompareForTest(const AppListItem* other) const override; |
| 70 | 70 |
| 71 // Calculates the top item icons' bounds inside |folder_icon_bounds|. | |
| 72 // Returns the bounds of top item icons in sequence of top left, top right, | |
| 73 // bottom left, bottom right. | |
| 74 static std::vector<gfx::Rect> GetTopIconsBounds( | |
| 75 const gfx::Rect& folder_icon_bounds); | |
| 76 | |
| 77 // Returns an id for a new folder. | 71 // Returns an id for a new folder. |
| 78 static std::string GenerateId(); | 72 static std::string GenerateId(); |
| 79 | 73 |
| 80 private: | 74 private: |
| 81 // AppListItemObserver | 75 // AppListItemObserver |
| 82 void ItemIconChanged() override; | 76 void ItemIconChanged() override; |
| 83 | 77 |
| 84 // AppListItemListObserver | 78 // AppListItemListObserver |
| 85 void OnListItemAdded(size_t index, AppListItem* item) override; | 79 void OnListItemAdded(size_t index, AppListItem* item) override; |
| 86 void OnListItemRemoved(size_t index, AppListItem* item) override; | 80 void OnListItemRemoved(size_t index, AppListItem* item) override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 99 | 93 |
| 100 // Top items for generating folder icon. | 94 // Top items for generating folder icon. |
| 101 std::vector<AppListItem*> top_items_; | 95 std::vector<AppListItem*> top_items_; |
| 102 | 96 |
| 103 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); | 97 DISALLOW_COPY_AND_ASSIGN(AppListFolderItem); |
| 104 }; | 98 }; |
| 105 | 99 |
| 106 } // namespace app_list | 100 } // namespace app_list |
| 107 | 101 |
| 108 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ | 102 #endif // UI_APP_LIST_APP_LIST_FOLDER_ITEM_H_ |
| OLD | NEW |