Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 base::Callback<void(const GURL&, const SkBitmap*)> callback); |
| 77 | 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 base::Callback<void(const GURL&, const SkBitmap*)> callback); | |
|
Bernhard Bauer
2015/09/04 13:42:41
Pass the callback by const reference?
Marc Treib
2015/09/04 13:49:03
Done.
I was just blindly copying GetPageThumbnail
| |
| 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. |
| 87 void UndoBlacklistURL(const GURL& url, | 95 void UndoBlacklistURL(const GURL& url, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_ |
| OLD | NEW |