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

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: Created 7 years, 7 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 const char kProfileIconFileName[] = "Google Profile.ico"; 528 const char kProfileIconFileName[] = "Google Profile.ico";
529 529
530 string16 GetShortcutFilenameForProfile(const string16& profile_name, 530 string16 GetShortcutFilenameForProfile(const string16& profile_name,
531 BrowserDistribution* distribution) { 531 BrowserDistribution* distribution) {
532 string16 shortcut_name; 532 string16 shortcut_name;
533 if (!profile_name.empty()) { 533 if (!profile_name.empty()) {
534 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name)); 534 shortcut_name.append(SanitizeShortcutProfileNameString(profile_name));
535 shortcut_name.append(L" - "); 535 shortcut_name.append(L" - ");
536 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); 536 shortcut_name.append(l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
537 } else { 537 } else {
538 shortcut_name.append(distribution->GetAppShortCutName()); 538 shortcut_name.append(distribution->
539 GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name);
539 } 540 }
540 return shortcut_name + installer::kLnkExt; 541 return shortcut_name + installer::kLnkExt;
541 } 542 }
542 543
543 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) { 544 string16 CreateProfileShortcutFlags(const base::FilePath& profile_path) {
544 return base::StringPrintf(L"--%ls=\"%ls\"", 545 return base::StringPrintf(L"--%ls=\"%ls\"",
545 ASCIIToUTF16(switches::kProfileDirectory).c_str(), 546 ASCIIToUTF16(switches::kProfileDirectory).c_str(),
546 profile_path.BaseName().value().c_str()); 547 profile_path.BaseName().value().c_str());
547 } 548 }
548 549
(...skipping 151 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