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

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

Issue 11299160: Find shortcuts that don't have a profile command line set when creating 2nd profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_
7 7
8 #include "chrome/browser/profiles/profile_shortcut_manager.h" 8 #include "chrome/browser/profiles/profile_shortcut_manager.h"
9 9
10 class BrowserDistribution; 10 class BrowserDistribution;
11 11
12 // Internal free-standing functions that are exported here for testing. 12 // Internal free-standing functions that are exported here for testing.
13 namespace profiles { 13 namespace profiles {
14 namespace internal { 14 namespace internal {
15 15
16 // Returns the default shortcut filename for the given profile name, 16 // Returns the default shortcut filename for the given profile name,
17 // given |distribution|. Returns a filename appropriate for a 17 // given |distribution|. Returns a filename appropriate for a
18 // single-user installation if |profile_name| is empty. 18 // single-user installation if |profile_name| is empty.
19 string16 GetShortcutFilenameForProfile(const string16& profile_name, 19 string16 GetShortcutFilenameForProfile(const string16& profile_name,
20 BrowserDistribution* distribution); 20 BrowserDistribution* distribution);
21 21
22 // Returns the command-line flags to launch Chrome with the given profile.
23 string16 CreateProfileShortcutFlags(const FilePath& profile_path);
24
22 } // namespace internal 25 } // namespace internal
23 } // namespace profiles 26 } // namespace profiles
24 27
25 class ProfileShortcutManagerWin : public ProfileShortcutManager, 28 class ProfileShortcutManagerWin : public ProfileShortcutManager,
26 public ProfileInfoCacheObserver { 29 public ProfileInfoCacheObserver {
27 public: 30 public:
28 explicit ProfileShortcutManagerWin(ProfileManager* manager); 31 explicit ProfileShortcutManagerWin(ProfileManager* manager);
29 virtual ~ProfileShortcutManagerWin(); 32 virtual ~ProfileShortcutManagerWin();
30 33
31 // ProfileShortcutManager implementation: 34 // ProfileShortcutManager implementation:
32 virtual void CreateProfileShortcut(const FilePath& profile_path) OVERRIDE; 35 virtual void CreateProfileShortcut(const FilePath& profile_path) OVERRIDE;
33 36
34 // ProfileInfoCacheObserver implementation: 37 // ProfileInfoCacheObserver implementation:
35 virtual void OnProfileAdded(const FilePath& profile_path) OVERRIDE; 38 virtual void OnProfileAdded(const FilePath& profile_path) OVERRIDE;
36 virtual void OnProfileWillBeRemoved(const FilePath& profile_path) OVERRIDE; 39 virtual void OnProfileWillBeRemoved(const FilePath& profile_path) OVERRIDE;
37 virtual void OnProfileWasRemoved(const FilePath& profile_path, 40 virtual void OnProfileWasRemoved(const FilePath& profile_path,
38 const string16& profile_name) OVERRIDE; 41 const string16& profile_name) OVERRIDE;
39 virtual void OnProfileNameChanged(const FilePath& profile_path, 42 virtual void OnProfileNameChanged(const FilePath& profile_path,
40 const string16& old_profile_name) OVERRIDE; 43 const string16& old_profile_name) OVERRIDE;
41 virtual void OnProfileAvatarChanged(const FilePath& profile_path) OVERRIDE; 44 virtual void OnProfileAvatarChanged(const FilePath& profile_path) OVERRIDE;
42 45
43 private: 46 private:
44 void StartProfileShortcutNameChange(const FilePath& profile_path, 47 void StartProfileShortcutNameChange(const FilePath& profile_path,
45 const string16& old_profile_name); 48 const string16& old_profile_name);
46 // Gives the profile path of an alternate profile than |profile_path|. 49 // Gives the profile path of an alternate profile than |profile_path|.
47 // Must only be called when the number profiles is 2. 50 // Must only be called when the number profiles is 2.
48 FilePath GetOtherProfilePath(const FilePath& profile_path); 51 FilePath GetOtherProfilePath(const FilePath& profile_path);
49 void UpdateShortcutsForProfileAtPath(const FilePath& profile_path, 52 void UpdateShortcutsForProfileAtPath(const FilePath& profile_path,
53 bool include_empty_command_lines,
50 bool create_always); 54 bool create_always);
51 55
52 ProfileManager* profile_manager_; 56 ProfileManager* profile_manager_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); 58 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin);
55 }; 59 };
56 60
57 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ 61 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698