| 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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/profiles/profile_attributes_storage.h" | |
| 13 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 12 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 14 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 16 | 15 |
| 17 class BrowserDistribution; | 16 class BrowserDistribution; |
| 18 | 17 |
| 19 // Internal free-standing functions that are exported here for testing. | 18 // Internal free-standing functions that are exported here for testing. |
| 20 namespace profiles { | 19 namespace profiles { |
| 21 namespace internal { | 20 namespace internal { |
| 22 | 21 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 DISALLOW_COPY_AND_ASSIGN(ShortcutFilenameMatcher); | 53 DISALLOW_COPY_AND_ASSIGN(ShortcutFilenameMatcher); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 // Returns the command-line flags to launch Chrome with the given profile. | 56 // Returns the command-line flags to launch Chrome with the given profile. |
| 58 base::string16 CreateProfileShortcutFlags(const base::FilePath& profile_path); | 57 base::string16 CreateProfileShortcutFlags(const base::FilePath& profile_path); |
| 59 | 58 |
| 60 } // namespace internal | 59 } // namespace internal |
| 61 } // namespace profiles | 60 } // namespace profiles |
| 62 | 61 |
| 63 class ProfileShortcutManagerWin : public ProfileShortcutManager, | 62 class ProfileShortcutManagerWin : public ProfileShortcutManager, |
| 64 public ProfileAttributesStorage::Observer, | 63 public ProfileInfoCacheObserver, |
| 65 public content::NotificationObserver { | 64 public content::NotificationObserver { |
| 66 public: | 65 public: |
| 67 // Specifies whether only the existing shortcut should be updated, a new | 66 // Specifies whether only the existing shortcut should be updated, a new |
| 68 // shortcut should be created if none exist, or only the icon for this profile | 67 // shortcut should be created if none exist, or only the icon for this profile |
| 69 // should be created in the profile directory. | 68 // should be created in the profile directory. |
| 70 enum CreateOrUpdateMode { | 69 enum CreateOrUpdateMode { |
| 71 UPDATE_EXISTING_ONLY, | 70 UPDATE_EXISTING_ONLY, |
| 72 CREATE_WHEN_NONE_FOUND, | 71 CREATE_WHEN_NONE_FOUND, |
| 73 CREATE_OR_UPDATE_ICON_ONLY, | 72 CREATE_OR_UPDATE_ICON_ONLY, |
| 74 }; | 73 }; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 85 void CreateOrUpdateProfileIcon(const base::FilePath& profile_path) override; | 84 void CreateOrUpdateProfileIcon(const base::FilePath& profile_path) override; |
| 86 void CreateProfileShortcut(const base::FilePath& profile_path) override; | 85 void CreateProfileShortcut(const base::FilePath& profile_path) override; |
| 87 void RemoveProfileShortcuts(const base::FilePath& profile_path) override; | 86 void RemoveProfileShortcuts(const base::FilePath& profile_path) override; |
| 88 void HasProfileShortcuts(const base::FilePath& profile_path, | 87 void HasProfileShortcuts(const base::FilePath& profile_path, |
| 89 const base::Callback<void(bool)>& callback) override; | 88 const base::Callback<void(bool)>& callback) override; |
| 90 void GetShortcutProperties(const base::FilePath& profile_path, | 89 void GetShortcutProperties(const base::FilePath& profile_path, |
| 91 base::CommandLine* command_line, | 90 base::CommandLine* command_line, |
| 92 base::string16* name, | 91 base::string16* name, |
| 93 base::FilePath* icon_path) override; | 92 base::FilePath* icon_path) override; |
| 94 | 93 |
| 95 // ProfileAttributesStorage::Observer implementation: | 94 // ProfileInfoCacheObserver implementation: |
| 96 void OnProfileAdded(const base::FilePath& profile_path) override; | 95 void OnProfileAdded(const base::FilePath& profile_path) override; |
| 97 void OnProfileWasRemoved(const base::FilePath& profile_path, | 96 void OnProfileWasRemoved(const base::FilePath& profile_path, |
| 98 const base::string16& profile_name) override; | 97 const base::string16& profile_name) override; |
| 99 void OnProfileNameChanged(const base::FilePath& profile_path, | 98 void OnProfileNameChanged(const base::FilePath& profile_path, |
| 100 const base::string16& old_profile_name) override; | 99 const base::string16& old_profile_name) override; |
| 101 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | 100 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; |
| 102 | 101 |
| 103 // content::NotificationObserver implementation: | 102 // content::NotificationObserver implementation: |
| 104 void Observe(int type, | 103 void Observe(int type, |
| 105 const content::NotificationSource& source, | 104 const content::NotificationSource& source, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 119 NonProfileShortcutAction action); | 118 NonProfileShortcutAction action); |
| 120 | 119 |
| 121 ProfileManager* profile_manager_; | 120 ProfileManager* profile_manager_; |
| 122 | 121 |
| 123 content::NotificationRegistrar registrar_; | 122 content::NotificationRegistrar registrar_; |
| 124 | 123 |
| 125 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); | 124 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManagerWin); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ | 127 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
| OLD | NEW |