| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/search/tokenized_string.h" | 10 #include "ui/app_list/search/tokenized_string.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 for (auto& observer : observers_) | 42 for (auto& observer : observers_) |
| 43 observer.OnIconChanged(); | 43 observer.OnIconChanged(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void SearchResult::SetBadgeIcon(const gfx::ImageSkia& badge_icon) { | 46 void SearchResult::SetBadgeIcon(const gfx::ImageSkia& badge_icon) { |
| 47 badge_icon_ = badge_icon; | 47 badge_icon_ = badge_icon; |
| 48 for (auto& observer : observers_) | 48 for (auto& observer : observers_) |
| 49 observer.OnBadgeIconChanged(); | 49 observer.OnBadgeIconChanged(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void SearchResult::SetRating(float rating) { |
| 53 rating_ = rating; |
| 54 for (auto& observer : observers_) |
| 55 observer.OnRatingChanged(); |
| 56 } |
| 57 |
| 58 void SearchResult::SetFormattedPrice(const base::string16& formatted_price) { |
| 59 formatted_price_ = formatted_price; |
| 60 for (auto& observer : observers_) |
| 61 observer.OnPriceChanged(); |
| 62 } |
| 63 |
| 52 void SearchResult::SetIsMouseInView(bool mouse_is_inside) { | 64 void SearchResult::SetIsMouseInView(bool mouse_is_inside) { |
| 53 mouse_is_in_view_ = mouse_is_inside; | 65 mouse_is_in_view_ = mouse_is_inside; |
| 54 for (auto& observer : observers_) | 66 for (auto& observer : observers_) |
| 55 observer.OnViewHoverStateChanged(); | 67 observer.OnViewHoverStateChanged(); |
| 56 } | 68 } |
| 57 | 69 |
| 58 void SearchResult::SetActions(const Actions& sets) { | 70 void SearchResult::SetActions(const Actions& sets) { |
| 59 actions_ = sets; | 71 actions_ = sets; |
| 60 for (auto& observer : observers_) | 72 for (auto& observer : observers_) |
| 61 observer.OnActionsChanged(); | 73 observer.OnActionsChanged(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 166 } |
| 155 | 167 |
| 156 // Insert the delimiters (in reverse order, to preserve indices). | 168 // Insert the delimiters (in reverse order, to preserve indices). |
| 157 for (auto it = inserts.rbegin(); it != inserts.rend(); ++it) | 169 for (auto it = inserts.rbegin(); it != inserts.rend(); ++it) |
| 158 result.insert(it->first, it->second); | 170 result.insert(it->first, it->second); |
| 159 | 171 |
| 160 return result; | 172 return result; |
| 161 } | 173 } |
| 162 | 174 |
| 163 } // namespace app_list | 175 } // namespace app_list |
| OLD | NEW |