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

Side by Side Diff: chrome/browser/thumbnails/thumbnail_list_source.h

Issue 1021803002: [Thumbnails] Injecting TopSites into ThumbnailListSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_list_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_ 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_
6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_ 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "components/history/core/browser/history_types.h" 13 #include "components/history/core/browser/history_types.h"
14 #include "content/public/browser/url_data_source.h" 14 #include "content/public/browser/url_data_source.h"
15 15
16 class Profile; 16 class Profile;
17 17
18 namespace base { 18 namespace base {
19 class RefCountedMemory; 19 class RefCountedMemory;
20 } 20 } // namespace base
Lei Zhang 2015/03/19 22:22:07 There's no need to comment when the namespace is t
huangs 2015/03/20 00:10:25 Done.
21
22 namespace history {
23 class TopSites;
24 } // namespace history
21 25
22 namespace thumbnails { 26 namespace thumbnails {
23 class ThumbnailService; 27 class ThumbnailService;
24 } 28 } // namespace thumbnails
25 29
26 // ThumbnailListSource renders a webpage to list all thumbnails stored in 30 // ThumbnailListSource renders a webpage to list all thumbnails stored in
27 // TopSites, along with all associated URLs. The thumbnail images are embedded 31 // TopSites, along with all associated URLs. The thumbnail images are embedded
28 // into the HTML via Base64, so we can easily produce a dump of TopSites and 32 // into the HTML via Base64, so we can easily produce a dump of TopSites and
29 // the thumbnails it stores. 33 // the thumbnails it stores.
30 class ThumbnailListSource : public content::URLDataSource { 34 class ThumbnailListSource : public content::URLDataSource {
31 public: 35 public:
32 explicit ThumbnailListSource(Profile* profile); 36 explicit ThumbnailListSource(Profile* profile);
33 37
34 // content::URLDataSource implementation. 38 // content::URLDataSource implementation.
(...skipping 12 matching lines...) Expand all
47 private: 51 private:
48 ~ThumbnailListSource() override; 52 ~ThumbnailListSource() override;
49 53
50 void OnMostVisitedURLsAvailable( 54 void OnMostVisitedURLsAvailable(
51 const content::URLDataSource::GotDataCallback& callback, 55 const content::URLDataSource::GotDataCallback& callback,
52 const history::MostVisitedURLList& mvurl_list); 56 const history::MostVisitedURLList& mvurl_list);
53 57
54 // ThumbnailService. 58 // ThumbnailService.
55 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_; 59 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_;
56 60
57 // Only used when servicing requests on the UI thread. 61 scoped_refptr<history::TopSites> top_sites_;
58 Profile* const profile_;
59 62
60 // For callbacks may be run after destruction. 63 // For callbacks may be run after destruction.
61 base::WeakPtrFactory<ThumbnailListSource> weak_ptr_factory_; 64 base::WeakPtrFactory<ThumbnailListSource> weak_ptr_factory_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(ThumbnailListSource); 66 DISALLOW_COPY_AND_ASSIGN(ThumbnailListSource);
64 }; 67 };
65 68
66 69
67 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_ 70 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_list_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698