OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 ShellUtil::GetChromeShortcutName(dist, false, default_name, | 248 ShellUtil::GetChromeShortcutName(dist, false, default_name, |
249 &new_shortcut)) { | 249 &new_shortcut)) { |
250 // Update doesn't allow changing the target, so rename first. | 250 // Update doesn't allow changing the target, so rename first. |
251 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 251 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
252 base::Bind(&RenameChromeDesktopShortcutForProfile, | 252 base::Bind(&RenameChromeDesktopShortcutForProfile, |
253 old_shortcut, new_shortcut)); | 253 old_shortcut, new_shortcut)); |
254 // TODO(stevet): We actually need to retrieve the newly assigned avatar | 254 // TODO(stevet): We actually need to retrieve the newly assigned avatar |
255 // icon for the original profile here and update it with that. | 255 // icon for the original profile here and update it with that. |
256 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 256 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
257 base::Bind(&UpdateChromeDesktopShortcutForProfile, | 257 base::Bind(&UpdateChromeDesktopShortcutForProfile, |
258 new_shortcut, UTF8ToUTF16(chrome::kInitialProfile), | 258 new_shortcut, |
| 259 CreateProfileShortcutSwitch( |
| 260 UTF8ToUTF16(chrome::kInitialProfile)), |
259 profile_path, static_cast<gfx::Image*>(NULL))); | 261 profile_path, static_cast<gfx::Image*>(NULL))); |
260 } | 262 } |
261 } | 263 } |
262 } else { // Only one profile, so create original shortcut, with no avatar. | 264 } else { // Only one profile, so create original shortcut, with no avatar. |
263 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 265 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
264 base::Bind(&CreateChromeDesktopShortcutForProfile, | 266 base::Bind(&CreateChromeDesktopShortcutForProfile, |
265 L"", L"", FilePath(), static_cast<gfx::Image*>(NULL), true)); | 267 L"", L"", FilePath(), static_cast<gfx::Image*>(NULL), true)); |
266 } | 268 } |
267 } | 269 } |
268 | 270 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 shortcuts.reserve(profile_names.size()); | 333 shortcuts.reserve(profile_names.size()); |
332 for (std::vector<string16>::const_iterator it = profile_names.begin(); | 334 for (std::vector<string16>::const_iterator it = profile_names.begin(); |
333 it != profile_names.end(); | 335 it != profile_names.end(); |
334 ++it) { | 336 ++it) { |
335 string16 shortcut; | 337 string16 shortcut; |
336 if (ShellUtil::GetChromeShortcutName(dist, false, *it, &shortcut)) | 338 if (ShellUtil::GetChromeShortcutName(dist, false, *it, &shortcut)) |
337 shortcuts.push_back(shortcut); | 339 shortcuts.push_back(shortcut); |
338 } | 340 } |
339 return shortcuts; | 341 return shortcuts; |
340 } | 342 } |
OLD | NEW |