| 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/app_search_provider.h" | 5 #include "chrome/browser/ui/app_list/search/app_search_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "extensions/browser/extension_registry.h" | 26 #include "extensions/browser/extension_registry.h" |
| 27 #include "extensions/browser/extension_system.h" | 27 #include "extensions/browser/extension_system.h" |
| 28 #include "extensions/common/extension.h" | 28 #include "extensions/common/extension.h" |
| 29 #include "extensions/common/extension_set.h" | 29 #include "extensions/common/extension_set.h" |
| 30 #include "ui/app_list/app_list_item.h" | 30 #include "ui/app_list/app_list_item.h" |
| 31 #include "ui/app_list/app_list_model.h" | 31 #include "ui/app_list/app_list_model.h" |
| 32 #include "ui/app_list/search/tokenized_string.h" | 32 #include "ui/app_list/search/tokenized_string.h" |
| 33 #include "ui/app_list/search/tokenized_string_match.h" | 33 #include "ui/app_list/search/tokenized_string_match.h" |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 36 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 37 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 37 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 38 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 38 #include "chrome/browser/ui/app_list/search/arc_app_result.h" | 39 #include "chrome/browser/ui/app_list/search/arc_app_result.h" |
| 39 #endif | 40 #endif |
| 40 | 41 |
| 41 using extensions::ExtensionRegistry; | 42 using extensions::ExtensionRegistry; |
| 42 | 43 |
| 43 namespace { | 44 namespace { |
| 44 | 45 |
| 45 // The size of each step unlaunched apps should increase their relevance by. | 46 // The size of each step unlaunched apps should increase their relevance by. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 AppListControllerDelegate* list_controller, | 252 AppListControllerDelegate* list_controller, |
| 252 std::unique_ptr<base::Clock> clock, | 253 std::unique_ptr<base::Clock> clock, |
| 253 AppListItemList* top_level_item_list) | 254 AppListItemList* top_level_item_list) |
| 254 : list_controller_(list_controller), | 255 : list_controller_(list_controller), |
| 255 top_level_item_list_(top_level_item_list), | 256 top_level_item_list_(top_level_item_list), |
| 256 clock_(std::move(clock)), | 257 clock_(std::move(clock)), |
| 257 update_results_factory_(this) { | 258 update_results_factory_(this) { |
| 258 data_sources_.push_back( | 259 data_sources_.push_back( |
| 259 std::unique_ptr<DataSource>(new ExtensionDataSource(profile, this))); | 260 std::unique_ptr<DataSource>(new ExtensionDataSource(profile, this))); |
| 260 #if defined(OS_CHROMEOS) | 261 #if defined(OS_CHROMEOS) |
| 261 if (arc::ArcSessionManager::IsAllowedForProfile(profile)) { | 262 if (arc::IsArcAllowedForProfile(profile)) { |
| 262 data_sources_.push_back( | 263 data_sources_.push_back( |
| 263 std::unique_ptr<DataSource>(new ArcDataSource(profile, this))); | 264 std::unique_ptr<DataSource>(new ArcDataSource(profile, this))); |
| 264 } | 265 } |
| 265 #endif | 266 #endif |
| 266 | 267 |
| 267 RefreshApps(); | 268 RefreshApps(); |
| 268 } | 269 } |
| 269 | 270 |
| 270 AppSearchProvider::~AppSearchProvider() {} | 271 AppSearchProvider::~AppSearchProvider() {} |
| 271 | 272 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } else { | 357 } else { |
| 357 if (!update_results_factory_.HasWeakPtrs()) { | 358 if (!update_results_factory_.HasWeakPtrs()) { |
| 358 base::ThreadTaskRunnerHandle::Get()->PostTask( | 359 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 359 FROM_HERE, base::Bind(&AppSearchProvider::UpdateResults, | 360 FROM_HERE, base::Bind(&AppSearchProvider::UpdateResults, |
| 360 update_results_factory_.GetWeakPtr())); | 361 update_results_factory_.GetWeakPtr())); |
| 361 } | 362 } |
| 362 } | 363 } |
| 363 } | 364 } |
| 364 | 365 |
| 365 } // namespace app_list | 366 } // namespace app_list |
| OLD | NEW |