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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 23258005: Give SxS distribution its own registration GUIDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add linker dependency from metro_driver to installer_util Created 7 years, 3 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
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index a5122d50ad4c3fa472a15585b3bbac1e020d3a8e..ad1aa1af6b0fda0d22bb32473314f644eb98b143 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -102,7 +102,7 @@ bool IsChromeMetroSupported() {
// "ChromeHTML|suffix|").
// |suffix| can be the empty string.
string16 GetBrowserProgId(const string16& suffix) {
- string16 chrome_html(ShellUtil::kChromeHTMLProgId);
+ string16 chrome_html(ShellUtil::GetBrowserProgIdPrefix());
chrome_html.append(suffix);
// ProgIds cannot be longer than 39 characters.
@@ -289,7 +289,7 @@ class RegistryEntry {
chrome_html_prog_id.push_back(base::FilePath::kSeparators[0]);
chrome_html_prog_id.append(GetBrowserProgId(suffix));
entries->push_back(new RegistryEntry(
- chrome_html_prog_id, ShellUtil::kChromeHTMLProgIdDesc));
+ chrome_html_prog_id, ShellUtil::GetBrowserProgIdDesc()));
entries->push_back(new RegistryEntry(
chrome_html_prog_id, ShellUtil::kRegUrlProtocol, L""));
entries->push_back(new RegistryEntry(
@@ -789,7 +789,7 @@ bool QuickIsChromeRegistered(BrowserDistribution* dist,
// Software\Classes\ChromeHTML|suffix|
reg_key = ShellUtil::kRegClasses;
reg_key.push_back(base::FilePath::kSeparators[0]);
- reg_key.append(ShellUtil::kChromeHTMLProgId);
+ reg_key.append(ShellUtil::GetBrowserProgIdPrefix());
reg_key.append(suffix);
break;
case CONFIRM_SHELL_REGISTRATION:
@@ -1058,7 +1058,7 @@ ShellUtil::DefaultState ProbeCurrentDefaultHandlers(
NOTREACHED();
return ShellUtil::UNKNOWN_DEFAULT;
}
- string16 prog_id(ShellUtil::kChromeHTMLProgId);
+ string16 prog_id(ShellUtil::GetBrowserProgIdPrefix());
prog_id += ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe.value());
for (size_t i = 0; i < num_protocols; ++i) {
@@ -1344,8 +1344,11 @@ const wchar_t* ShellUtil::kAppPathsRegistryKey =
const wchar_t* ShellUtil::kAppPathsRegistryPathName = L"Path";
#if defined(GOOGLE_CHROME_BUILD)
-const wchar_t* ShellUtil::kChromeHTMLProgId = L"ChromeHTML";
-const wchar_t* ShellUtil::kChromeHTMLProgIdDesc = L"Chrome HTML Document";
+const wchar_t* ShellUtil::kChromeStableHTMLProgId = L"ChromeHTML";
grt (UTC plus 2) 2013/09/04 03:33:36 these constants are no longer public, so move them
zturner 2013/09/05 01:35:29 Done.
+const wchar_t* ShellUtil::kChromeStableHTMLProgIdDesc = L"Chrome HTML Document";
+const wchar_t* ShellUtil::kChromeSXSHTMLProgId = L"ChromeSSHTM";
+const wchar_t* ShellUtil::kChromeSXSHTMLProgIdDesc =
+ L"Chrome Canary HTML Document";
#else
// This used to be "ChromiumHTML", but was forced to become "ChromiumHTM"
// because of http://crbug.com/153349 as with the '.' and 26 characters suffix
@@ -1354,8 +1357,8 @@ const wchar_t* ShellUtil::kChromeHTMLProgIdDesc = L"Chrome HTML Document";
// http://msdn.microsoft.com/library/aa911706.aspx), is the maximum length
// for a progid. It was however determined through experimentation that the 39
// character limit mentioned on MSDN includes the NULL character...
-const wchar_t* ShellUtil::kChromeHTMLProgId = L"ChromiumHTM";
-const wchar_t* ShellUtil::kChromeHTMLProgIdDesc = L"Chromium HTML Document";
+const wchar_t* ShellUtil::kChromiumHTMLProgId = L"ChromiumHTM";
+const wchar_t* ShellUtil::kChromiumHTMLProgIdDesc = L"Chromium HTML Document";
#endif
const wchar_t* ShellUtil::kDefaultFileAssociations[] = {L".htm", L".html",
@@ -1390,6 +1393,29 @@ bool ShellUtil::QuickIsChromeRegisteredInHKLM(BrowserDistribution* dist,
CONFIRM_SHELL_REGISTRATION_IN_HKLM);
}
+
+string16 ShellUtil::GetBrowserProgIdPrefix() {
+#if defined(GOOGLE_CHROME_BUILD)
+ if (InstallUtil::IsChromeSXSProcess())
+ return string16(ShellUtil::kChromeSXSHTMLProgId);
+ else
+ return string16(ShellUtil::kChromeStableHTMLProgId);
+#else
+ return string16(ShellUtil::kChromiumHTMLProgId);
+#endif
+}
+
+string16 ShellUtil::GetBrowserProgIdDesc() {
+#if defined(GOOGLE_CHROME_BUILD)
+ if (InstallUtil::IsChromeSXSProcess())
+ return string16(ShellUtil::kChromeSXSHTMLProgIdDesc);
+ else
+ return string16(ShellUtil::kChromeStableHTMLProgIdDesc);
+#else
+ return string16(ShellUtil::kChromiumHTMLProgIdDesc);
+#endif
+}
+
bool ShellUtil::ShortcutLocationIsSupported(
ShellUtil::ShortcutLocation location) {
switch (location) {

Powered by Google App Engine
This is Rietveld 408576698