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

Unified Diff: ui/app_list/search_result.h

Issue 10872099: ash: Add support for additional icons in apps search list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/app_list/search_result.h
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index f96d8d487afe4925bb980421bb5bcde5c799b0aa..fc97711317070b28501dab7de053313b767be1bb 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -45,12 +45,30 @@ class APP_LIST_EXPORT SearchResult {
};
typedef std::vector<Tag> Tags;
+ // A collection of images representing an action that can be performed on this
+ // search result.
+ struct ActionIconSet {
+ ActionIconSet(const gfx::ImageSkia& base_image,
+ const gfx::ImageSkia& hover_image,
+ const gfx::ImageSkia& pressed_image,
+ const string16& tooltip_text)
+ : base_image(base_image),
+ hover_image(hover_image),
+ pressed_image(pressed_image),
+ tooltip_text(tooltip_text) {
+ }
+
+ gfx::ImageSkia base_image;
+ gfx::ImageSkia hover_image;
+ gfx::ImageSkia pressed_image;
+
+ string16 tooltip_text;
+ };
+ typedef std::vector<ActionIconSet> ActionIconSets;
+
SearchResult();
virtual ~SearchResult();
- void AddObserver(SearchResultObserver* observer);
- void RemoveObserver(SearchResultObserver* observer);
-
const gfx::ImageSkia& icon() const { return icon_; }
void SetIcon(const gfx::ImageSkia& icon);
@@ -66,6 +84,14 @@ class APP_LIST_EXPORT SearchResult {
const Tags& details_tags() const { return details_tags_; }
void set_details_tags(const Tags& tags) { details_tags_ = tags; }
+ const ActionIconSets& action_icons() const {
+ return action_icons_;
+ }
+ void SetActionIcons(const std::vector<ActionIconSet>& sets);
xiyuan 2012/08/28 01:01:49 nit: Use ActionIconSets typedef'd above?
Daniel Erat 2012/08/28 16:45:37 Whoops, done.
+
+ void AddObserver(SearchResultObserver* observer);
+ void RemoveObserver(SearchResultObserver* observer);
+
private:
gfx::ImageSkia icon_;
@@ -75,6 +101,10 @@ class APP_LIST_EXPORT SearchResult {
string16 details_;
Tags details_tags_;
+ // Optional list of icons representing additional actions that can be
+ // performed on this result.
+ ActionIconSets action_icons_;
+
ObserverList<SearchResultObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(SearchResult);

Powered by Google App Engine
This is Rietveld 408576698