| 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.OnFormattedPriceChanged(); | |
| 62 } | |
| 63 | |
| 64 void SearchResult::SetIsMouseInView(bool mouse_is_inside) { | 52 void SearchResult::SetIsMouseInView(bool mouse_is_inside) { |
| 65 mouse_is_in_view_ = mouse_is_inside; | 53 mouse_is_in_view_ = mouse_is_inside; |
| 66 for (auto& observer : observers_) | 54 for (auto& observer : observers_) |
| 67 observer.OnViewHoverStateChanged(); | 55 observer.OnViewHoverStateChanged(); |
| 68 } | 56 } |
| 69 | 57 |
| 70 void SearchResult::SetActions(const Actions& sets) { | 58 void SearchResult::SetActions(const Actions& sets) { |
| 71 actions_ = sets; | 59 actions_ = sets; |
| 72 for (auto& observer : observers_) | 60 for (auto& observer : observers_) |
| 73 observer.OnActionsChanged(); | 61 observer.OnActionsChanged(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 154 } |
| 167 | 155 |
| 168 // Insert the delimiters (in reverse order, to preserve indices). | 156 // Insert the delimiters (in reverse order, to preserve indices). |
| 169 for (auto it = inserts.rbegin(); it != inserts.rend(); ++it) | 157 for (auto it = inserts.rbegin(); it != inserts.rend(); ++it) |
| 170 result.insert(it->first, it->second); | 158 result.insert(it->first, it->second); |
| 171 | 159 |
| 172 return result; | 160 return result; |
| 173 } | 161 } |
| 174 | 162 |
| 175 } // namespace app_list | 163 } // namespace app_list |
| OLD | NEW |