OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SEARCH_THUMBNAIL_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ |
6 #define CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ | 6 #define CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 ThumbnailSource(Profile* profile, bool capture_thumbnails); | 40 ThumbnailSource(Profile* profile, bool capture_thumbnails); |
41 ~ThumbnailSource() override; | 41 ~ThumbnailSource() override; |
42 | 42 |
43 // content::URLDataSource implementation. | 43 // content::URLDataSource implementation. |
44 std::string GetSource() const override; | 44 std::string GetSource() const override; |
45 void StartDataRequest( | 45 void StartDataRequest( |
46 const std::string& path, | 46 const std::string& path, |
47 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 47 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
48 const content::URLDataSource::GotDataCallback& callback) override; | 48 const content::URLDataSource::GotDataCallback& callback) override; |
49 std::string GetMimeType(const std::string& path) const override; | 49 std::string GetMimeType(const std::string& path) const override; |
50 base::MessageLoop* MessageLoopForRequestPath( | 50 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( |
51 const std::string& path) const override; | 51 const std::string& path) const override; |
52 bool ShouldServiceRequest(const net::URLRequest* request) const override; | 52 bool ShouldServiceRequest(const net::URLRequest* request) const override; |
53 | 53 |
54 // Extracts the |page_url| (e.g. cnn.com) and the |fallback_thumbnail_url| | 54 // Extracts the |page_url| (e.g. cnn.com) and the |fallback_thumbnail_url| |
55 // fetchable from the server, if present, from the |path|. Visible for | 55 // fetchable from the server, if present, from the |path|. Visible for |
56 // testing. | 56 // testing. |
57 void ExtractPageAndThumbnailUrls(const std::string& path, | 57 void ExtractPageAndThumbnailUrls(const std::string& path, |
58 GURL* page_url, | 58 GURL* page_url, |
59 GURL* fallback_thumbnail_url); | 59 GURL* fallback_thumbnail_url); |
60 | 60 |
(...skipping 24 matching lines...) Expand all Loading... |
85 // existing thumbnails in the database that contain a URL matching the prefix | 85 // existing thumbnails in the database that contain a URL matching the prefix |
86 // of the requested URL. | 86 // of the requested URL. |
87 const bool capture_thumbnails_; | 87 const bool capture_thumbnails_; |
88 | 88 |
89 base::WeakPtrFactory<ThumbnailSource> weak_ptr_factory_; | 89 base::WeakPtrFactory<ThumbnailSource> weak_ptr_factory_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); | 91 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); |
92 }; | 92 }; |
93 | 93 |
94 #endif // CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ | 94 #endif // CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ |
OLD | NEW |