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/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "components/keyed_service/core/keyed_service.h" | 9 #include "components/keyed_service/core/keyed_service.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // TODO(yawano): Implement opt-in control (crbug.com/440649). | 22 // TODO(yawano): Implement opt-in control (crbug.com/440649). |
23 class Service : public KeyedService { | 23 class Service : public KeyedService { |
24 public: | 24 public: |
25 Service(Profile* profile, extensions::ExtensionRegistry* extension_registry); | 25 Service(Profile* profile, extensions::ExtensionRegistry* extension_registry); |
26 ~Service() override; | 26 ~Service() override; |
27 static Service* Get(content::BrowserContext* context); | 27 static Service* Get(content::BrowserContext* context); |
28 | 28 |
29 // Dispatches onQueryStarted events to listener extensions. | 29 // Dispatches onQueryStarted events to listener extensions. |
30 void OnQueryStarted(const std::string& query, const int max_result); | 30 void OnQueryStarted(const std::string& query, const int max_result); |
31 | 31 |
| 32 // Dispatches onQueryEnded events to listener extensions. |
| 33 void OnQueryEnded(); |
| 34 |
| 35 // Returns true if there is a running query. |
| 36 bool IsQueryRunning() const; |
| 37 |
32 private: | 38 private: |
33 // Returns extension ids of listener extensions. | 39 // Returns extension ids of listener extensions. |
34 std::set<extensions::ExtensionId> GetListenerExtensionIds(); | 40 std::set<extensions::ExtensionId> GetListenerExtensionIds(); |
35 | 41 |
36 Profile* const profile_; | 42 Profile* const profile_; |
37 extensions::ExtensionRegistry* extension_registry_; | 43 extensions::ExtensionRegistry* extension_registry_; |
38 uint32 query_id_; | 44 uint32 query_id_; |
| 45 bool is_query_running_; |
39 | 46 |
40 DISALLOW_COPY_AND_ASSIGN(Service); | 47 DISALLOW_COPY_AND_ASSIGN(Service); |
41 }; | 48 }; |
42 | 49 |
43 } // namespace launcher_search_provider | 50 } // namespace launcher_search_provider |
44 } // namespace chromeos | 51 } // namespace chromeos |
45 | 52 |
46 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ | 53 #endif // CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_ |
OLD | NEW |