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_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 | 7 |
8 #include <map> | |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "content/public/browser/url_data_source.h" | 13 #include "content/public/browser/url_data_source.h" |
13 | 14 |
14 class Profile; | 15 class Profile; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class RefCountedMemory; | 18 class RefCountedMemory; |
(...skipping 24 matching lines...) Expand all Loading... | |
42 private: | 43 private: |
43 virtual ~ThumbnailSource(); | 44 virtual ~ThumbnailSource(); |
44 | 45 |
45 // Raw PNG representation of the thumbnail to show when the thumbnail | 46 // Raw PNG representation of the thumbnail to show when the thumbnail |
46 // database doesn't have a thumbnail for a webpage. | 47 // database doesn't have a thumbnail for a webpage. |
47 scoped_refptr<base::RefCountedMemory> default_thumbnail_; | 48 scoped_refptr<base::RefCountedMemory> default_thumbnail_; |
48 | 49 |
49 // ThumbnailService. | 50 // ThumbnailService. |
50 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_; | 51 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service_; |
51 | 52 |
52 // Transient copy of the request in play. Valid between | 53 // Transient mappings from a ID-based path to a URL-based path. |
Dan Beam
2013/03/20 19:26:13
an ID-based, an URL-based
dhollowa
2013/03/20 19:58:54
Done.
| |
53 // ShouldServiceRequest() and StartDataRequest(). | 54 // The key is an ID-string, the value is a URL string. |
54 mutable const net::URLRequest* current_request_; | 55 // Mapppings are added in ShouldServiceRequest() and erased once |
Dan Beam
2013/03/20 19:26:13
Mappings
dhollowa
2013/03/20 19:58:54
Done.
| |
56 // the request is serviced in StartDataRequest(). | |
57 // TODO(dhollowa): Consider passing the |request| object through | |
58 // to the |StartDataRequest| call. | |
Dan Beam
2013/03/20 19:26:13
nit: |StartDataRequest()|
dhollowa
2013/03/20 19:58:54
Done.
| |
59 mutable std::map<std::string, std::string> id_to_url_map_; | |
Dan Beam
2013/03/20 19:26:13
why does this need to be mutable vs. just making t
dhollowa
2013/03/20 19:58:54
Because it is altered in the StartDataRequest() ca
dhollowa
2013/03/20 20:02:08
I realized I didn't really answer your question he
| |
55 | 60 |
56 // Only used when servicing requests on the UI thread. | 61 // Only used when servicing requests on the UI thread. |
57 Profile* const profile_; | 62 Profile* const profile_; |
58 | 63 |
59 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); | 64 DISALLOW_COPY_AND_ASSIGN(ThumbnailSource); |
60 }; | 65 }; |
61 | 66 |
62 #endif // CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ | 67 #endif // CHROME_BROWSER_UI_WEBUI_NTP_THUMBNAIL_SOURCE_H_ |
OLD | NEW |