1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_vector.h"
10 #include "chrome/browser/ui/app_list/search/search_provider.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
14 class AppListControllerDelegate
;
15 class ExtensionService
;
18 namespace extensions
{
24 class AppSearchProvider
: public SearchProvider
,
25 public content::NotificationObserver
{
27 AppSearchProvider(Profile
* profile
,
28 AppListControllerDelegate
* list_controller
);
29 virtual ~AppSearchProvider();
31 // SearchProvider overrides:
32 virtual void Start(const base::string16
& query
) OVERRIDE
;
33 virtual void Stop() OVERRIDE
;
37 typedef ScopedVector
<App
> Apps
;
39 // Adds extensions to apps container if they should be displayed.
40 void AddApps(const extensions::ExtensionSet
& extensions
,
41 ExtensionService
* service
);
44 // content::NotificationObserver overrides:
45 virtual void Observe(int type
,
46 const content::NotificationSource
& source
,
47 const content::NotificationDetails
& details
) OVERRIDE
;
50 AppListControllerDelegate
* list_controller_
;
51 content::NotificationRegistrar registrar_
;
55 DISALLOW_COPY_AND_ASSIGN(AppSearchProvider
);
58 } // namespace app_list
60 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_