| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "athena/extensions/shell/shell_search_controller_factory.h" | |
| 6 | |
| 7 #include "athena/extensions/shell/url_search_provider.h" | |
| 8 #include "ui/app_list/search_controller.h" | |
| 9 | |
| 10 namespace athena { | |
| 11 | |
| 12 ShellSearchControllerFactory::ShellSearchControllerFactory( | |
| 13 content::BrowserContext* browser_context) | |
| 14 : browser_context_(browser_context) { | |
| 15 } | |
| 16 | |
| 17 ShellSearchControllerFactory::~ShellSearchControllerFactory() { | |
| 18 } | |
| 19 | |
| 20 scoped_ptr<app_list::SearchController> ShellSearchControllerFactory::Create( | |
| 21 app_list::SearchBoxModel* search_box, | |
| 22 app_list::AppListModel::SearchResults* results) { | |
| 23 scoped_ptr<app_list::SearchController> controller( | |
| 24 new app_list::SearchController( | |
| 25 search_box, results, nullptr /* no history */)); | |
| 26 controller->AddProvider(app_list::Mixer::MAIN_GROUP, | |
| 27 scoped_ptr<app_list::SearchProvider>( | |
| 28 new UrlSearchProvider(browser_context_))); | |
| 29 return controller.Pass(); | |
| 30 } | |
| 31 | |
| 32 scoped_ptr<SearchControllerFactory> CreateSearchControllerFactory( | |
| 33 content::BrowserContext* context) { | |
| 34 return make_scoped_ptr(new ShellSearchControllerFactory(context)); | |
| 35 } | |
| 36 | |
| 37 } // namespace athena | |
| OLD | NEW |