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

Unified Diff: chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.h

Issue 775893005: [AppList] Add a Suggestions Provider to applist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 6 years 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/ui/app_list/search/suggestions/suggestions_search_provider.h
diff --git a/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.h b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..af935ed4ac0fc18412f465f3961b1826b1c37150
--- /dev/null
+++ b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.h
@@ -0,0 +1,50 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_SEARCH_PROVIDER_H_
+#define CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_SEARCH_PROVIDER_H_
+
+#include "base/basictypes.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "ui/app_list/search_provider.h"
+
+class AppListControllerDelegate;
+class Profile;
+
+namespace suggestions {
+class SuggestionsProfile;
+class SuggestionsService;
+} // namespace suggestions
+
+namespace app_list {
+
+class SuggestionsSearchProvider : public SearchProvider {
+ public:
+ SuggestionsSearchProvider(Profile* profile,
+ AppListControllerDelegate* list_controller);
+ ~SuggestionsSearchProvider() override;
+
+ // SearchProvider overrides:
+ void Start(const base::string16& query) override;
+ void Stop() override;
+
+ private:
+ // Called when suggestions are available from the SuggestionsService.
+ void OnSuggestionsProfileAvailable(
+ const suggestions::SuggestionsProfile& suggestions_profile);
+
+ Profile* profile_;
+ AppListControllerDelegate* list_controller_;
+ suggestions::SuggestionsService* suggestions_service_;
+
+ // For callbacks may be run after destruction.
+ base::WeakPtrFactory<SuggestionsSearchProvider> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SuggestionsSearchProvider);
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_SEARCH_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698