app_search_provider.h revision cedac228d2dd51db4b79ea1e72c7f249408ee061
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. 4 5#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ 6#define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ 7 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" 13 14class AppListControllerDelegate; 15class Profile; 16 17namespace extensions { 18class ExtensionSet; 19} 20 21namespace app_list { 22 23class AppSearchProvider : public SearchProvider, 24 public content::NotificationObserver { 25 public: 26 AppSearchProvider(Profile* profile, 27 AppListControllerDelegate* list_controller); 28 virtual ~AppSearchProvider(); 29 30 // SearchProvider overrides: 31 virtual void Start(const base::string16& query) OVERRIDE; 32 virtual void Stop() OVERRIDE; 33 34 private: 35 class App; 36 typedef ScopedVector<App> Apps; 37 38 // Adds extensions to apps container if they should be displayed. 39 void AddApps(const extensions::ExtensionSet& extensions); 40 void RefreshApps(); 41 42 // content::NotificationObserver overrides: 43 virtual void Observe(int type, 44 const content::NotificationSource& source, 45 const content::NotificationDetails& details) OVERRIDE; 46 47 Profile* profile_; 48 AppListControllerDelegate* list_controller_; 49 content::NotificationRegistrar registrar_; 50 51 Apps apps_; 52 53 DISALLOW_COPY_AND_ASSIGN(AppSearchProvider); 54}; 55 56} // namespace app_list 57 58#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ 59