| 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_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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::ARGUMENTS_ONLY); |
| 425 std::wstring user_data_dir = CommandLine::ForCurrentProcess()-> | 425 FilePath user_data_dir = CommandLine::ForCurrentProcess()-> |
| 426 GetSwitchValue(switches::kUserDataDir); | 426 GetSwitchValuePath(switches::kUserDataDir); |
| 427 if (!user_data_dir.empty()) | 427 if (!user_data_dir.empty()) |
| 428 command_line.AppendSwitchWithValue(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|, |
| 435 // we give the remaining slots to "most-visited" items. | 435 // we give the remaining slots to "most-visited" items. |
| 436 const int kMostVisited = 60; | 436 const int kMostVisited = 60; |
| 437 const int kRecentlyClosed = 40; | 437 const int kRecentlyClosed = 40; |
| 438 const int kTotal = kMostVisited + kRecentlyClosed; | 438 const int kTotal = kMostVisited + kRecentlyClosed; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 // the file thread. | 772 // the file thread. |
| 773 ChromeThread::PostTask( | 773 ChromeThread::PostTask( |
| 774 ChromeThread::FILE, FROM_HERE, | 774 ChromeThread::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 |