| 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 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 std::string GetSource() const override; | 35 std::string GetSource() const override; |
| 36 // Called on the IO thread. | 36 // Called on the IO thread. |
| 37 void StartDataRequest( | 37 void StartDataRequest( |
| 38 const std::string& path, | 38 const std::string& path, |
| 39 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 39 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 40 const content::URLDataSource::GotDataCallback& callback) override; | 40 const content::URLDataSource::GotDataCallback& callback) override; |
| 41 | 41 |
| 42 std::string GetMimeType(const std::string& path) const override; | 42 std::string GetMimeType(const std::string& path) const override; |
| 43 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( | 43 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( |
| 44 const std::string& path) const override; | 44 const std::string& path) const override; |
| 45 bool ShouldServiceRequest(const net::URLRequest* request) const override; | 45 bool ShouldServiceRequest(const GURL& url, |
| 46 content::ResourceContext* resource_context, |
| 47 int render_process_id) const override; |
| 46 bool ShouldReplaceExistingSource() const override; | 48 bool ShouldReplaceExistingSource() const override; |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 ~ThumbnailListSource() override; | 51 ~ThumbnailListSource() override; |
| 50 | 52 |
| 51 // Called on the IO thread. | 53 // Called on the IO thread. |
| 52 void OnMostVisitedURLsAvailable( | 54 void OnMostVisitedURLsAvailable( |
| 53 const content::URLDataSource::GotDataCallback& callback, | 55 const content::URLDataSource::GotDataCallback& callback, |
| 54 const history::MostVisitedURLList& mvurl_list); | 56 const history::MostVisitedURLList& mvurl_list); |
| 55 | 57 |
| 56 // ThumbnailService. | 58 // ThumbnailService. |
| 57 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_; | 59 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_; |
| 58 | 60 |
| 59 scoped_refptr<history::TopSites> top_sites_; | 61 scoped_refptr<history::TopSites> top_sites_; |
| 60 | 62 |
| 61 // For callbacks may be run after destruction. | 63 // For callbacks may be run after destruction. |
| 62 base::WeakPtrFactory<ThumbnailListSource> weak_ptr_factory_; | 64 base::WeakPtrFactory<ThumbnailListSource> weak_ptr_factory_; |
| 63 | 65 |
| 64 DISALLOW_COPY_AND_ASSIGN(ThumbnailListSource); | 66 DISALLOW_COPY_AND_ASSIGN(ThumbnailListSource); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 | 69 |
| 68 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_ | 70 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_LIST_SOURCE_H_ |
| OLD | NEW |