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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" | 8 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" |
9 #include "chrome/browser/chromeos/launcher_search_provider/service.h" | 9 #include "chrome/browser/chromeos/launcher_search_provider/launcher_search_provi
der_service.h" |
10 #include "chrome/common/extensions/api/launcher_search_provider.h" | 10 #include "chrome/common/extensions/api/launcher_search_provider.h" |
11 #include "content/public/browser/render_frame_host.h" | 11 #include "content/public/browser/render_frame_host.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 LauncherSearchProviderSetSearchResultsFunction:: | 15 LauncherSearchProviderSetSearchResultsFunction:: |
16 ~LauncherSearchProviderSetSearchResultsFunction() { | 16 ~LauncherSearchProviderSetSearchResultsFunction() { |
17 } | 17 } |
18 | 18 |
19 bool LauncherSearchProviderSetSearchResultsFunction::RunSync() { | 19 bool LauncherSearchProviderSetSearchResultsFunction::RunSync() { |
20 using chromeos::launcher_search_provider::ErrorReporter; | 20 using chromeos::launcher_search_provider::ErrorReporter; |
21 using chromeos::launcher_search_provider::Service; | 21 using chromeos::launcher_search_provider::Service; |
22 using extensions::api::launcher_search_provider::SetSearchResults::Params; | 22 using extensions::api::launcher_search_provider::SetSearchResults::Params; |
23 const scoped_ptr<Params> params(Params::Create(*args_)); | 23 const scoped_ptr<Params> params(Params::Create(*args_)); |
24 EXTENSION_FUNCTION_VALIDATE(params); | 24 EXTENSION_FUNCTION_VALIDATE(params); |
25 DCHECK(render_frame_host()); | 25 DCHECK(render_frame_host()); |
26 | 26 |
27 scoped_ptr<ErrorReporter> error_reporter( | 27 scoped_ptr<ErrorReporter> error_reporter( |
28 new ErrorReporter(render_frame_host())); | 28 new ErrorReporter(render_frame_host())); |
29 Service* const service = Service::Get(GetProfile()); | 29 Service* const service = Service::Get(GetProfile()); |
30 service->SetSearchResults(extension(), error_reporter.Pass(), | 30 service->SetSearchResults(extension(), error_reporter.Pass(), |
31 params->query_id, params->results); | 31 params->query_id, params->results); |
32 | 32 |
33 return true; | 33 return true; |
34 } | 34 } |
35 | 35 |
36 } // namespace extensions | 36 } // namespace extensions |
OLD | NEW |