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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 // A source that suggests websites the user might find interesting. | 24 // A source that suggests websites the user might find interesting. |
25 class SuggestionsSourceDiscovery : public SuggestionsSource, | 25 class SuggestionsSourceDiscovery : public SuggestionsSource, |
26 public content::URLFetcherDelegate { | 26 public content::URLFetcherDelegate { |
27 public: | 27 public: |
28 SuggestionsSourceDiscovery(); | 28 SuggestionsSourceDiscovery(); |
29 virtual ~SuggestionsSourceDiscovery(); | 29 virtual ~SuggestionsSourceDiscovery(); |
30 | 30 |
31 // content::URLFetcherDelegate override and implementation. | 31 // content::URLFetcherDelegate override and implementation. |
32 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 32 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
33 | 33 |
34 protected: | 34 protected: |
35 // SuggestionsSource overrides: | 35 // SuggestionsSource overrides: |
36 virtual int GetWeight() OVERRIDE; | 36 virtual int GetWeight() OVERRIDE; |
37 virtual int GetItemCount() OVERRIDE; | 37 virtual int GetItemCount() OVERRIDE; |
38 virtual base::DictionaryValue* PopItem() OVERRIDE; | 38 virtual base::DictionaryValue* PopItem() OVERRIDE; |
39 virtual void FetchItems(Profile* profile) OVERRIDE; | 39 virtual void FetchItems(Profile* profile) OVERRIDE; |
40 virtual void SetCombiner(SuggestionsCombiner* combiner) OVERRIDE; | 40 virtual void SetCombiner(SuggestionsCombiner* combiner) OVERRIDE; |
41 | 41 |
42 private: | 42 private: |
43 // Our combiner. | 43 // Our combiner. |
44 SuggestionsCombiner* combiner_; | 44 SuggestionsCombiner* combiner_; |
45 | 45 |
46 // Keep the results fetched from the discovery service here. | 46 // Keep the results fetched from the discovery service here. |
47 std::deque<base::DictionaryValue*> items_; | 47 std::deque<base::DictionaryValue*> items_; |
48 | 48 |
49 // Fetcher for the recommended pages. | 49 // Fetcher for the recommended pages. |
50 scoped_ptr<content::URLFetcher> recommended_fetcher_; | 50 scoped_ptr<content::URLFetcher> recommended_fetcher_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(SuggestionsSourceDiscovery); | 52 DISALLOW_COPY_AND_ASSIGN(SuggestionsSourceDiscovery); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ | 55 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_SOURCE_DISCOVERY_H_ |
OLD | NEW |