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

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

Issue 2709683002: Remove unneeded IconLoader::image_ (Closed)
Patch Set: fix Created 3 years, 10 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_auralinux.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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ptr_util.h"
17 #include "base/memory/ref_counted_memory.h" 18 #include "base/memory/ref_counted_memory.h"
18 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
20 #include "chrome/grit/theme_resources.h" 21 #include "chrome/grit/theme_resources.h"
21 #include "media/media_features.h" 22 #include "media/media_features.h"
22 #include "third_party/skia/include/core/SkBitmap.h" 23 #include "third_party/skia/include/core/SkBitmap.h"
23 #include "ui/base/layout.h" 24 #include "ui/base/layout.h"
24 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
25 #include "ui/gfx/canvas.h" 26 #include "ui/gfx/canvas.h"
26 #include "ui/gfx/codec/png_codec.h" 27 #include "ui/gfx/codec/png_codec.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 196 }
196 197
197 void IconLoader::ReadIcon() { 198 void IconLoader::ReadIcon() {
198 static base::LazyInstance<IconMapper>::Leaky icon_mapper = 199 static base::LazyInstance<IconMapper>::Leaky icon_mapper =
199 LAZY_INSTANCE_INITIALIZER; 200 LAZY_INSTANCE_INITIALIZER;
200 int idr = icon_mapper.Get().Lookup(group_, icon_size_); 201 int idr = icon_mapper.Get().Lookup(group_, icon_size_);
201 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 202 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
202 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(), 203 gfx::ImageSkia image_skia(ResizeImage(*(rb.GetImageNamed(idr)).ToImageSkia(),
203 IconSizeToDIPSize(icon_size_))); 204 IconSizeToDIPSize(icon_size_)));
204 image_skia.MakeThreadSafe(); 205 image_skia.MakeThreadSafe();
205 image_.reset(new gfx::Image(image_skia)); 206 std::unique_ptr<gfx::Image> image = base::MakeUnique<gfx::Image>(image_skia);
206 target_task_runner_->PostTask( 207 target_task_runner_->PostTask(
207 FROM_HERE, base::Bind(callback_, base::Passed(&image_), group_)); 208 FROM_HERE, base::Bind(callback_, base::Passed(&image), group_));
208 delete this; 209 delete this;
209 } 210 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_auralinux.cc ('k') | chrome/browser/icon_loader_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698