OLD | NEW |
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 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" | 5 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" |
6 | 6 |
7 #include <shlobj.h> // For SHChangeNotify(). | 7 #include <shlobj.h> // For SHChangeNotify(). |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 BrowserThread::FILE, FROM_HERE, | 1001 BrowserThread::FILE, FROM_HERE, |
1002 base::Bind(&CreateOrUpdateDesktopShortcutsAndIconForProfile, params)); | 1002 base::Bind(&CreateOrUpdateDesktopShortcutsAndIconForProfile, params)); |
1003 | 1003 |
1004 entry->SetShortcutName(params.profile_name); | 1004 entry->SetShortcutName(params.profile_name); |
1005 } | 1005 } |
1006 | 1006 |
1007 void ProfileShortcutManagerWin::Observe( | 1007 void ProfileShortcutManagerWin::Observe( |
1008 int type, | 1008 int type, |
1009 const content::NotificationSource& source, | 1009 const content::NotificationSource& source, |
1010 const content::NotificationDetails& details) { | 1010 const content::NotificationDetails& details) { |
1011 switch (type) { | 1011 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type); |
1012 // This notification is triggered when a profile is loaded. | 1012 |
1013 case chrome::NOTIFICATION_PROFILE_CREATED: { | 1013 Profile* profile = |
1014 Profile* profile = | 1014 content::Source<Profile>(source).ptr()->GetOriginalProfile(); |
1015 content::Source<Profile>(source).ptr()->GetOriginalProfile(); | 1015 if (profile->GetPrefs()->GetInteger(prefs::kProfileIconVersion) < |
1016 if (profile->GetPrefs()->GetInteger(prefs::kProfileIconVersion) < | 1016 kCurrentProfileIconVersion) { |
1017 kCurrentProfileIconVersion) { | 1017 // Ensure the profile's icon file has been created. |
1018 // Ensure the profile's icon file has been created. | 1018 CreateOrUpdateProfileIcon(profile->GetPath()); |
1019 CreateOrUpdateProfileIcon(profile->GetPath()); | |
1020 } | |
1021 break; | |
1022 } | |
1023 default: | |
1024 NOTREACHED(); | |
1025 break; | |
1026 } | 1019 } |
1027 } | 1020 } |
OLD | NEW |