Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/callback.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/string16.h" | |
| 14 #include "chrome/browser/profiles/profile_info_cache_observer.h" | |
| 15 | |
| 16 // This class observes the ProfileInfoCache, and makes corresponding changes | |
| 17 // to shortcuts on the user's desktop in Windows systems. | |
| 18 class ProfileShortcutManagerWin : public ProfileInfoCacheObserver { | |
| 19 public: | |
| 20 ProfileShortcutManagerWin(); | |
| 21 ~ProfileShortcutManagerWin(); | |
|
Robert Sesek
2011/11/18 14:13:43
virtual
Miranda Callahan
2011/11/18 19:00:36
Done.
| |
| 22 | |
| 23 // ProfileInfoCacheObserver: | |
| 24 virtual void OnProfileAdded(string16 profile_name, | |
| 25 string16 profile_base_dir) OVERRIDE; | |
| 26 virtual void OnProfileRemoved(string16 profile_name) OVERRIDE; | |
| 27 virtual void OnProfileNameChanged(string16 old_profile_name, | |
| 28 string16 new_profile_name) OVERRIDE; | |
| 29 | |
| 30 // Wrap a ShellUtil function that returns a bool so it can be posted in a | |
|
Robert Sesek
2011/11/18 14:13:43
private:?
Miranda Callahan
2011/11/18 19:00:36
Done.
| |
| 31 // task to the FILE Thread. | |
| 32 static void CallShellUtilBoolFunction( | |
|
Robert Sesek
2011/11/18 14:13:43
This could go in the anon namespace in the .cc bec
Miranda Callahan
2011/11/18 19:00:36
Done.
| |
| 33 const base::Callback<bool(void)>& bool_function); | |
| 34 | |
| 35 // Takes a vector of profile names (for example: "Sparky") and generates a | |
| 36 // vector of shortcut link names (for example: "Chromium (Sparky).lnk"). | |
| 37 static std::vector<string16> GenerateShortcutsFromProfiles( | |
| 38 std::vector<string16> profile_names); | |
|
Robert Sesek
2011/11/18 14:13:43
I think these methods can take const-ref arguments
Miranda Callahan
2011/11/18 19:00:36
That's right -- I wondered if that was so. That's
| |
| 39 | |
| 40 // Creates a desktop shortcut to open Chrome with the given profile name and | |
| 41 // directory. Iff |create|, create shortcut if it doesn't already exist. Must | |
| 42 // be called on the FILE thread. | |
| 43 static void CreateChromeDesktopShortcutForProfile( | |
| 44 string16 profile_name, | |
| 45 string16 directory, | |
| 46 bool create); | |
| 47 | |
| 48 // Renames an existing Chrome desktop profile shortcut. Must be called on the | |
| 49 // FILE thread. | |
| 50 static void RenameChromeDesktopShortcutForProfile( | |
| 51 string16 old_profile_name, | |
| 52 string16 new_profile_name); | |
| 53 | |
| 54 // Updates the arguments to a Chrome desktop shortcut for a profile. Must be | |
| 55 // called on the FILE thread. | |
| 56 static void UpdateChromeDesktopShortcutForProfile( | |
| 57 string16 shortcut, | |
| 58 string16 arguments); | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); | |
| 61 }; | |
| 62 | |
| 63 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | |
| OLD | NEW |