| 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 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 ASCIIToUTF16(switches::kProfileDirectory).c_str(), | 550 ASCIIToUTF16(switches::kProfileDirectory).c_str(), |
| 551 profile_path.BaseName().value().c_str()); | 551 profile_path.BaseName().value().c_str()); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace internal | 554 } // namespace internal |
| 555 } // namespace profiles | 555 } // namespace profiles |
| 556 | 556 |
| 557 // static | 557 // static |
| 558 bool ProfileShortcutManager::IsFeatureEnabled() { | 558 bool ProfileShortcutManager::IsFeatureEnabled() { |
| 559 return BrowserDistribution::GetDistribution()->CanCreateDesktopShortcuts() && | 559 return BrowserDistribution::GetDistribution()->CanCreateDesktopShortcuts() && |
| 560 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir) && | 560 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserDataDir); |
| 561 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList); | |
| 562 } | 561 } |
| 563 | 562 |
| 564 // static | 563 // static |
| 565 ProfileShortcutManager* ProfileShortcutManager::Create( | 564 ProfileShortcutManager* ProfileShortcutManager::Create( |
| 566 ProfileManager* manager) { | 565 ProfileManager* manager) { |
| 567 return new ProfileShortcutManagerWin(manager); | 566 return new ProfileShortcutManagerWin(manager); |
| 568 } | 567 } |
| 569 | 568 |
| 570 ProfileShortcutManagerWin::ProfileShortcutManagerWin(ProfileManager* manager) | 569 ProfileShortcutManagerWin::ProfileShortcutManagerWin(ProfileManager* manager) |
| 571 : profile_manager_(manager) { | 570 : profile_manager_(manager) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 BrowserThread::PostTask( | 696 BrowserThread::PostTask( |
| 698 BrowserThread::FILE, FROM_HERE, | 697 BrowserThread::FILE, FROM_HERE, |
| 699 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path, | 698 base::Bind(&CreateOrUpdateDesktopShortcutsForProfile, profile_path, |
| 700 old_shortcut_appended_name, new_shortcut_appended_name, | 699 old_shortcut_appended_name, new_shortcut_appended_name, |
| 701 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode, | 700 avatar_bitmap_copy_1x, avatar_bitmap_copy_2x, create_mode, |
| 702 action)); | 701 action)); |
| 703 | 702 |
| 704 cache->SetShortcutNameOfProfileAtIndex(profile_index, | 703 cache->SetShortcutNameOfProfileAtIndex(profile_index, |
| 705 new_shortcut_appended_name); | 704 new_shortcut_appended_name); |
| 706 } | 705 } |
| OLD | NEW |