1 // Copyright 2013 The Chromium Authors. All rights reserved.
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"
8 #include "base/message_loop/message_loop.h"
9 #include "base/nix/mime_util_xdg.h"
10 #include "ui/views/linux_ui/linux_ui.h"
13 IconGroupID
IconLoader::ReadGroupIDFromFilepath(
14 const base::FilePath
& filepath
) {
15 return base::nix::GetFileMimeType(filepath
);
18 bool IconLoader::IsIconMutableFromFilepath(const base::FilePath
&) {
22 void IconLoader::ReadIcon() {
25 case IconLoader::SMALL
:
28 case IconLoader::NORMAL
:
31 case IconLoader::LARGE
:
38 views::LinuxUI
* ui
= views::LinuxUI::instance();
40 gfx::Image image
= ui
->GetIconForContentType(group_
, size_pixels
);
42 image_
.reset(new gfx::Image(image
));
45 target_message_loop_
->PostTask(
46 FROM_HERE
, base::Bind(&IconLoader::NotifyDelegate
, this));