| // Copyright 2012 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "chrome/browser/icon_loader.h" |
| #include "base/strings/string_util.h" |
| #include "chromeos/ui/base/file_icon_util.h" |
| #include "ui/gfx/image/image.h" |
| #include "ui/gfx/image/image_skia.h" |
| IconLoader::IconGroup IconLoader::GroupForFilepath( |
| const base::FilePath& file_path) { |
| return base::ToLowerASCII(file_path.Extension()); |
| // The Chrome OS implementation doesn't use an I/O thread because vector icons |
| // are created on the UI thread. |
| void IconLoader::Start() { |
| std::move(callback_).Run( |
| gfx::Image(chromeos::GetIconForPath(file_path_, /*dark_background=*/false, |
| GroupForFilepath(file_path_)); |