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

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

Issue 25859005: Elim ActivateAppListItem, ChromeAppListItem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix static cast in AppModelBuilder, add AppType Created 7 years, 2 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
OLDNEW
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_ITEM_MODEL_H_ 5 #ifndef UI_APP_LIST_APP_LIST_ITEM_MODEL_H_
6 #define UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ 6 #define UI_APP_LIST_APP_LIST_ITEM_MODEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 void SetPercentDownloaded(int percent_downloaded); 45 void SetPercentDownloaded(int percent_downloaded);
46 int percent_downloaded() const { return percent_downloaded_; } 46 int percent_downloaded() const { return percent_downloaded_; }
47 47
48 void set_app_id(const std::string& app_id) { app_id_ = app_id; } 48 void set_app_id(const std::string& app_id) { app_id_ = app_id; }
49 const std::string& app_id() { return app_id_; } 49 const std::string& app_id() { return app_id_; }
50 50
51 void AddObserver(AppListItemModelObserver* observer); 51 void AddObserver(AppListItemModelObserver* observer);
52 void RemoveObserver(AppListItemModelObserver* observer); 52 void RemoveObserver(AppListItemModelObserver* observer);
53 53
54 // Returns a string identifier for the subclass (defaults to "").
55 virtual std::string AppType() const;
56
57 // Activates (opens) the item. Does nothing by default.
58 virtual void Activate(int event_flags);
59
60 // Updates the item (called when the model may have changed).
61 virtual void Update();
62
54 // Returns the context menu model for this item, or NULL if there is currently 63 // Returns the context menu model for this item, or NULL if there is currently
55 // no menu for the item (e.g. during install). 64 // no menu for the item (e.g. during install).
56 // Note the returned menu model is owned by this item. 65 // Note the returned menu model is owned by this item.
57 virtual ui::MenuModel* GetContextMenuModel(); 66 virtual ui::MenuModel* GetContextMenuModel();
58 67
59 private: 68 private:
60 gfx::ImageSkia icon_; 69 gfx::ImageSkia icon_;
61 bool has_shadow_; 70 bool has_shadow_;
62 std::string title_; 71 std::string title_;
63 std::string full_name_; 72 std::string full_name_;
64 bool highlighted_; 73 bool highlighted_;
65 bool is_installing_; 74 bool is_installing_;
66 int percent_downloaded_; 75 int percent_downloaded_;
67 std::string app_id_; 76 std::string app_id_;
68 77
69 ObserverList<AppListItemModelObserver> observers_; 78 ObserverList<AppListItemModelObserver> observers_;
70 79
71 DISALLOW_COPY_AND_ASSIGN(AppListItemModel); 80 DISALLOW_COPY_AND_ASSIGN(AppListItemModel);
72 }; 81 };
73 82
74 } // namespace app_list 83 } // namespace app_list
75 84
76 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_ 85 #endif // UI_APP_LIST_APP_LIST_ITEM_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698