| 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_THUMBNAIL_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_THUMBNAIL_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_THUMBNAIL_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_THUMBNAIL_SOURCE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 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_off_the_record, | 31 bool is_incognito, |
| 32 int request_id); | 32 int request_id); |
| 33 | 33 |
| 34 virtual std::string GetMimeType(const std::string& path) const; | 34 virtual std::string GetMimeType(const std::string& path) const; |
| 35 | 35 |
| 36 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; | 36 virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 virtual ~ThumbnailSource(); | 39 virtual ~ThumbnailSource(); |
| 40 | 40 |
| 41 // Send the default thumbnail when we are missing a real one. | 41 // Send the default thumbnail when we are missing a real one. |
| 42 void SendDefaultThumbnail(int request_id); | 42 void SendDefaultThumbnail(int request_id); |
| 43 | 43 |
| 44 // Raw PNG representation of the thumbnail to show when the thumbnail | 44 // Raw PNG representation of the thumbnail to show when the thumbnail |
| 45 // database doesn't have a thumbnail for a webpage. | 45 // database doesn't have a thumbnail for a webpage. |
| 46 scoped_refptr<RefCountedMemory> default_thumbnail_; | 46 scoped_refptr<RefCountedMemory> default_thumbnail_; |
| 47 | 47 |
| 48 // TopSites. | 48 // TopSites. |
| 49 scoped_refptr<history::TopSites> top_sites_; | 49 scoped_refptr<history::TopSites> top_sites_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); | 51 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_UI_WEBUI_THUMBNAIL_SOURCE_H_ | 54 #endif // CHROME_BROWSER_UI_WEBUI_THUMBNAIL_SOURCE_H_ |
| OLD | NEW |