Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/profiles/profile_shortcut_manager_win.cc

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rework Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 const char kProfileIconFileName[] = "Google Profile.ico"; 532 const char kProfileIconFileName[] = "Google Profile.ico";
533 533
534 string16 GetShortcutFilenameForProfile(const string16& profile_name, 534 string16 GetShortcutFilenameForProfile(const string16& profile_name,
535 BrowserDistribution* distribution) { 535 BrowserDistribution* distribution) {
536 string16 shortcut_name; 536 string16 shortcut_name;
537 if (!profile_name.empty()) { 537 if (!profile_name.empty()) {
538 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name)); 538 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name));
539 shortcut_name.append(L" - "); 539 shortcut_name.append(L" - ");
540 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); 540 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
541 } else { 541 } else {
542 shortcut_name.append(distribution->GetAppShortCutName()); 542 shortcut_name.append(distribution->
543 GetShortcutName(BrowserDistribution::SHORTCUT_CHROME));
543 } 544 }
544 return shortcut_name + installer::kLnkExt; 545 return shortcut_name + installer::kLnkExt;
545 } 546 }
546 547
547 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) { 548 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) {
548 return base::StringPrintf(L"--%ls=\"%ls\"", 549 return base::StringPrintf(L"--%ls=\"%ls\"",
549 ASCIIToUTF16(switches::kProfileDirectory).c_str(), 550 ASCIIToUTF16(switches::kProfileDirectory).c_str(),
550 profile_path.BaseName().value().c_str()); 551 profile_path.BaseName().value().c_str());
551 } 552 }
552 553
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 BrowserThread::PostTask( 701 BrowserThread::PostTask(
701 BrowserThread::FILE, FROM_HERE, 702 BrowserThread::FILE, FROM_HERE,
702 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path, 703 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path,
703 old_shortcut_appended_name, new_shortcut_appended_name, 704 old_shortcut_appended_name, new_shortcut_appended_name,
704 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode, 705 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode,
705 action)); 706 action));
706 707
707 cache->SetShortcutNameOfProfileAtIndex(profile_index, 708 cache->SetShortcutNameOfProfileAtIndex(profile_index,
708 new_shortcut_appended_name); 709 new_shortcut_appended_name);
709 } 710 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698