Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: chrome/browser/icon_loader_linux.cc

Issue 12211049: Removing base::ThreadRestrictions::ScopedAllowIO from icon_manager_linux.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/nix/mime_util_xdg.h" 13 #include "base/nix/mime_util_xdg.h"
14 #include "third_party/skia/include/core/SkBitmap.h" 14 #include "third_party/skia/include/core/SkBitmap.h"
15 #include "ui/gfx/image/image_skia.h" 15 #include "ui/gfx/image/image_skia.h"
16 #include "webkit/glue/image_decoder.h" 16 #include "webkit/glue/image_decoder.h"
17 17
18 using std::string; 18 using std::string;
19 19
20 IconGroupID IconLoader::ReadGroupIDFromFilepath(
21 const base::FilePath& filepath) {
22 return base::nix::GetFileMimeType(filepath);
23 }
24
20 void IconLoader::ReadIcon() { 25 void IconLoader::ReadIcon() {
21 int size_pixels = 0; 26 int size_pixels = 0;
22 switch (icon_size_) { 27 switch (icon_size_) {
23 case IconLoader::SMALL: 28 case IconLoader::SMALL:
24 size_pixels = 16; 29 size_pixels = 16;
25 break; 30 break;
26 case IconLoader::NORMAL: 31 case IconLoader::NORMAL:
27 size_pixels = 32; 32 size_pixels = 32;
28 break; 33 break;
29 case IconLoader::LARGE: 34 case IconLoader::LARGE:
(...skipping 23 matching lines...) Expand all
53 image_.reset(new gfx::Image(image_skia)); 58 image_.reset(new gfx::Image(image_skia));
54 } else { 59 } else {
55 LOG(WARNING) << "Unsupported file type or load error: " 60 LOG(WARNING) << "Unsupported file type or load error: "
56 << filename.value(); 61 << filename.value();
57 } 62 }
58 } 63 }
59 64
60 target_message_loop_->PostTask( 65 target_message_loop_->PostTask(
61 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); 66 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this));
62 } 67 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698