| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_AURA_SHELL_APP_LIST_APP_LIST_ITEM_MODEL_H_ | |
| 6 #define UI_AURA_SHELL_APP_LIST_APP_LIST_ITEM_MODEL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/observer_list.h" | |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | |
| 14 #include "ui/aura_shell/aura_shell_export.h" | |
| 15 | |
| 16 namespace aura_shell { | |
| 17 | |
| 18 class AppListItemModelObserver; | |
| 19 | |
| 20 // AppListItemModel provides icon and title to be shown in a TileView and | |
| 21 // action to be executed when the TileView is activated (clicked or enter | |
| 22 // key it hit). | |
| 23 class AURA_SHELL_EXPORT AppListItemModel { | |
| 24 public: | |
| 25 AppListItemModel(); | |
| 26 virtual ~AppListItemModel(); | |
| 27 | |
| 28 // Changes icon and title for the model. | |
| 29 void SetIcon(const SkBitmap& icon); | |
| 30 void SetTitle(const std::string& title); | |
| 31 | |
| 32 void AddObserver(AppListItemModelObserver* observer); | |
| 33 void RemoveObserver(AppListItemModelObserver* observer); | |
| 34 | |
| 35 const SkBitmap& icon() const { | |
| 36 return icon_; | |
| 37 } | |
| 38 | |
| 39 const std::string& title() const { | |
| 40 return title_; | |
| 41 } | |
| 42 | |
| 43 private: | |
| 44 SkBitmap icon_; | |
| 45 std::string title_; | |
| 46 | |
| 47 ObserverList<AppListItemModelObserver> observers_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); | |
| 50 }; | |
| 51 | |
| 52 } // namespace aura_shell | |
| 53 | |
| 54 #endif // #define UI_AURA_SHELL_APP_LIST_APP_LIST_ITEM_MODEL_H_ | |
| OLD | NEW |