| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 class AppSearchProvider : public SearchProvider, | 28 class AppSearchProvider : public SearchProvider, |
| 29 public extensions::ExtensionRegistryObserver { | 29 public extensions::ExtensionRegistryObserver { |
| 30 public: | 30 public: |
| 31 AppSearchProvider(Profile* profile, | 31 AppSearchProvider(Profile* profile, |
| 32 AppListControllerDelegate* list_controller); | 32 AppListControllerDelegate* list_controller); |
| 33 virtual ~AppSearchProvider(); | 33 virtual ~AppSearchProvider(); |
| 34 | 34 |
| 35 // SearchProvider overrides: | 35 // SearchProvider overrides: |
| 36 virtual void Start(const base::string16& query) OVERRIDE; | 36 virtual void Start(const base::string16& query) override; |
| 37 virtual void Stop() OVERRIDE; | 37 virtual void Stop() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 class App; | 40 class App; |
| 41 typedef ScopedVector<App> Apps; | 41 typedef ScopedVector<App> Apps; |
| 42 | 42 |
| 43 friend test::AppSearchProviderTest; | 43 friend test::AppSearchProviderTest; |
| 44 | 44 |
| 45 void StartImpl(const base::Time& current_time, const base::string16& query); | 45 void StartImpl(const base::Time& current_time, const base::string16& query); |
| 46 | 46 |
| 47 // Adds extensions to apps container if they should be displayed. | 47 // Adds extensions to apps container if they should be displayed. |
| 48 void AddApps(const extensions::ExtensionSet& extensions); | 48 void AddApps(const extensions::ExtensionSet& extensions); |
| 49 void RefreshApps(); | 49 void RefreshApps(); |
| 50 | 50 |
| 51 // extensions::ExtensionRegistryObserver overrides: | 51 // extensions::ExtensionRegistryObserver overrides: |
| 52 virtual void OnExtensionLoaded( | 52 virtual void OnExtensionLoaded( |
| 53 content::BrowserContext* browser_context, | 53 content::BrowserContext* browser_context, |
| 54 const extensions::Extension* extension) OVERRIDE; | 54 const extensions::Extension* extension) override; |
| 55 virtual void OnExtensionUninstalled( | 55 virtual void OnExtensionUninstalled( |
| 56 content::BrowserContext* browser_context, | 56 content::BrowserContext* browser_context, |
| 57 const extensions::Extension* extension, | 57 const extensions::Extension* extension, |
| 58 extensions::UninstallReason reason) OVERRIDE; | 58 extensions::UninstallReason reason) override; |
| 59 | 59 |
| 60 Profile* profile_; | 60 Profile* profile_; |
| 61 AppListControllerDelegate* list_controller_; | 61 AppListControllerDelegate* list_controller_; |
| 62 | 62 |
| 63 ScopedObserver<extensions::ExtensionRegistry, | 63 ScopedObserver<extensions::ExtensionRegistry, |
| 64 extensions::ExtensionRegistryObserver> | 64 extensions::ExtensionRegistryObserver> |
| 65 extension_registry_observer_; | 65 extension_registry_observer_; |
| 66 | 66 |
| 67 Apps apps_; | 67 Apps apps_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(AppSearchProvider); | 69 DISALLOW_COPY_AND_ASSIGN(AppSearchProvider); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace app_list | 72 } // namespace app_list |
| 73 | 73 |
| 74 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ | 74 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_SEARCH_PROVIDER_H_ |
| OLD | NEW |