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

Side by Side Diff: chrome/browser/android/ntp/most_visited_sites.h

Issue 2000653002: Replace the usage of SkBitmap with gfx::Image in the suggestion service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace SkBitmap with gfx::Image in the suggestions_service interface Created 4 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ANDROID_NTP_MOST_VISITED_SITES_H_ 5 #ifndef CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_
6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ 6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/scoped_observer.h" 18 #include "base/scoped_observer.h"
19 #include "chrome/browser/android/ntp/popular_sites.h" 19 #include "chrome/browser/android/ntp/popular_sites.h"
20 #include "components/history/core/browser/history_types.h" 20 #include "components/history/core/browser/history_types.h"
21 #include "components/history/core/browser/top_sites_observer.h" 21 #include "components/history/core/browser/top_sites_observer.h"
22 #include "components/suggestions/proto/suggestions.pb.h" 22 #include "components/suggestions/proto/suggestions.pb.h"
23 #include "components/suggestions/suggestions_service.h" 23 #include "components/suggestions/suggestions_service.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 namespace gfx {
27 class Image;
28 }
29
26 namespace history { 30 namespace history {
27 class TopSites; 31 class TopSites;
28 } 32 }
29 33
30 namespace suggestions { 34 namespace suggestions {
31 class SuggestionsService; 35 class SuggestionsService;
32 } 36 }
33 37
34 namespace user_prefs { 38 namespace user_prefs {
35 class PrefRegistrySyncable; 39 class PrefRegistrySyncable;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 const GURL& url, 217 const GURL& url,
214 const ThumbnailCallback& callback, 218 const ThumbnailCallback& callback,
215 std::unique_ptr<SkBitmap> bitmap); 219 std::unique_ptr<SkBitmap> bitmap);
216 220
217 // Callback for when the thumbnail lookup is complete. 221 // Callback for when the thumbnail lookup is complete.
218 // Runs on the UI Thread. 222 // Runs on the UI Thread.
219 void OnObtainedThumbnail( 223 void OnObtainedThumbnail(
220 bool is_local_thumbnail, 224 bool is_local_thumbnail,
221 const ThumbnailCallback& callback, 225 const ThumbnailCallback& callback,
222 const GURL& url, 226 const GURL& url,
223 const SkBitmap* bitmap); 227 const gfx::Image& bitmap);
224 228
225 // Records thumbnail-related UMA histogram metrics. 229 // Records thumbnail-related UMA histogram metrics.
226 void RecordThumbnailUMAMetrics(); 230 void RecordThumbnailUMAMetrics();
227 231
228 // Records UMA histogram metrics related to the number of impressions. 232 // Records UMA histogram metrics related to the number of impressions.
229 void RecordImpressionUMAMetrics(); 233 void RecordImpressionUMAMetrics();
230 234
231 // history::TopSitesObserver implementation. 235 // history::TopSitesObserver implementation.
232 void TopSitesLoaded(history::TopSites* top_sites) override; 236 void TopSitesLoaded(history::TopSites* top_sites) override;
233 void TopSitesChanged(history::TopSites* top_sites, 237 void TopSitesChanged(history::TopSites* top_sites,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 275
272 SuggestionsVector current_suggestions_; 276 SuggestionsVector current_suggestions_;
273 277
274 // For callbacks may be run after destruction. 278 // For callbacks may be run after destruction.
275 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; 279 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_;
276 280
277 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); 281 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites);
278 }; 282 };
279 283
280 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ 284 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/ntp/most_visited_sites.cc » ('j') | chrome/browser/android/ntp/most_visited_sites.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698