Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ash/app_list/app_list_item_model.h

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix win_aura bot and comments in #5 Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/app_list/app_list_bubble_border.cc ('k') | ash/app_list/app_list_item_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
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 "ash/ash_export.h"
15
16 namespace ui {
17 class MenuModel;
18 }
19
20 namespace ash {
21
22 class AppListItemModelObserver;
23
24 // AppListItemModel provides icon and title to be shown in a AppListItemView
25 // and action to be executed when the AppListItemView is activated.
26 class ASH_EXPORT AppListItemModel {
27 public:
28 AppListItemModel();
29 virtual ~AppListItemModel();
30
31 void SetIcon(const SkBitmap& icon);
32 const SkBitmap& icon() const {
33 return icon_;
34 }
35
36 void SetTitle(const std::string& title);
37 const std::string& title() const {
38 return title_;
39 }
40
41 void SetHighlighted(bool highlighted);
42 bool highlighted() const {
43 return highlighted_;
44 }
45
46 void AddObserver(AppListItemModelObserver* observer);
47 void RemoveObserver(AppListItemModelObserver* observer);
48
49 // Returns the context menu model for this item.
50 // Note the menu model is owned by this item.
51 virtual ui::MenuModel* GetContextMenuModel();
52
53 private:
54 SkBitmap icon_;
55 std::string title_;
56 bool highlighted_;
57
58 ObserverList<AppListItemModelObserver> observers_;
59
60 DISALLOW_COPY_AND_ASSIGN(AppListItemModel);
61 };
62
63 } // namespace ash
64
65 #endif // #define ASH_APP_LIST_APP_LIST_ITEM_MODEL_OBSERVER_H_
OLDNEW
« no previous file with comments | « ash/app_list/app_list_bubble_border.cc ('k') | ash/app_list/app_list_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698