1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/icon_loader.h"
7 #include "base/strings/string_util.h"
8 #include "chromeos/ui/base/file_icon_util.h"
9 #include "ui/gfx/image/image.h"
10 #include "ui/gfx/image/image_skia.h"
13 IconLoader::IconGroup IconLoader::GroupForFilepath(
14 const base::FilePath& file_path) {
15 return base::ToLowerASCII(file_path.Extension());
18 // The Chrome OS implementation doesn't use an I/O thread because vector icons
19 // are created on the UI thread.
20 void IconLoader::Start() {
23 case IconLoader::SMALL:
26 case IconLoader::NORMAL:
29 case IconLoader::LARGE:
34 std::move(callback_).Run(
35 gfx::Image(chromeos::GetIconForPath(file_path_, /*dark_background=*/false,
37 GroupForFilepath(file_path_));