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

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 2005163002: Avoid clobbering the app list pinned taskbar shortcut on startup (for now). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_win.cc
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index eaf5c403138683f41daeae20a80e700392893719..924ba48678e58f4c5bce6e9eb728ed55eb950fab 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -59,6 +59,8 @@ namespace shell_integration {
namespace {
+const wchar_t kAppListAppNameSuffix[] = L"AppList";
gab 2016/05/24 16:01:24 Inline as a "static base::char16[]" in GetAppListA
gab 2016/05/24 16:01:25 s/wchar_t/base::char16/ (identical on Windows but
tapted 2016/05/25 00:32:41 Done.
tapted 2016/05/25 00:32:41 Done.
+
// Helper function for GetAppId to generates profile id
// from profile path. "profile_id" is composed of sanitized basenames of
// user data dir and profile dir joined by a ".".
@@ -95,6 +97,13 @@ base::string16 GetProfileIdFromPath(const base::FilePath& profile_path) {
return profile_id;
}
+base::string16 GetAppListAppName() {
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ base::string16 app_name(dist->GetBaseAppId());
+ app_name.append(kAppListAppNameSuffix);
+ return app_name;
+}
+
// Gets expected app id for given Chrome (based on |command_line| and
// |is_per_user_install|).
base::string16 GetExpectedAppId(const base::CommandLine& command_line,
@@ -127,6 +136,8 @@ base::string16 GetExpectedAppId(const base::CommandLine& command_line,
app_name = base::UTF8ToUTF16(
web_app::GenerateApplicationNameFromExtensionId(
command_line.GetSwitchValueASCII(switches::kAppId)));
+ } else if (command_line.HasSwitch(switches::kShowAppList)) {
+ app_name = GetAppListAppName();
} else {
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
app_name = ShellUtil::GetBrowserModelId(dist, is_per_user_install);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698