| 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_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "chrome/browser/profiles/profile_info_cache.h" | 11 #include "chrome/browser/profiles/profile_info_cache.h" |
| 12 | 12 |
| 13 class ProfileManager; |
| 14 |
| 15 namespace base { |
| 13 class CommandLine; | 16 class CommandLine; |
| 14 class ProfileManager; | 17 } |
| 15 | 18 |
| 16 class ProfileShortcutManager { | 19 class ProfileShortcutManager { |
| 17 public: | 20 public: |
| 18 virtual ~ProfileShortcutManager(); | 21 virtual ~ProfileShortcutManager(); |
| 19 | 22 |
| 20 // Create a profile icon for the profile with path |profile_path|. | 23 // Create a profile icon for the profile with path |profile_path|. |
| 21 virtual void CreateOrUpdateProfileIcon( | 24 virtual void CreateOrUpdateProfileIcon( |
| 22 const base::FilePath& profile_path) = 0; | 25 const base::FilePath& profile_path) = 0; |
| 23 | 26 |
| 24 // Create a profile shortcut for the profile with path |profile_path|, plus | 27 // Create a profile shortcut for the profile with path |profile_path|, plus |
| 25 // update the original profile shortcut if |profile_path| is the second | 28 // update the original profile shortcut if |profile_path| is the second |
| 26 // profile created. | 29 // profile created. |
| 27 virtual void CreateProfileShortcut(const base::FilePath& profile_path) = 0; | 30 virtual void CreateProfileShortcut(const base::FilePath& profile_path) = 0; |
| 28 | 31 |
| 29 // Removes any desktop profile shortcuts for the profile corresponding to | 32 // Removes any desktop profile shortcuts for the profile corresponding to |
| 30 // |profile_path|. | 33 // |profile_path|. |
| 31 virtual void RemoveProfileShortcuts(const base::FilePath& profile_path) = 0; | 34 virtual void RemoveProfileShortcuts(const base::FilePath& profile_path) = 0; |
| 32 | 35 |
| 33 // Checks if a profile at |profile_path| has any shortcuts and invokes | 36 // Checks if a profile at |profile_path| has any shortcuts and invokes |
| 34 // |callback| with the bool result some time later. Does not consider | 37 // |callback| with the bool result some time later. Does not consider |
| 35 // non-profile specific shortcuts. | 38 // non-profile specific shortcuts. |
| 36 virtual void HasProfileShortcuts( | 39 virtual void HasProfileShortcuts( |
| 37 const base::FilePath& profile_path, | 40 const base::FilePath& profile_path, |
| 38 const base::Callback<void(bool)>& callback) = 0; | 41 const base::Callback<void(bool)>& callback) = 0; |
| 39 | 42 |
| 40 // Populates the |command_line|, |name| and |icon_path| that a shortcut for | 43 // Populates the |command_line|, |name| and |icon_path| that a shortcut for |
| 41 // the given |profile_path| should use. | 44 // the given |profile_path| should use. |
| 42 virtual void GetShortcutProperties(const base::FilePath& profile_path, | 45 virtual void GetShortcutProperties(const base::FilePath& profile_path, |
| 43 CommandLine* command_line, | 46 base::CommandLine* command_line, |
| 44 base::string16* name, | 47 base::string16* name, |
| 45 base::FilePath* icon_path) = 0; | 48 base::FilePath* icon_path) = 0; |
| 46 | 49 |
| 47 static bool IsFeatureEnabled(); | 50 static bool IsFeatureEnabled(); |
| 48 static ProfileShortcutManager* Create(ProfileManager* manager); | 51 static ProfileShortcutManager* Create(ProfileManager* manager); |
| 49 | 52 |
| 50 protected: | 53 protected: |
| 51 ProfileShortcutManager(); | 54 ProfileShortcutManager(); |
| 52 | 55 |
| 53 private: | 56 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManager); | 57 DISALLOW_COPY_AND_ASSIGN(ProfileShortcutManager); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_H_ | 60 #endif // CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_H_ |
| OLD | NEW |