| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" | 5 #include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 result_list->empty()) { | 132 result_list->empty()) { |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool first_result = true; | 136 bool first_result = true; |
| 137 TokenizedString query(base::UTF8ToUTF16(query_)); | 137 TokenizedString query(base::UTF8ToUTF16(query_)); |
| 138 for (base::ListValue::const_iterator it = result_list->begin(); | 138 for (base::ListValue::const_iterator it = result_list->begin(); |
| 139 it != result_list->end(); | 139 it != result_list->end(); |
| 140 ++it) { | 140 ++it) { |
| 141 const base::DictionaryValue* dict; | 141 const base::DictionaryValue* dict; |
| 142 if (!it->GetAsDictionary(&dict)) | 142 if (!(*it)->GetAsDictionary(&dict)) |
| 143 continue; | 143 continue; |
| 144 | 144 |
| 145 std::unique_ptr<SearchResult> result(CreateResult(query, *dict)); | 145 std::unique_ptr<SearchResult> result(CreateResult(query, *dict)); |
| 146 if (!result) | 146 if (!result) |
| 147 continue; | 147 continue; |
| 148 | 148 |
| 149 if (first_result) { | 149 if (first_result) { |
| 150 // Clears "search in webstore" place holder results. | 150 // Clears "search in webstore" place holder results. |
| 151 ClearResults(); | 151 ClearResults(); |
| 152 first_result = false; | 152 first_result = false; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (!match.Calculate(query, title)) | 191 if (!match.Calculate(query, title)) |
| 192 return std::unique_ptr<SearchResult>(); | 192 return std::unique_ptr<SearchResult>(); |
| 193 | 193 |
| 194 std::unique_ptr<SearchResult> result = base::MakeUnique<WebstoreResult>( | 194 std::unique_ptr<SearchResult> result = base::MakeUnique<WebstoreResult>( |
| 195 profile_, app_id, icon_url, is_paid, item_type, controller_); | 195 profile_, app_id, icon_url, is_paid, item_type, controller_); |
| 196 result->UpdateFromMatch(title, match); | 196 result->UpdateFromMatch(title, match); |
| 197 return result; | 197 return result; |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace app_list | 200 } // namespace app_list |
| OLD | NEW |