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

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

Issue 12230026: linux: Both gtk and the aura port should set the icon theme name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 #if defined(TOOLKIT_GTK) 11 #if defined(TOOLKIT_GTK)
Lei Zhang 2013/02/13 21:54:58 You can remove this too since we're no longer call
12 #include "base/nix/mime_util_xdg.h" 12 #include "base/nix/mime_util_xdg.h"
13 #endif 13 #endif
14 14
15 using content::BrowserThread; 15 using content::BrowserThread;
16 16
17 IconLoader::IconLoader(const IconGroupID& group, IconSize size, 17 IconLoader::IconLoader(const IconGroupID& group, IconSize size,
18 Delegate* delegate) 18 Delegate* delegate)
19 : target_message_loop_(NULL), 19 : target_message_loop_(NULL),
20 group_(group), 20 group_(group),
21 icon_size_(size), 21 icon_size_(size),
22 image_(NULL), 22 image_(NULL),
23 delegate_(delegate) { 23 delegate_(delegate) {
24 } 24 }
25 25
26 IconLoader::~IconLoader() { 26 IconLoader::~IconLoader() {
27 } 27 }
28 28
29 void IconLoader::Start() { 29 void IconLoader::Start() {
30 target_message_loop_ = base::MessageLoopProxy::current(); 30 target_message_loop_ = base::MessageLoopProxy::current();
31 31
32 #if defined(TOOLKIT_GTK)
33 // This call must happen on the UI thread before we can start loading icons.
34 base::nix::DetectGtkTheme();
35 #endif
36
37 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 32 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
38 base::Bind(&IconLoader::ReadIcon, this)); 33 base::Bind(&IconLoader::ReadIcon, this));
39 } 34 }
40 35
41 void IconLoader::NotifyDelegate() { 36 void IconLoader::NotifyDelegate() {
42 // If the delegate takes ownership of the Image, release it from the scoped 37 // If the delegate takes ownership of the Image, release it from the scoped
43 // pointer. 38 // pointer.
44 if (delegate_->OnImageLoaded(this, image_.get())) 39 if (delegate_->OnImageLoaded(this, image_.get()))
45 ignore_result(image_.release()); // Can't ignore return value. 40 ignore_result(image_.release()); // Can't ignore return value.
46 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698