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/icon_loader.h" | 5 #include "chrome/browser/icon_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
| 9 #include "base/bind.h" |
9 #include "base/file_util.h" | 10 #include "base/file_util.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
12 #include "base/nix/mime_util_xdg.h" | 13 #include "base/nix/mime_util_xdg.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "webkit/glue/image_decoder.h" | 15 #include "webkit/glue/image_decoder.h" |
15 | 16 |
16 using std::string; | 17 using std::string; |
17 | 18 |
18 void IconLoader::ReadIcon() { | 19 void IconLoader::ReadIcon() { |
(...skipping 23 matching lines...) Expand all Loading... |
42 icon_data.length()); | 43 icon_data.length()); |
43 if (!bitmap->empty()) { | 44 if (!bitmap->empty()) { |
44 DCHECK_EQ(size_pixels, bitmap->width()); | 45 DCHECK_EQ(size_pixels, bitmap->width()); |
45 DCHECK_EQ(size_pixels, bitmap->height()); | 46 DCHECK_EQ(size_pixels, bitmap->height()); |
46 image_.reset(new gfx::Image(bitmap.release())); | 47 image_.reset(new gfx::Image(bitmap.release())); |
47 } else { | 48 } else { |
48 LOG(WARNING) << "Unsupported file type or load error: " << filename.value(); | 49 LOG(WARNING) << "Unsupported file type or load error: " << filename.value(); |
49 } | 50 } |
50 | 51 |
51 target_message_loop_->PostTask( | 52 target_message_loop_->PostTask( |
52 FROM_HERE, NewRunnableMethod(this, &IconLoader::NotifyDelegate)); | 53 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); |
53 } | 54 } |
OLD | NEW |