Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2059)

Unified Diff: chrome/browser/profiles/profile_shortcut_manager_win.h

Issue 1540543002: Uniquify profile shortcut name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..77967fc26759df64ac3e24fe9e5805227eb6b8a2 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,27 @@ base::FilePath GetProfileIconPath(const base::FilePath& profile_path);
base::string16 GetShortcutFilenameForProfile(const base::string16& profile_name,
BrowserDistribution* distribution);
+// The same as above but uniqueness is guaranteed.
anthonyvd 2016/01/04 16:30:18 nit: maybe name the function directly so this comm
+base::string16 GetShortcutUniqueFilenameForProfile(
Alexei Svitkine (slow) 2016/01/05 19:55:22 Nit: GetUniqueShortcutFilenameForProfile().
+ const base::string16& profile_name,
+ BrowserDistribution* distribution,
+ const std::set<base::FilePath>& excludes);
+
+class ShortcutFilenameMatcher {
Alexei Svitkine (slow) 2016/01/05 19:55:22 Add a comment about the purpose of this class.
+ public:
+ ShortcutFilenameMatcher(const base::string16& profile_name,
+ BrowserDistribution* distribution);
+
+ // Check that shortcut filename has a name given by us (by
+ // GetShortcutFilenameForProfile or GetShortcutUniqueFilenameForProfile).
+ bool IsCanonical(const base::string16& filename) const;
+
+ private:
+ const base::string16 profile_shortcut_filename_;
+ const base::StringPiece16 lnk_ext_;
+ base::StringPiece16 profile_shortcut_name_;
+};
Alexei Svitkine (slow) 2016/01/05 19:55:22 Nit: DISALLOW_COPY_AND_ASSIGN()
+
// Returns the command-line flags to launch Chrome with the given profile.
base::string16 CreateProfileShortcutFlags(const base::FilePath& profile_path);

Powered by Google App Engine
This is Rietveld 408576698