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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ReplaceSubstringsAfterOffset(&chrome_title, 0, L"&", L""); | 352 ReplaceSubstringsAfterOffset(&chrome_title, 0, L"&", L""); |
353 chrome->SetTitle(chrome_title); | 353 chrome->SetTitle(chrome_title); |
354 chrome->SetIcon(chrome_path, 0, false); | 354 chrome->SetIcon(chrome_path, 0, false); |
355 AddShellLink(collection, chrome_path, chrome_switches, chrome); | 355 AddShellLink(collection, chrome_path, chrome_switches, chrome); |
356 | 356 |
357 // Create an IShellLink object which launches Chrome in incognito mode, and | 357 // Create an IShellLink object which launches Chrome in incognito mode, and |
358 // add it to the collection. We use our application icon as the icon for | 358 // add it to the collection. We use our application icon as the icon for |
359 // this item. | 359 // this item. |
360 scoped_refptr<ShellLinkItem> incognito(new ShellLinkItem); | 360 scoped_refptr<ShellLinkItem> incognito(new ShellLinkItem); |
361 incognito->SetArguments( | 361 incognito->SetArguments( |
362 CommandLine::PrefixedSwitchString(switches::kIncognito)); | 362 ASCIIToWide(std::string("--") + switches::kIncognito)); |
363 std::wstring incognito_title(l10n_util::GetString(IDS_NEW_INCOGNITO_WINDOW)); | 363 std::wstring incognito_title(l10n_util::GetString(IDS_NEW_INCOGNITO_WINDOW)); |
364 ReplaceSubstringsAfterOffset(&incognito_title, 0, L"&", L""); | 364 ReplaceSubstringsAfterOffset(&incognito_title, 0, L"&", L""); |
365 incognito->SetTitle(incognito_title); | 365 incognito->SetTitle(incognito_title); |
366 incognito->SetIcon(chrome_path, 0, false); | 366 incognito->SetIcon(chrome_path, 0, false); |
367 AddShellLink(collection, chrome_path, chrome_switches, incognito); | 367 AddShellLink(collection, chrome_path, chrome_switches, incognito); |
368 | 368 |
369 // We can now add the new list to the JumpList. | 369 // We can now add the new list to the JumpList. |
370 // ICustomDestinationList::AddUserTasks() also uses the IObjectArray | 370 // ICustomDestinationList::AddUserTasks() also uses the IObjectArray |
371 // interface to retrieve each item in the list. So, we retrieve the | 371 // interface to retrieve each item in the list. So, we retrieve the |
372 // IObjectArray interface from the EnumerableObjectCollection object. | 372 // IObjectArray interface from the EnumerableObjectCollection object. |
(...skipping 399 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 |