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

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

Issue 11852022: Make profile shortcuts more sane when using --user-data-dir=. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | 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 "base/command_line.h"
8 #include "chrome/browser/profiles/profile_shortcut_manager.h" 9 #include "chrome/browser/profiles/profile_shortcut_manager.h"
9 10
10 class BrowserDistribution; 11 class BrowserDistribution;
11 12
12 // Internal free-standing functions that are exported here for testing. 13 // Internal free-standing functions that are exported here for testing.
13 namespace profiles { 14 namespace profiles {
14 namespace internal { 15 namespace internal {
15 16
16 // Name of the badged icon file generated for a given profile. 17 // Name of the badged icon file generated for a given profile.
17 extern const char kProfileIconFileName[]; 18 extern const char kProfileIconFileName[];
18 19
19 // Returns the default shortcut filename for the given profile name, 20 // Returns the default shortcut filename for the given profile name,
20 // given |distribution|. Returns a filename appropriate for a 21 // given |distribution|. Returns a filename appropriate for a
21 // single-user installation if |profile_name| is empty. 22 // single-user installation if |profile_name| is empty.
22 string16 GetShortcutFilenameForProfile(const string16& profile_name, 23 string16 GetShortcutFilenameForProfile(const string16& profile_name,
23 BrowserDistribution* distribution); 24 BrowserDistribution* distribution);
24 25
25 // Returns the command-line flags to launch Chrome with the given profile. 26 // If a custom user data directory has been specified, returns its value.
26 string16 CreateProfileShortcutFlags(const FilePath& profile_path); 27 // Otherwise, returns an empty FilePath().
28 FilePath GetCustomUserDataDirectory();
29
30 // Creates a CommandLine that should be used for creating a non-profile
31 // shortcut. This command line will either be empty or will have a user data
32 // dir specified, when running with a custom one.
33 CommandLine CreateCommandLineForNonProfileShortcut(const FilePath& chrome_exe);
34
35 // Creates a CommandLine that should be used for creating a profile shortcut
36 // for the given |profile_path|. When running with a custom user data dir, the
37 // command line will include the appropriate user data dir flag.
38 CommandLine CreateCommandLineForProfileShortcut(const FilePath& chrome_exe,
39 const FilePath& profile_path);
27 40
28 } // namespace internal 41 } // namespace internal
29 } // namespace profiles 42 } // namespace profiles
30 43
31 class ProfileShortcutManagerWin : public ProfileShortcutManager, 44 class ProfileShortcutManagerWin : public ProfileShortcutManager,
32 public ProfileInfoCacheObserver { 45 public ProfileInfoCacheObserver {
33 public: 46 public:
34 // Specifies whether a new shortcut should be created if none exist. 47 // Specifies whether a new shortcut should be created if none exist.
35 enum CreateOrUpdateMode { 48 enum CreateOrUpdateMode {
36 UPDATE_EXISTING_ONLY, 49 UPDATE_EXISTING_ONLY,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void CreateOrUpdateShortcutsForProfileAtPath(const FilePath& profile_path, 82 void CreateOrUpdateShortcutsForProfileAtPath(const FilePath& profile_path,
70 CreateOrUpdateMode create_mode, 83 CreateOrUpdateMode create_mode,
71 NonProfileShortcutAction action); 84 NonProfileShortcutAction action);
72 85
73 ProfileManager* profile_manager_; 86 ProfileManager* profile_manager_;
74 87
75 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); 88 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin);
76 }; 89 };
77 90
78 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ 91 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698