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

Side by Side Diff: chrome/browser/ui/webui/ntp/suggestions_combiner.h

Issue 10438004: Hooking the discovery API to the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added OWNERS for experimental discovery api. Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_COMBINER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_COMBINER_H_
6 #define CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_COMBINER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_COMBINER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Called by a source when its items are ready. Make sure suggestion sources 47 // Called by a source when its items are ready. Make sure suggestion sources
48 // call this method exactly once for each call to 48 // call this method exactly once for each call to
49 // SuggestionsSource::FetchItems. 49 // SuggestionsSource::FetchItems.
50 void OnItemsReady(); 50 void OnItemsReady();
51 51
52 void SetSuggestionsCount(size_t suggestions_count); 52 void SetSuggestionsCount(size_t suggestions_count);
53 53
54 // Creates a new instance of the SuggestionsCombiner (owned by the callee), 54 // Creates a new instance of the SuggestionsCombiner (owned by the callee),
55 // and sets up the default sources. 55 // and sets up the default sources.
56 static SuggestionsCombiner* Create(SuggestionsCombiner::Delegate* delegate); 56 static SuggestionsCombiner* Create(SuggestionsCombiner::Delegate* delegate,
57 Profile* profile);
57 58
58 private: 59 private:
59 friend class SuggestionsCombinerTest; 60 friend class SuggestionsCombinerTest;
60 61
61 explicit SuggestionsCombiner(SuggestionsCombiner::Delegate* delegate); 62 explicit SuggestionsCombiner(SuggestionsCombiner::Delegate* delegate);
62 63
63 // Fill the page values from the suggestion sources so they can be sent to 64 // Fill the page values from the suggestion sources so they can be sent to
64 // the JavaScript side. This should only be called when all the suggestion 65 // the JavaScript side. This should only be called when all the suggestion
65 // sources have items ready. 66 // sources have items ready.
66 void FillPageValues(); 67 void FillPageValues();
(...skipping 15 matching lines...) Expand all
82 // between the various sources. 83 // between the various sources.
83 size_t suggestions_count_; 84 size_t suggestions_count_;
84 85
85 // Informations to send to the javascript side. 86 // Informations to send to the javascript side.
86 scoped_ptr<base::ListValue> page_values_; 87 scoped_ptr<base::ListValue> page_values_;
87 88
88 DISALLOW_COPY_AND_ASSIGN(SuggestionsCombiner); 89 DISALLOW_COPY_AND_ASSIGN(SuggestionsCombiner);
89 }; 90 };
90 91
91 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_COMBINER_H_ 92 #endif // CHROME_BROWSER_UI_WEBUI_NTP_SUGGESTIONS_COMBINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698