Index: chrome/browser/profiles/profile_shortcut_manager_win.h |
=================================================================== |
--- chrome/browser/profiles/profile_shortcut_manager_win.h (revision 112717) |
+++ chrome/browser/profiles/profile_shortcut_manager_win.h (working copy) |
@@ -13,6 +13,8 @@ |
#include "base/string16.h" |
#include "chrome/browser/profiles/profile_info_cache_observer.h" |
+class FilePath; |
+ |
// This class observes the ProfileInfoCache, and makes corresponding changes |
// to shortcuts on the user's desktop in Windows systems. |
class ProfileShortcutManagerWin : public ProfileInfoCacheObserver { |
@@ -23,12 +25,19 @@ |
// ProfileInfoCacheObserver: |
virtual void OnProfileAdded( |
const string16& profile_name, |
- const string16& profile_base_dir) OVERRIDE; |
+ const string16& profile_base_dir, |
+ const string16& profile_path, |
+ const gfx::Image* avatar_image) OVERRIDE; |
virtual void OnProfileRemoved( |
const string16& profile_name) OVERRIDE; |
virtual void OnProfileNameChanged( |
const string16& old_profile_name, |
const string16& new_profile_name) OVERRIDE; |
+ virtual void OnProfileAvatarChanged( |
+ const string16& profile_name, |
+ const string16& profile_base_dir, |
+ const string16& profile_path, |
+ const gfx::Image* avatar_image) OVERRIDE; |
// Takes a vector of profile names (for example: "Sparky") and generates a |
// vector of shortcut link names (for example: "Chromium (Sparky).lnk"). |
@@ -37,11 +46,14 @@ |
private: |
SteveT
2011/12/03 03:19:15
robertshield: This isn't new to this CL, but these
|
// Creates a desktop shortcut to open Chrome with the given profile name and |
- // directory. Iff |create|, create shortcut if it doesn't already exist. Must |
- // be called on the FILE thread. |
+ // base directory. Iff |create|, create shortcut if it doesn't already exist. |
+ // Must be called on the FILE thread. This method retains ownership of |
+ // |avatar_image| and will delete it when it is done with it. |
static void CreateChromeDesktopShortcutForProfile( |
const string16& profile_name, |
- const string16& directory, |
+ const string16& profile_base_dir, |
+ const string16& profile_path, |
+ const gfx::Image* avatar_image, |
bool create); |
// Renames an existing Chrome desktop profile shortcut. Must be called on the |
@@ -51,11 +63,23 @@ |
const string16& new_profile_name); |
// Updates the arguments to a Chrome desktop shortcut for a profile. Must be |
- // called on the FILE thread. |
+ // called on the FILE thread. This method retains ownership of |avatar_image| |
+ // and will delete it when it is done with it. |
static void UpdateChromeDesktopShortcutForProfile( |
const string16& shortcut, |
- const string16& arguments); |
+ const string16& arguments, |
+ const string16& profile_path, |
+ const gfx::Image* avatar_image); |
+ // Creates a desktop shortcut icon file (.ico) on the disk for a given |
+ // profile, badging the browser distribution icon with the profile avatar. |
+ // |profile_base_dir| is the base directory (and key) of the profile. Returns |
+ // a path to the shortcut icon file on disk, which is empty if this fails. |
+ // Use index 0 when assigning the resulting file as the icon. |
+ static FilePath CreateChromeDesktopShortcutIconForProfile( |
+ const string16& profile_path, |
+ const gfx::Image* avatar_image); |
+ |
DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); |
}; |