OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/jumplist.h" | 5 #include "chrome/browser/jumplist.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "app/gfx/codec/png_codec.h" | 15 #include "app/gfx/codec/png_codec.h" |
16 #include "app/gfx/icon_util.h" | 16 #include "app/gfx/icon_util.h" |
17 #include "app/l10n_util.h" | 17 #include "app/l10n_util.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "base/scoped_comptr_win.h" | 21 #include "base/scoped_comptr_win.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/thread.h" | 23 #include "base/thread.h" |
24 #include "base/win_util.h" | 24 #include "base/win_util.h" |
25 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/chrome_thread.h" |
26 #include "chrome/browser/favicon_service.h" | 26 #include "chrome/browser/favicon_service.h" |
27 #include "chrome/browser/history/history.h" | 27 #include "chrome/browser/history/history.h" |
28 #include "chrome/browser/history/page_usage_data.h" | 28 #include "chrome/browser/history/page_usage_data.h" |
29 #include "chrome/browser/profile.h" | 29 #include "chrome/browser/profile.h" |
30 #include "chrome/browser/sessions/tab_restore_service.h" | 30 #include "chrome/browser/sessions/tab_restore_service.h" |
31 #include "chrome/common/chrome_constants.h" | 31 #include "chrome/common/chrome_constants.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
35 #include "third_party/skia/include/core/SkBitmap.h" | 35 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 725 |
726 // if we need to load more fav icons, we send another query and exit. | 726 // if we need to load more fav icons, we send another query and exit. |
727 if (!icon_urls_.empty()) | 727 if (!icon_urls_.empty()) |
728 icon_urls_.pop_front(); | 728 icon_urls_.pop_front(); |
729 if (StartLoadingFavIcon()) | 729 if (StartLoadingFavIcon()) |
730 return; | 730 return; |
731 | 731 |
732 // Finished Loading all fav icons needed by the application JumpList. | 732 // Finished Loading all fav icons needed by the application JumpList. |
733 // We create a JumpListUpdateTask that creates icon files, and we post it to | 733 // We create a JumpListUpdateTask that creates icon files, and we post it to |
734 // the file thread. | 734 // the file thread. |
735 Task* icon_task = new JumpListUpdateTask(icon_dir_, | 735 ChromeThread::PostTask( |
736 most_visited_pages_, | 736 ChromeThread::FILE, FROM_HERE, |
737 recently_closed_pages_); | 737 new JumpListUpdateTask( |
738 MessageLoop* file_loop = g_browser_process->file_thread()->message_loop(); | 738 icon_dir_, most_visited_pages_, recently_closed_pages_)); |
739 if (file_loop) | |
740 file_loop->PostTask(FROM_HERE, icon_task); | |
741 | 739 |
742 // Delete all items in these lists since we don't need these lists any longer. | 740 // Delete all items in these lists since we don't need these lists any longer. |
743 most_visited_pages_.clear(); | 741 most_visited_pages_.clear(); |
744 recently_closed_pages_.clear(); | 742 recently_closed_pages_.clear(); |
745 } | 743 } |
OLD | NEW |