OLD | NEW |
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 #ifndef CHROME_BROWSER_ICON_LOADER_H_ | 5 #ifndef CHROME_BROWSER_ICON_LOADER_H_ |
6 #define CHROME_BROWSER_ICON_LOADER_H_ | 6 #define CHROME_BROWSER_ICON_LOADER_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop/message_loop_proxy.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 // On Windows, we group files by their extension, with several exceptions: | 21 // On Windows, we group files by their extension, with several exceptions: |
22 // .dll, .exe, .ico. See IconManager.h for explanation. | 22 // .dll, .exe, .ico. See IconManager.h for explanation. |
23 typedef std::wstring IconGroupID; | 23 typedef std::wstring IconGroupID; |
24 #elif defined(OS_POSIX) | 24 #elif defined(OS_POSIX) |
25 // On POSIX, we group files by MIME type. | 25 // On POSIX, we group files by MIME type. |
26 typedef std::string IconGroupID; | 26 typedef std::string IconGroupID; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // The thread ReadIcon() should be called on. | 81 // The thread ReadIcon() should be called on. |
82 static content::BrowserThread::ID ReadIconThreadID(); | 82 static content::BrowserThread::ID ReadIconThreadID(); |
83 | 83 |
84 void ReadGroup(); | 84 void ReadGroup(); |
85 void OnReadGroup(); | 85 void OnReadGroup(); |
86 void ReadIcon(); | 86 void ReadIcon(); |
87 | 87 |
88 void NotifyDelegate(); | 88 void NotifyDelegate(); |
89 | 89 |
90 // The message loop object of the thread in which we notify the delegate. | 90 // The task runner object of the thread in which we notify the delegate. |
91 scoped_refptr<base::MessageLoopProxy> target_message_loop_; | 91 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; |
92 | 92 |
93 base::FilePath file_path_; | 93 base::FilePath file_path_; |
94 | 94 |
95 IconGroupID group_; | 95 IconGroupID group_; |
96 | 96 |
97 IconSize icon_size_; | 97 IconSize icon_size_; |
98 | 98 |
99 scoped_ptr<gfx::Image> image_; | 99 scoped_ptr<gfx::Image> image_; |
100 | 100 |
101 Delegate* delegate_; | 101 Delegate* delegate_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(IconLoader); | 103 DISALLOW_COPY_AND_ASSIGN(IconLoader); |
104 }; | 104 }; |
105 | 105 |
106 #endif // CHROME_BROWSER_ICON_LOADER_H_ | 106 #endif // CHROME_BROWSER_ICON_LOADER_H_ |
OLD | NEW |