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 virtual ~ProfileShortcutManagerWin(); |
| 22 |
| 23 // ProfileInfoCacheObserver: |
| 24 virtual void OnProfileAdded( |
| 25 const string16& profile_name, |
| 26 const string16& profile_base_dir) OVERRIDE; |
| 27 virtual void OnProfileRemoved( |
| 28 const string16& profile_name) OVERRIDE; |
| 29 virtual void OnProfileNameChanged( |
| 30 const string16& old_profile_name, |
| 31 const string16& new_profile_name) OVERRIDE; |
| 32 |
| 33 // Takes a vector of profile names (for example: "Sparky") and generates a |
| 34 // vector of shortcut link names (for example: "Chromium (Sparky).lnk"). |
| 35 static std::vector<string16> GenerateShortcutsFromProfiles( |
| 36 const std::vector<string16>& profile_names); |
| 37 |
| 38 private: |
| 39 // Creates a desktop shortcut to open Chrome with the given profile name and |
| 40 // directory. Iff |create|, create shortcut if it doesn't already exist. Must |
| 41 // be called on the FILE thread. |
| 42 static void CreateChromeDesktopShortcutForProfile( |
| 43 const string16& profile_name, |
| 44 const string16& directory, |
| 45 bool create); |
| 46 |
| 47 // Renames an existing Chrome desktop profile shortcut. Must be called on the |
| 48 // FILE thread. |
| 49 static void RenameChromeDesktopShortcutForProfile( |
| 50 const string16& old_profile_name, |
| 51 const string16& new_profile_name); |
| 52 |
| 53 // Updates the arguments to a Chrome desktop shortcut for a profile. Must be |
| 54 // called on the FILE thread. |
| 55 static void UpdateChromeDesktopShortcutForProfile( |
| 56 const string16& shortcut, |
| 57 const string16& arguments); |
| 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); |
| 60 }; |
| 61 |
| 62 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
OLD | NEW |