OLD | NEW |
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 #include "ui/app_list/search_result.h" | 5 #include "ui/app_list/search_result.h" |
6 | 6 |
7 #include "ui/app_list/search_result_observer.h" | 7 #include "ui/app_list/search_result_observer.h" |
8 | 8 |
9 namespace app_list { | 9 namespace app_list { |
10 | 10 |
11 SearchResult::Action::Action(const gfx::ImageSkia& base_image, | 11 SearchResult::Action::Action(const gfx::ImageSkia& base_image, |
12 const gfx::ImageSkia& hover_image, | 12 const gfx::ImageSkia& hover_image, |
13 const gfx::ImageSkia& pressed_image, | 13 const gfx::ImageSkia& pressed_image, |
14 const base::string16& tooltip_text) | 14 const base::string16& tooltip_text) |
15 : base_image(base_image), | 15 : base_image(base_image), |
16 hover_image(hover_image), | 16 hover_image(hover_image), |
17 pressed_image(pressed_image), | 17 pressed_image(pressed_image), |
18 tooltip_text(tooltip_text) {} | 18 tooltip_text(tooltip_text) {} |
19 | 19 |
20 SearchResult::Action::Action(const base::string16& label_text, | 20 SearchResult::Action::Action(const base::string16& label_text, |
21 const base::string16& tooltip_text) | 21 const base::string16& tooltip_text) |
22 : tooltip_text(tooltip_text), | 22 : tooltip_text(tooltip_text), |
23 label_text(label_text) {} | 23 label_text(label_text) {} |
24 | 24 |
25 SearchResult::Action::~Action() {} | 25 SearchResult::Action::~Action() {} |
26 | 26 |
27 SearchResult::SearchResult() | 27 SearchResult::SearchResult() |
28 : relevance_(0), is_installing_(false), percent_downloaded_(0) { | 28 : relevance_(0), |
| 29 display_type_(DISPLAY_LIST), |
| 30 is_installing_(false), |
| 31 percent_downloaded_(0) { |
29 } | 32 } |
30 | 33 |
31 SearchResult::~SearchResult() {} | 34 SearchResult::~SearchResult() { |
| 35 FOR_EACH_OBSERVER(SearchResultObserver, observers_, OnResultDestroying()); |
| 36 } |
32 | 37 |
33 void SearchResult::SetIcon(const gfx::ImageSkia& icon) { | 38 void SearchResult::SetIcon(const gfx::ImageSkia& icon) { |
34 icon_ = icon; | 39 icon_ = icon; |
35 FOR_EACH_OBSERVER(SearchResultObserver, | 40 FOR_EACH_OBSERVER(SearchResultObserver, |
36 observers_, | 41 observers_, |
37 OnIconChanged()); | 42 OnIconChanged()); |
38 } | 43 } |
39 | 44 |
40 void SearchResult::SetActions(const Actions& sets) { | 45 void SearchResult::SetActions(const Actions& sets) { |
41 actions_ = sets; | 46 actions_ = sets; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 89 } |
85 | 90 |
86 void SearchResult::InvokeAction(int action_index, int event_flags) { | 91 void SearchResult::InvokeAction(int action_index, int event_flags) { |
87 } | 92 } |
88 | 93 |
89 ui::MenuModel* SearchResult::GetContextMenuModel() { | 94 ui::MenuModel* SearchResult::GetContextMenuModel() { |
90 return NULL; | 95 return NULL; |
91 } | 96 } |
92 | 97 |
93 } // namespace app_list | 98 } // namespace app_list |
OLD | NEW |