| 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 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 5 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/history/top_sites.h" | 8 #include "chrome/browser/history/top_sites.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return "image/png"; | 39 return "image/png"; |
| 40 } | 40 } |
| 41 | 41 |
| 42 MessageLoop* ThumbnailSource::MessageLoopForRequestPath( | 42 MessageLoop* ThumbnailSource::MessageLoopForRequestPath( |
| 43 const std::string& path) const { | 43 const std::string& path) const { |
| 44 // TopSites can be accessed from the IO thread. | 44 // TopSites can be accessed from the IO thread. |
| 45 return top_sites_.get() ? NULL : DataSource::MessageLoopForRequestPath(path); | 45 return top_sites_.get() ? NULL : DataSource::MessageLoopForRequestPath(path); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ThumbnailSource::SendDefaultThumbnail(int request_id) { | 48 void ThumbnailSource::SendDefaultThumbnail(int request_id) { |
| 49 // Use placeholder thumbnail. | |
| 50 if (!default_thumbnail_.get()) { | |
| 51 default_thumbnail_ = | |
| 52 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( | |
| 53 IDR_DEFAULT_THUMBNAIL); | |
| 54 } | |
| 55 SendResponse(request_id, default_thumbnail_); | 49 SendResponse(request_id, default_thumbnail_); |
| 56 } | 50 } |
| OLD | NEW |