OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 | 10 |
11 #include "chrome/browser/cancelable_request.h" | 11 #include "chrome/browser/cancelable_request.h" |
12 #include "chrome/browser/history/history_types.h" | 12 #include "chrome/browser/history/history_types.h" |
13 #include "chrome/browser/ui/webui/ntp/suggestions_source.h" | 13 #include "chrome/browser/ui/webui/ntp/suggestions_source.h" |
14 #include "content/public/common/url_fetcher_delegate.h" | 14 #include "net/url_request/url_fetcher_delegate.h" |
15 | 15 |
16 class SuggestionsCombiner; | 16 class SuggestionsCombiner; |
17 class Profile; | 17 class Profile; |
18 class URLFetcher; | 18 class URLFetcher; |
wtc
2012/05/22 17:26:38
Should we delete this forward declaration?
akalin
2012/05/22 21:07:05
Done.
| |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class DictionaryValue; | 21 class DictionaryValue; |
22 } | 22 } |
23 | 23 |
24 namespace net { | |
25 class URLFetcher; | |
26 } | |
27 | |
24 // A source that suggests websites the user might find interesting. | 28 // A source that suggests websites the user might find interesting. |
25 class SuggestionsSourceDiscovery : public SuggestionsSource, | 29 class SuggestionsSourceDiscovery : public SuggestionsSource, |
26 public content::URLFetcherDelegate { | 30 public net::URLFetcherDelegate { |
27 public: | 31 public: |
28 SuggestionsSourceDiscovery(); | 32 SuggestionsSourceDiscovery(); |
29 virtual ~SuggestionsSourceDiscovery(); | 33 virtual ~SuggestionsSourceDiscovery(); |
30 | 34 |
31 // content::URLFetcherDelegate override and implementation. | 35 // net::URLFetcherDelegate override and implementation. |
32 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 36 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
33 | 37 |
34 protected: | 38 protected: |
35 // SuggestionsSource overrides: | 39 // SuggestionsSource overrides: |
36 virtual int GetWeight() OVERRIDE; | 40 virtual int GetWeight() OVERRIDE; |
37 virtual int GetItemCount() OVERRIDE; | 41 virtual int GetItemCount() OVERRIDE; |
38 virtual base::DictionaryValue* PopItem() OVERRIDE; | 42 virtual base::DictionaryValue* PopItem() OVERRIDE; |
39 virtual void FetchItems(Profile* profile) OVERRIDE; | 43 virtual void FetchItems(Profile* profile) OVERRIDE; |
40 virtual void SetCombiner(SuggestionsCombiner* combiner) OVERRIDE; | 44 virtual void SetCombiner(SuggestionsCombiner* combiner) OVERRIDE; |
41 | 45 |
42 private: | 46 private: |
43 // Our combiner. | 47 // Our combiner. |
44 SuggestionsCombiner* combiner_; | 48 SuggestionsCombiner* combiner_; |
45 | 49 |
46 // Keep the results fetched from the discovery service here. | 50 // Keep the results fetched from the discovery service here. |
47 std::deque<base::DictionaryValue*> items_; | 51 std::deque<base::DictionaryValue*> items_; |
48 | 52 |
49 // Fetcher for the recommended pages. | 53 // Fetcher for the recommended pages. |
50 scoped_ptr<content::URLFetcher> recommended_fetcher_; | 54 scoped_ptr<net::URLFetcher> recommended_fetcher_; |
51 | 55 |
52 DISALLOW_COPY_AND_ASSIGN(SuggestionsSourceDiscovery); | 56 DISALLOW_COPY_AND_ASSIGN(SuggestionsSourceDiscovery); |
53 }; | 57 }; |
54 | 58 |
55 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ | 59 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ |
OLD | NEW |