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

Unified Diff: athena/main/url_search_provider.h

Issue 438023002: Add search suggestions fetched from the server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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: athena/main/url_search_provider.h
diff --git a/athena/main/url_search_provider.h b/athena/main/url_search_provider.h
index d7c9177c57081fd88d77f2e2b433d45175baa60a..1d8406c699ba4190c555cd13fe67b60fc26d4f50 100644
--- a/athena/main/url_search_provider.h
+++ b/athena/main/url_search_provider.h
@@ -6,6 +6,8 @@
#define ATHENA_MAIN_URL_SEARCH_PROVIDER_H_
#include "base/memory/scoped_ptr.h"
+#include "components/autocomplete/autocomplete_input.h"
+#include "net/url_request/url_fetcher_delegate.h"
#include "ui/app_list/search_provider.h"
class TemplateURLService;
@@ -17,7 +19,8 @@ class BrowserContext;
namespace athena {
// A sample search provider.
-class UrlSearchProvider : public app_list::SearchProvider {
+class UrlSearchProvider : public app_list::SearchProvider,
+ public net::URLFetcherDelegate {
public:
UrlSearchProvider(content::BrowserContext* browser_context);
virtual ~UrlSearchProvider();
@@ -26,12 +29,21 @@ class UrlSearchProvider : public app_list::SearchProvider {
virtual void Start(const base::string16& query) OVERRIDE;
virtual void Stop() OVERRIDE;
+ // Overridden from net::URLFetcherDelegate.
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
private:
+ void StartFetchingSuggestions();
+
content::BrowserContext* browser_context_;
// TODO(mukai): This should be provided through BrowserContextKeyedService.
scoped_ptr<TemplateURLService> template_url_service_;
+ AutocompleteInput input_;
+ scoped_ptr<net::URLFetcher> suggestion_fetcher_;
+ bool should_fetch_suggestions_again_;
+
DISALLOW_COPY_AND_ASSIGN(UrlSearchProvider);
};

Powered by Google App Engine
This is Rietveld 408576698