OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "chrome/browser/jumplist_win.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> |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 reinterpret_cast<void**>(&removed)); | 414 reinterpret_cast<void**>(&removed)); |
415 if (FAILED(result)) | 415 if (FAILED(result)) |
416 return false; | 416 return false; |
417 | 417 |
418 // Retrieve the absolute path to "chrome.exe". | 418 // Retrieve the absolute path to "chrome.exe". |
419 std::wstring chrome_path; | 419 std::wstring chrome_path; |
420 if (!PathService::Get(base::FILE_EXE, &chrome_path)) | 420 if (!PathService::Get(base::FILE_EXE, &chrome_path)) |
421 return false; | 421 return false; |
422 | 422 |
423 // Retrieve the command-line switches of this process. | 423 // Retrieve the command-line switches of this process. |
424 CommandLine command_line(CommandLine::ARGUMENTS_ONLY); | 424 CommandLine command_line(CommandLine::NO_PROGRAM); |
425 FilePath user_data_dir = CommandLine::ForCurrentProcess()-> | 425 FilePath user_data_dir = CommandLine::ForCurrentProcess()-> |
426 GetSwitchValuePath(switches::kUserDataDir); | 426 GetSwitchValuePath(switches::kUserDataDir); |
427 if (!user_data_dir.empty()) | 427 if (!user_data_dir.empty()) |
428 command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 428 command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
429 | 429 |
430 std::wstring chrome_switches = command_line.command_line_string(); | 430 std::wstring chrome_switches = command_line.command_line_string(); |
431 | 431 |
432 // We allocate 60% of the given JumpList slots to "most-visited" items | 432 // We allocate 60% of the given JumpList slots to "most-visited" items |
433 // and 40% to "recently-closed" items, respectively. | 433 // and 40% to "recently-closed" items, respectively. |
434 // Nevertheless, if there are not so many items in |recently_closed_pages|, | 434 // Nevertheless, if there are not so many items in |recently_closed_pages|, |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 // the file thread. | 772 // the file thread. |
773 BrowserThread::PostTask( | 773 BrowserThread::PostTask( |
774 BrowserThread::FILE, FROM_HERE, | 774 BrowserThread::FILE, FROM_HERE, |
775 new JumpListUpdateTask(app_id_.c_str(), icon_dir_, most_visited_pages_, | 775 new JumpListUpdateTask(app_id_.c_str(), icon_dir_, most_visited_pages_, |
776 recently_closed_pages_)); | 776 recently_closed_pages_)); |
777 | 777 |
778 // Delete all items in these lists since we don't need these lists any longer. | 778 // Delete all items in these lists since we don't need these lists any longer. |
779 most_visited_pages_.clear(); | 779 most_visited_pages_.clear(); |
780 recently_closed_pages_.clear(); | 780 recently_closed_pages_.clear(); |
781 } | 781 } |
OLD | NEW |