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

Side by Side Diff: components/suggestions/suggestions_service.h

Issue 1314493013: Popular sites on the NTP: add thumbnails! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android_clang_dbg_recipe build Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ 5 #ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_
6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ 6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // 66 //
67 // If state allows for a network request, it is initiated unless a pending one 67 // If state allows for a network request, it is initiated unless a pending one
68 // exists, to fill the cache for next time. 68 // exists, to fill the cache for next time.
69 void FetchSuggestionsData(SyncState sync_state, 69 void FetchSuggestionsData(SyncState sync_state,
70 ResponseCallback callback); 70 ResponseCallback callback);
71 71
72 // Retrieves stored thumbnail for website |url| asynchronously. Calls 72 // Retrieves stored thumbnail for website |url| asynchronously. Calls
73 // |callback| with Bitmap pointer if found, and NULL otherwise. 73 // |callback| with Bitmap pointer if found, and NULL otherwise.
74 void GetPageThumbnail( 74 void GetPageThumbnail(
75 const GURL& url, 75 const GURL& url,
76 base::Callback<void(const GURL&, const SkBitmap*)> callback); 76 const base::Callback<void(const GURL&, const SkBitmap*)>& callback);
77
78 // A version of |GetPageThumbnail| that explicitly supplies the download URL
79 // for the thumbnail. Replaces any pre-existing thumbnail URL with the
80 // supplied one.
81 void GetPageThumbnailWithURL(
82 const GURL& url,
83 const GURL& thumbnail_url,
84 const base::Callback<void(const GURL&, const SkBitmap*)>& callback);
77 85
78 // Adds a URL to the blacklist cache, invoking |callback| on success or 86 // Adds a URL to the blacklist cache, invoking |callback| on success or
79 // |fail_callback| otherwise. The URL will eventually be uploaded to the 87 // |fail_callback| otherwise. The URL will eventually be uploaded to the
80 // server. 88 // server.
81 void BlacklistURL(const GURL& candidate_url, 89 void BlacklistURL(const GURL& candidate_url,
82 const ResponseCallback& callback, 90 const ResponseCallback& callback,
83 const base::Closure& fail_callback); 91 const base::Closure& fail_callback);
84 92
85 // Removes a URL from the local blacklist, then invokes |callback|. If the URL 93 // Removes a URL from the local blacklist, then invokes |callback|. If the URL
86 // cannot be removed, the |fail_callback| is called. 94 // cannot be removed, the |fail_callback| is called.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 195
188 // For callbacks may be run after destruction. 196 // For callbacks may be run after destruction.
189 base::WeakPtrFactory<SuggestionsService> weak_ptr_factory_; 197 base::WeakPtrFactory<SuggestionsService> weak_ptr_factory_;
190 198
191 DISALLOW_COPY_AND_ASSIGN(SuggestionsService); 199 DISALLOW_COPY_AND_ASSIGN(SuggestionsService);
192 }; 200 };
193 201
194 } // namespace suggestions 202 } // namespace suggestions
195 203
196 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ 204 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_
OLDNEW
« no previous file with comments | « components/suggestions/image_manager_unittest.cc ('k') | components/suggestions/suggestions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698