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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // content::URLDataSource implementation. | 34 // content::URLDataSource implementation. |
35 std::string GetSource() const override; | 35 std::string GetSource() const override; |
36 void StartDataRequest( | 36 void StartDataRequest( |
37 const std::string& path, | 37 const std::string& path, |
38 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 38 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
39 const content::URLDataSource::GotDataCallback& callback) override; | 39 const content::URLDataSource::GotDataCallback& callback) override; |
40 std::string GetMimeType(const std::string& path) const override; | 40 std::string GetMimeType(const std::string& path) const override; |
41 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( | 41 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( |
42 const std::string& path) const override; | 42 const std::string& path) const override; |
43 bool AllowCaching() const override; | 43 bool AllowCaching() const override; |
44 bool ShouldServiceRequest(const net::URLRequest* request) const override; | 44 bool ShouldServiceRequest(const GURL& url, |
| 45 content::ResourceContext* resource_context, |
| 46 int render_process_id) const override; |
45 | 47 |
46 // Extracts the |page_url| (e.g. cnn.com) and the |fallback_thumbnail_url| | 48 // Extracts the |page_url| (e.g. cnn.com) and the |fallback_thumbnail_url| |
47 // fetchable from the server, if present, from the |path|. Visible for | 49 // fetchable from the server, if present, from the |path|. Visible for |
48 // testing. | 50 // testing. |
49 void ExtractPageAndThumbnailUrls(const std::string& path, | 51 void ExtractPageAndThumbnailUrls(const std::string& path, |
50 GURL* page_url, | 52 GURL* page_url, |
51 GURL* fallback_thumbnail_url); | 53 GURL* fallback_thumbnail_url); |
52 | 54 |
53 private: | 55 private: |
54 void SendFetchedUrlImage( | 56 void SendFetchedUrlImage( |
(...skipping 14 matching lines...) Expand all Loading... |
69 const bool capture_thumbnails_; | 71 const bool capture_thumbnails_; |
70 | 72 |
71 image_fetcher::ImageDataFetcher image_data_fetcher_; | 73 image_fetcher::ImageDataFetcher image_data_fetcher_; |
72 | 74 |
73 base::WeakPtrFactory<ThumbnailSource> weak_ptr_factory_; | 75 base::WeakPtrFactory<ThumbnailSource> weak_ptr_factory_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); | 77 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); |
76 }; | 78 }; |
77 | 79 |
78 #endif // CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ | 80 #endif // CHROME_BROWSER_SEARCH_THUMBNAIL_SOURCE_H_ |
OLD | NEW |