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

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

Issue 13812014: Added check for icons that change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 7 years, 8 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
« no previous file with comments | « chrome/browser/icon_loader_chromeos.cc ('k') | chrome/browser/icon_loader_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // static 20 // static
21 IconGroupID IconLoader::ReadGroupIDFromFilepath( 21 IconGroupID IconLoader::ReadGroupIDFromFilepath(
22 const base::FilePath& filepath) { 22 const base::FilePath& filepath) {
23 return base::nix::GetFileMimeType(filepath); 23 return base::nix::GetFileMimeType(filepath);
24 } 24 }
25 25
26 bool IconLoader::IsIconMutableFromFilepath(const base::FilePath&) {
27 return false;
28 }
29
26 void IconLoader::ReadIcon() { 30 void IconLoader::ReadIcon() {
27 int size_pixels = 0; 31 int size_pixels = 0;
28 switch (icon_size_) { 32 switch (icon_size_) {
29 case IconLoader::SMALL: 33 case IconLoader::SMALL:
30 size_pixels = 16; 34 size_pixels = 16;
31 break; 35 break;
32 case IconLoader::NORMAL: 36 case IconLoader::NORMAL:
33 size_pixels = 32; 37 size_pixels = 32;
34 break; 38 break;
35 case IconLoader::LARGE: 39 case IconLoader::LARGE:
(...skipping 23 matching lines...) Expand all
59 image_.reset(new gfx::Image(image_skia)); 63 image_.reset(new gfx::Image(image_skia));
60 } else { 64 } else {
61 LOG(WARNING) << "Unsupported file type or load error: " 65 LOG(WARNING) << "Unsupported file type or load error: "
62 << filename.value(); 66 << filename.value();
63 } 67 }
64 } 68 }
65 69
66 target_message_loop_->PostTask( 70 target_message_loop_->PostTask(
67 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); 71 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this));
68 } 72 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_chromeos.cc ('k') | chrome/browser/icon_loader_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698