OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/dom_ui/dom_ui_thumbnail_source.h" | 5 #include "chrome/browser/dom_ui/dom_ui_thumbnail_source.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | |
8 #include "base/callback.h" | 7 #include "base/callback.h" |
9 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/history/top_sites.h" | 9 #include "chrome/browser/history/top_sites.h" |
11 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
13 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
| 13 #include "ui/base/resource/resource_bundle.h" |
14 | 14 |
15 DOMUIThumbnailSource::DOMUIThumbnailSource(Profile* profile) | 15 DOMUIThumbnailSource::DOMUIThumbnailSource(Profile* profile) |
16 : DataSource(chrome::kChromeUIThumbnailPath, MessageLoop::current()), | 16 : DataSource(chrome::kChromeUIThumbnailPath, MessageLoop::current()), |
17 profile_(profile) { | 17 profile_(profile) { |
18 // Set TopSites now as Profile isn't thread safe. | 18 // Set TopSites now as Profile isn't thread safe. |
19 top_sites_ = profile_->GetTopSites(); | 19 top_sites_ = profile_->GetTopSites(); |
20 } | 20 } |
21 | 21 |
22 DOMUIThumbnailSource::~DOMUIThumbnailSource() { | 22 DOMUIThumbnailSource::~DOMUIThumbnailSource() { |
23 } | 23 } |
(...skipping 24 matching lines...) Expand all Loading... |
48 | 48 |
49 void DOMUIThumbnailSource::SendDefaultThumbnail(int request_id) { | 49 void DOMUIThumbnailSource::SendDefaultThumbnail(int request_id) { |
50 // Use placeholder thumbnail. | 50 // Use placeholder thumbnail. |
51 if (!default_thumbnail_.get()) { | 51 if (!default_thumbnail_.get()) { |
52 default_thumbnail_ = | 52 default_thumbnail_ = |
53 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( | 53 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( |
54 IDR_DEFAULT_THUMBNAIL); | 54 IDR_DEFAULT_THUMBNAIL); |
55 } | 55 } |
56 SendResponse(request_id, default_thumbnail_); | 56 SendResponse(request_id, default_thumbnail_); |
57 } | 57 } |
OLD | NEW |