Chromium Code Reviews| Index: chrome/browser/profiles/profile_shortcut_manager_win.h |
| diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.h b/chrome/browser/profiles/profile_shortcut_manager_win.h |
| index 7645b8d425c6d5b42edca5ef0bb9ef660ee80248..c303b556f014f87a873b3fbb97fb45cab2eeb29e 100644 |
| --- a/chrome/browser/profiles/profile_shortcut_manager_win.h |
| +++ b/chrome/browser/profiles/profile_shortcut_manager_win.h |
| @@ -5,6 +5,8 @@ |
| #ifndef CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
| #define CHROME_BROWSER_PROFILES_PROFILE_SHORTCUT_MANAGER_WIN_H_ |
| +#include <set> |
| + |
| #include "base/callback.h" |
| #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| #include "content/public/browser/notification_observer.h" |
| @@ -25,6 +27,30 @@ base::FilePath GetProfileIconPath(const base::FilePath& profile_path); |
| base::string16 GetShortcutFilenameForProfile(const base::string16& profile_name, |
| BrowserDistribution* distribution); |
| +// The same as GetShortcutFilenameForProfile but uniqueness is guaranteed. |
|
Alexei Svitkine (slow)
2016/01/18 16:43:08
Document |excludes| please.
|
| +base::string16 GetUniqueShortcutFilenameForProfile( |
| + const base::string16& profile_name, |
| + BrowserDistribution* distribution, |
|
Alexei Svitkine (slow)
2016/01/18 16:43:08
Nit: Non-const params should be last.
|
| + const std::set<base::FilePath>& excludes); |
| + |
| +// This class checks that shortcut filename matches certain profile. |
| +class ShortcutFilenameMatcher { |
| + public: |
| + ShortcutFilenameMatcher(const base::string16& profile_name, |
| + BrowserDistribution* distribution); |
| + |
| + // Check that shortcut filename has a name given by us (by |
| + // GetShortcutFilenameForProfile or GetUniqueShortcutFilenameForProfile). |
| + bool IsCanonical(const base::string16& filename) const; |
| + |
| + private: |
| + const base::string16 profile_shortcut_filename_; |
| + const base::StringPiece16 lnk_ext_; |
| + base::StringPiece16 profile_shortcut_name_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ShortcutFilenameMatcher); |
| +}; |
| + |
| // Returns the command-line flags to launch Chrome with the given profile. |
| base::string16 CreateProfileShortcutFlags(const base::FilePath& profile_path); |