OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MODEL_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_MODEL_H_ |
6 #define UI_APP_LIST_APP_LIST_MODEL_H_ | 6 #define UI_APP_LIST_APP_LIST_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const std::string& name, | 105 const std::string& name, |
106 const std::string& short_name); | 106 const std::string& short_name); |
107 | 107 |
108 // Deletes the item matching |id| from |top_level_item_list_| or from the | 108 // Deletes the item matching |id| from |top_level_item_list_| or from the |
109 // appropriate folder. | 109 // appropriate folder. |
110 void DeleteItem(const std::string& id); | 110 void DeleteItem(const std::string& id); |
111 | 111 |
112 // Call OnExtensionPreferenceChanged() for all items in the model. | 112 // Call OnExtensionPreferenceChanged() for all items in the model. |
113 void NotifyExtensionPreferenceChanged(); | 113 void NotifyExtensionPreferenceChanged(); |
114 | 114 |
| 115 // Sets wither or not folder UI should be enabled. If |folders_enabled| is |
| 116 // false, removes any non-OEM folders. |
| 117 void SetFoldersEnabled(bool folders_enabled); |
| 118 |
115 AppListItemList* top_level_item_list() { return top_level_item_list_.get(); } | 119 AppListItemList* top_level_item_list() { return top_level_item_list_.get(); } |
116 | 120 |
117 SearchBoxModel* search_box() { return search_box_.get(); } | 121 SearchBoxModel* search_box() { return search_box_.get(); } |
118 SearchResults* results() { return results_.get(); } | 122 SearchResults* results() { return results_.get(); } |
119 Status status() const { return status_; } | 123 Status status() const { return status_; } |
| 124 bool folders_enabled() const { return folders_enabled_; } |
120 | 125 |
121 private: | 126 private: |
122 // AppListItemListObserver | 127 // AppListItemListObserver |
123 virtual void OnListItemMoved(size_t from_index, | 128 virtual void OnListItemMoved(size_t from_index, |
124 size_t to_index, | 129 size_t to_index, |
125 AppListItem* item) OVERRIDE; | 130 AppListItem* item) OVERRIDE; |
126 | 131 |
127 // Returns an existing folder matching |folder_id| or creates a new folder. | 132 // Returns an existing folder matching |folder_id| or creates a new folder. |
128 AppListFolderItem* FindOrCreateFolderItem(const std::string& folder_id); | 133 AppListFolderItem* FindOrCreateFolderItem(const std::string& folder_id); |
129 | 134 |
(...skipping 20 matching lines...) Expand all Loading... |
150 scoped_ptr<AppListItem> RemoveItemFromFolder(AppListFolderItem* folder, | 155 scoped_ptr<AppListItem> RemoveItemFromFolder(AppListFolderItem* folder, |
151 AppListItem* item); | 156 AppListItem* item); |
152 | 157 |
153 scoped_ptr<AppListItemList> top_level_item_list_; | 158 scoped_ptr<AppListItemList> top_level_item_list_; |
154 | 159 |
155 scoped_ptr<SearchBoxModel> search_box_; | 160 scoped_ptr<SearchBoxModel> search_box_; |
156 scoped_ptr<SearchResults> results_; | 161 scoped_ptr<SearchResults> results_; |
157 | 162 |
158 Status status_; | 163 Status status_; |
159 ObserverList<AppListModelObserver> observers_; | 164 ObserverList<AppListModelObserver> observers_; |
| 165 bool folders_enabled_; |
160 | 166 |
161 DISALLOW_COPY_AND_ASSIGN(AppListModel); | 167 DISALLOW_COPY_AND_ASSIGN(AppListModel); |
162 }; | 168 }; |
163 | 169 |
164 } // namespace app_list | 170 } // namespace app_list |
165 | 171 |
166 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ | 172 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ |
OLD | NEW |