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 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" | 5 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" |
6 | 6 |
7 #include <shlobj.h> // For SHChangeNotify(). | 7 #include <shlobj.h> // For SHChangeNotify(). |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 const char kProfileIconFileName[] = "Google Profile.ico"; | 533 const char kProfileIconFileName[] = "Google Profile.ico"; |
534 | 534 |
535 string16 GetShortcutFilenameForProfile(const string16& profile_name, | 535 string16 GetShortcutFilenameForProfile(const string16& profile_name, |
536 BrowserDistribution* distribution) { | 536 BrowserDistribution* distribution) { |
537 string16 shortcut_name; | 537 string16 shortcut_name; |
538 if (!profile_name.empty()) { | 538 if (!profile_name.empty()) { |
539 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name)); | 539 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name)); |
540 shortcut_name.append(L" - "); | 540 shortcut_name.append(L" - "); |
541 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); | 541 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); |
542 } else { | 542 } else { |
543 shortcut_name.append(distribution->GetAppShortCutName()); | 543 shortcut_name.append(distribution-> |
| 544 GetShortcutName(BrowserDistribution::SHORTCUT_CHROME)); |
544 } | 545 } |
545 return shortcut_name + installer::kLnkExt; | 546 return shortcut_name + installer::kLnkExt; |
546 } | 547 } |
547 | 548 |
548 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) { | 549 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) { |
549 return base::StringPrintf(L"--%ls=\"%ls\"", | 550 return base::StringPrintf(L"--%ls=\"%ls\"", |
550 ASCIIToUTF16(switches::kProfileDirectory).c_str(), | 551 ASCIIToUTF16(switches::kProfileDirectory).c_str(), |
551 profile_path.BaseName().value().c_str()); | 552 profile_path.BaseName().value().c_str()); |
552 } | 553 } |
553 | 554 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 BrowserThread::PostTask( | 698 BrowserThread::PostTask( |
698 BrowserThread::FILE, FROM_HERE, | 699 BrowserThread::FILE, FROM_HERE, |
699 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path, | 700 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path, |
700 old_shortcut_appended_name, new_shortcut_appended_name, | 701 old_shortcut_appended_name, new_shortcut_appended_name, |
701 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode, | 702 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode, |
702 action)); | 703 action)); |
703 | 704 |
704 cache->SetShortcutNameOfProfileAtIndex(profile_index, | 705 cache->SetShortcutNameOfProfileAtIndex(profile_index, |
705 new_shortcut_appended_name); | 706 new_shortcut_appended_name); |
706 } | 707 } |
OLD | NEW |