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