| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/launcher_search_provider/error_reporter.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/extensions/api/launcher_search_provider.h" | 10 #include "chrome/common/extensions/api/launcher_search_provider.h" |
| 10 #include "components/keyed_service/core/keyed_service.h" | 11 #include "components/keyed_service/core/keyed_service.h" |
| 11 #include "content/public/browser/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
| 12 #include "extensions/browser/event_router.h" | 13 #include "extensions/browser/event_router.h" |
| 13 #include "extensions/common/extension.h" | 14 #include "extensions/common/extension.h" |
| 14 | 15 |
| 15 namespace app_list { | 16 namespace app_list { |
| 16 class LauncherSearchProvider; | 17 class LauncherSearchProvider; |
| 17 } // namespace app_list | 18 } // namespace app_list |
| (...skipping 25 matching lines...) Expand all Loading... |
| 43 // Dispatches onQueryEnded events to listener extensions. | 44 // Dispatches onQueryEnded events to listener extensions. |
| 44 void OnQueryEnded(); | 45 void OnQueryEnded(); |
| 45 | 46 |
| 46 // Dispatches onOpenResult event of |item_id| to |extension_id|. | 47 // Dispatches onOpenResult event of |item_id| to |extension_id|. |
| 47 void OnOpenResult(const extensions::ExtensionId& extension_id, | 48 void OnOpenResult(const extensions::ExtensionId& extension_id, |
| 48 const std::string& item_id); | 49 const std::string& item_id); |
| 49 | 50 |
| 50 // Sets search results of a listener extension. | 51 // Sets search results of a listener extension. |
| 51 void SetSearchResults( | 52 void SetSearchResults( |
| 52 const extensions::Extension* extension, | 53 const extensions::Extension* extension, |
| 54 const ErrorReporter& error_reporter, |
| 53 const std::string& query_id, | 55 const std::string& query_id, |
| 54 const std::vector<linked_ptr< | 56 const std::vector<linked_ptr< |
| 55 extensions::api::launcher_search_provider::SearchResult>>& results); | 57 extensions::api::launcher_search_provider::SearchResult>>& results); |
| 56 | 58 |
| 57 // Returns true if there is a running query. | 59 // Returns true if there is a running query. |
| 58 bool IsQueryRunning() const; | 60 bool IsQueryRunning() const; |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 // Returns extension ids of listener extensions. | 63 // Returns extension ids of listener extensions. |
| 62 std::set<extensions::ExtensionId> GetListenerExtensionIds(); | 64 std::set<extensions::ExtensionId> GetListenerExtensionIds(); |
| 63 | 65 |
| 64 Profile* const profile_; | 66 Profile* const profile_; |
| 65 extensions::ExtensionRegistry* extension_registry_; | 67 extensions::ExtensionRegistry* extension_registry_; |
| 66 app_list::LauncherSearchProvider* provider_; | 68 app_list::LauncherSearchProvider* provider_; |
| 67 uint32 query_id_; | 69 uint32 query_id_; |
| 68 bool is_query_running_; | 70 bool is_query_running_; |
| 69 | 71 |
| 70 DISALLOW_COPY_AND_ASSIGN(Service); | 72 DISALLOW_COPY_AND_ASSIGN(Service); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace launcher_search_provider | 75 } // namespace launcher_search_provider |
| 74 } // namespace chromeos | 76 } // namespace chromeos |
| 75 | 77 |
| 76 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ |
| OLD | NEW |