Mailbox support for texture layers.
[chromium-blink-merge.git] / ui / app_list / app_list_item_model.h
blobca382de3e4d53c238d29c7f5733e66a0ede57c30
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
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_APP_LIST_ITEM_MODEL_H_
6 #define UI_APP_LIST_APP_LIST_ITEM_MODEL_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/observer_list.h"
12 #include "ui/app_list/app_list_export.h"
13 #include "ui/gfx/image/image_skia.h"
15 namespace ui {
16 class MenuModel;
19 namespace app_list {
21 class AppListItemModelObserver;
23 // AppListItemModel provides icon and title to be shown in a AppListItemView
24 // and action to be executed when the AppListItemView is activated.
25 class APP_LIST_EXPORT AppListItemModel {
26 public:
27 AppListItemModel();
28 virtual ~AppListItemModel();
30 void SetIcon(const gfx::ImageSkia& icon);
31 const gfx::ImageSkia& icon() const { return icon_; }
33 void SetTitle(const std::string& title);
34 const std::string& title() const { return title_; }
36 void SetHighlighted(bool highlighted);
37 bool highlighted() const { return highlighted_; }
39 void AddObserver(AppListItemModelObserver* observer);
40 void RemoveObserver(AppListItemModelObserver* observer);
42 // Returns the context menu model for this item.
43 // Note the returned menu model is owned by this item.
44 virtual ui::MenuModel* GetContextMenuModel();
46 private:
47 gfx::ImageSkia icon_;
48 std::string title_;
49 bool highlighted_;
51 ObserverList<AppListItemModelObserver> observers_;
53 DISALLOW_COPY_AND_ASSIGN(AppListItemModel);
56 } // namespace app_list
58 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_