OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/extensions/launcher_search_provider.h" | 5 #include "chrome/browser/chromeos/extensions/launcher_search_provider.h" |
6 | 6 |
| 7 #include "chrome/browser/chromeos/launcher_search_provider/service.h" |
| 8 #include "chrome/common/extensions/api/launcher_search_provider.h" |
| 9 |
7 namespace extensions { | 10 namespace extensions { |
8 | 11 |
9 LauncherSearchProviderSetSearchResultsFunction:: | 12 LauncherSearchProviderSetSearchResultsFunction:: |
10 ~LauncherSearchProviderSetSearchResultsFunction() { | 13 ~LauncherSearchProviderSetSearchResultsFunction() { |
11 } | 14 } |
12 | 15 |
13 bool LauncherSearchProviderSetSearchResultsFunction::RunSync() { | 16 bool LauncherSearchProviderSetSearchResultsFunction::RunSync() { |
14 // TODO(yawano): Implement this (crbug.com/440649). | 17 using chromeos::launcher_search_provider::Service; |
15 NOTREACHED(); | 18 using extensions::api::launcher_search_provider::SetSearchResults::Params; |
16 return false; | 19 const scoped_ptr<Params> params(Params::Create(*args_)); |
| 20 EXTENSION_FUNCTION_VALIDATE(params); |
| 21 |
| 22 Service* const service = Service::Get(GetProfile()); |
| 23 service->SetSearchResults(extension(), params->query_id, params->results); |
| 24 |
| 25 return true; |
17 } | 26 } |
18 | 27 |
19 } // namespace extensions | 28 } // namespace extensions |
OLD | NEW |