| 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 CHROME_BROWSER_UI_ASH_APP_LIST_CHROME_APP_LIST_ITEM_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_APP_LIST_CHROME_APP_LIST_ITEM_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_ |
| 7 | 7 |
| 8 #include "ui/app_list/app_list_item_model.h" | 8 #include "ui/app_list/app_list_item_model.h" |
| 9 | 9 |
| 10 // Base class of all chrome app list items. Chrome's AppListViewDelegate assumes | 10 // Base class of all chrome app list items. Chrome's AppListViewDelegate assumes |
| 11 // all items are derived from this class and calls Activate when an item is | 11 // all items are derived from this class and calls Activate when an item is |
| 12 // activated. | 12 // activated. |
| 13 class ChromeAppListItem : public app_list::AppListItemModel { | 13 class ChromeAppListItem : public app_list::AppListItemModel { |
| 14 public: | 14 public: |
| 15 enum Type { | 15 enum Type { |
| 16 TYPE_APP, | 16 TYPE_APP, |
| 17 TYPE_OTHER, | 17 TYPE_OTHER, |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 // Activates the item. |event_flags| holds flags of a mouse/keyboard event | 20 // Activates the item. |event_flags| holds flags of a mouse/keyboard event |
| 21 // associated with this activation. | 21 // associated with this activation. |
| 22 virtual void Activate(int event_flags) = 0; | 22 virtual void Activate(int event_flags) = 0; |
| 23 | 23 |
| 24 Type type() const { return type_; } | 24 Type type() const { return type_; } |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 explicit ChromeAppListItem(Type type) : type_(type) {} | 27 explicit ChromeAppListItem(Type type) : type_(type) {} |
| 28 virtual ~ChromeAppListItem() {} | 28 virtual ~ChromeAppListItem() {} |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 Type type_; | 31 Type type_; |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ChromeAppListItem); | 33 DISALLOW_COPY_AND_ASSIGN(ChromeAppListItem); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_CHROME_APP_LIST_ITEM_H_ | 36 #endif // CHROME_BROWSER_UI_APP_LIST_CHROME_APP_LIST_ITEM_H_ |
| OLD | NEW |