OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // ThumbnailSource is the gateway between network-level chrome: requests for | 22 // ThumbnailSource is the gateway between network-level chrome: requests for |
23 // thumbnails and the history/top-sites backend that serves these. | 23 // thumbnails and the history/top-sites backend that serves these. |
24 class ThumbnailSource : public ChromeURLDataManager::DataSource { | 24 class ThumbnailSource : public ChromeURLDataManager::DataSource { |
25 public: | 25 public: |
26 explicit ThumbnailSource(Profile* profile); | 26 explicit ThumbnailSource(Profile* profile); |
27 | 27 |
28 // Called when the network layer has requested a resource underneath | 28 // Called when the network layer has requested a resource underneath |
29 // the path we registered. | 29 // the path we registered. |
30 virtual void StartDataRequest(const std::string& path, | 30 virtual void StartDataRequest(const std::string& path, |
31 bool is_incognito, | 31 bool is_incognito, |
32 int request_id); | 32 int request_id) OVERRIDE; |
33 | 33 |
34 virtual std::string GetMimeType(const std::string& path) const; | 34 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
35 | 35 |
36 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; | 36 virtual MessageLoop* MessageLoopForRequestPath( |
| 37 const std::string& path) const OVERRIDE; |
37 | 38 |
38 private: | 39 private: |
39 virtual ~ThumbnailSource(); | 40 virtual ~ThumbnailSource(); |
40 | 41 |
41 // Send the default thumbnail when we are missing a real one. | 42 // Send the default thumbnail when we are missing a real one. |
42 void SendDefaultThumbnail(int request_id); | 43 void SendDefaultThumbnail(int request_id); |
43 | 44 |
44 // Raw PNG representation of the thumbnail to show when the thumbnail | 45 // Raw PNG representation of the thumbnail to show when the thumbnail |
45 // database doesn't have a thumbnail for a webpage. | 46 // database doesn't have a thumbnail for a webpage. |
46 scoped_refptr<RefCountedMemory> default_thumbnail_; | 47 scoped_refptr<RefCountedMemory> default_thumbnail_; |
47 | 48 |
48 // TopSites. | 49 // TopSites. |
49 scoped_refptr<history::TopSites> top_sites_; | 50 scoped_refptr<history::TopSites> top_sites_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); | 52 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); |
52 }; | 53 }; |
53 | 54 |
54 #endif // CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ | 55 #endif // CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ |
OLD | NEW |