1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ATHENA_MAIN_URL_SEARCH_PROVIDER_H_
6 #define ATHENA_MAIN_URL_SEARCH_PROVIDER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/omnibox/autocomplete_input.h"
10 #include "net/url_request/url_fetcher_delegate.h"
11 #include "ui/app_list/search_provider.h"
13 class TemplateURLService
;
21 // A sample search provider.
22 class UrlSearchProvider
: public app_list::SearchProvider
,
23 public net::URLFetcherDelegate
{
25 UrlSearchProvider(content::BrowserContext
* browser_context
);
26 virtual ~UrlSearchProvider();
28 // Overridden from app_list::SearchProvider
29 virtual void Start(const base::string16
& query
) OVERRIDE
;
30 virtual void Stop() OVERRIDE
;
32 // Overridden from net::URLFetcherDelegate.
33 virtual void OnURLFetchComplete(const net::URLFetcher
* source
) OVERRIDE
;
36 void StartFetchingSuggestions();
38 content::BrowserContext
* browser_context_
;
40 // TODO(mukai): This should be provided through BrowserContextKeyedService.
41 scoped_ptr
<TemplateURLService
> template_url_service_
;
43 AutocompleteInput input_
;
44 scoped_ptr
<net::URLFetcher
> suggestion_fetcher_
;
45 bool should_fetch_suggestions_again_
;
47 DISALLOW_COPY_AND_ASSIGN(UrlSearchProvider
);
52 #endif // ATHENA_MAIN_URL_SEARCH_PROVIDER_H_