Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: chrome/browser/chromeos/launcher_search_provider/service.h

Issue 1071093002: Implement setSearchResults. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/launcher_search_provider/service.h
diff --git a/chrome/browser/chromeos/launcher_search_provider/service.h b/chrome/browser/chromeos/launcher_search_provider/service.h
index 27bac34e5234a8d6f4d039d63f051959083a5c80..b19fefb91990c487f880ca9f3feae93ce59047b8 100644
--- a/chrome/browser/chromeos/launcher_search_provider/service.h
+++ b/chrome/browser/chromeos/launcher_search_provider/service.h
@@ -6,14 +6,23 @@
#define CHROME_BROWSER_CHROMEOS_LAUNCHER_SEARCH_PROVIDER_SERVICE_H_
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/api/launcher_search_provider.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/event_router.h"
#include "extensions/common/extension.h"
+namespace app_list {
+class LauncherSearchProvider;
+} // namespace app_list
+
namespace chromeos {
namespace launcher_search_provider {
+// Relevance score should be provided in a range from 0 to 4. 0 is the lowest
+// relevance, 4 is the highest.
+const int kMaxSearchResultScore = 4;
+
// Manages listener extensions and routes events. Listener extensions are
// extensions which are allowed to use this API. When this API becomes public,
// this API is white listed for file manager, and opt-in for other extensions.
@@ -27,11 +36,20 @@ class Service : public KeyedService {
static Service* Get(content::BrowserContext* context);
// Dispatches onQueryStarted events to listener extensions.
- void OnQueryStarted(const std::string& query, const int max_result);
+ void OnQueryStarted(app_list::LauncherSearchProvider* provider,
+ const std::string& query,
+ const int max_result);
// Dispatches onQueryEnded events to listener extensions.
void OnQueryEnded();
+ // Sets search results of a listener extension.
+ void SetSearchResults(
+ const extensions::Extension* extension,
+ const std::string& query_id,
+ const std::vector<linked_ptr<
+ extensions::api::launcher_search_provider::SearchResult>>& results);
+
// Returns true if there is a running query.
bool IsQueryRunning() const;
@@ -41,6 +59,7 @@ class Service : public KeyedService {
Profile* const profile_;
extensions::ExtensionRegistry* extension_registry_;
+ app_list::LauncherSearchProvider* provider_;
uint32 query_id_;
bool is_query_running_;

Powered by Google App Engine
This is Rietveld 408576698