Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / athena / extensions / chrome / chrome_search_controller_factory.cc
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/chrome/chrome_search_controller_factory.h"
6
7 #include "athena/extensions/chrome/app_list_controller_delegate_athena.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_list/search/search_controller_factory.h"
10
11 namespace athena {
12
13 ChromeSearchControllerFactory::ChromeSearchControllerFactory(
14     content::BrowserContext* browser_context)
15     : browser_context_(browser_context) {
16 }
17
18 ChromeSearchControllerFactory::~ChromeSearchControllerFactory() {
19 }
20
21 scoped_ptr<app_list::SearchController> ChromeSearchControllerFactory::Create(
22     app_list::SearchBoxModel* search_box,
23     app_list::AppListModel::SearchResults* results) {
24   list_controller_.reset(new AppListControllerDelegateAthena());
25   return app_list::CreateSearchController(
26       Profile::FromBrowserContext(browser_context_),
27       search_box,
28       results,
29       list_controller_.get());
30 }
31
32 scoped_ptr<SearchControllerFactory> CreateSearchControllerFactory(
33     content::BrowserContext* context) {
34   return make_scoped_ptr(new ChromeSearchControllerFactory(context));
35 }
36
37 }  // namespace athena