| 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 // This file defines implementation of GoogleChromeSxSDistribution. | 5 // This file defines implementation of GoogleChromeSxSDistribution. |
| 6 | 6 |
| 7 #include "chrome/installer/util/google_chrome_sxs_distribution.h" | 7 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 | 11 |
| 12 #include "installer_util_strings.h" // NOLINT | 12 #include "installer_util_strings.h" // NOLINT |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; | 16 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; |
| 17 const wchar_t kChannelName[] = L"canary"; | 17 const wchar_t kChannelName[] = L"canary"; |
| 18 const wchar_t kBrowserAppId[] = L"ChromeCanary"; | 18 const wchar_t kBrowserAppId[] = L"ChromeCanary"; |
| 19 const wchar_t kBrowserProgIdPrefix[] = L"ChromeSSHTM"; |
| 20 const wchar_t kBrowserProgIdDesc[] = L"Chrome Canary HTML Document"; |
| 19 const int kSxSIconIndex = 4; | 21 const int kSxSIconIndex = 4; |
| 22 const wchar_t kCommandExecuteImplUuid[] = |
| 23 L"{1BEAC3E3-B852-44F4-B468-8906C062422E}"; |
| 20 | 24 |
| 21 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. | 25 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. |
| 22 const int kSxSAppLauncherIconIndex = 6; | 26 const int kSxSAppLauncherIconIndex = 6; |
| 23 | 27 |
| 24 } // namespace | 28 } // namespace |
| 25 | 29 |
| 26 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 30 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
| 27 : GoogleChromeDistribution() { | 31 : GoogleChromeDistribution() { |
| 28 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); | 32 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); |
| 29 } | 33 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 46 default: | 50 default: |
| 47 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); | 51 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); |
| 48 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); | 52 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); |
| 49 } | 53 } |
| 50 } | 54 } |
| 51 | 55 |
| 52 string16 GoogleChromeSxSDistribution::GetBaseAppId() { | 56 string16 GoogleChromeSxSDistribution::GetBaseAppId() { |
| 53 return kBrowserAppId; | 57 return kBrowserAppId; |
| 54 } | 58 } |
| 55 | 59 |
| 60 string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { |
| 61 return kBrowserProgIdPrefix; |
| 62 } |
| 63 |
| 64 string16 GoogleChromeSxSDistribution::GetBrowserProgIdDesc() { |
| 65 return kBrowserProgIdDesc; |
| 66 } |
| 67 |
| 56 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { | 68 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { |
| 57 return GoogleChromeDistribution::GetInstallSubDir().append( | 69 return GoogleChromeDistribution::GetInstallSubDir().append( |
| 58 installer::kSxSSuffix); | 70 installer::kSxSSuffix); |
| 59 } | 71 } |
| 60 | 72 |
| 61 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 73 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
| 62 return GoogleChromeDistribution::GetUninstallRegPath().append( | 74 return GoogleChromeDistribution::GetUninstallRegPath().append( |
| 63 installer::kSxSSuffix); | 75 installer::kSxSSuffix); |
| 64 } | 76 } |
| 65 | 77 |
| 66 bool GoogleChromeSxSDistribution::CanSetAsDefault() { | 78 bool GoogleChromeSxSDistribution::CanSetAsDefault() { |
| 67 return false; | 79 return false; |
| 68 } | 80 } |
| 69 | 81 |
| 70 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { | 82 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { |
| 71 if (shortcut_type == SHORTCUT_APP_LAUNCHER) | 83 if (shortcut_type == SHORTCUT_APP_LAUNCHER) |
| 72 return kSxSAppLauncherIconIndex; | 84 return kSxSAppLauncherIconIndex; |
| 73 DCHECK(shortcut_type == SHORTCUT_CHROME || | 85 DCHECK(shortcut_type == SHORTCUT_CHROME || |
| 74 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; | 86 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; |
| 75 return kSxSIconIndex; | 87 return kSxSIconIndex; |
| 76 } | 88 } |
| 77 | 89 |
| 78 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { | 90 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { |
| 79 *channel = kChannelName; | 91 *channel = kChannelName; |
| 80 return true; | 92 return true; |
| 81 } | 93 } |
| 82 | 94 |
| 83 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( | 95 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( |
| 84 string16* handler_class_uuid) { | 96 string16* handler_class_uuid) { |
| 85 return false; | 97 if (handler_class_uuid) |
| 98 *handler_class_uuid = kCommandExecuteImplUuid; |
| 99 return true; |
| 86 } | 100 } |
| 87 | 101 |
| 88 bool GoogleChromeSxSDistribution::AppHostIsSupported() { | 102 bool GoogleChromeSxSDistribution::AppHostIsSupported() { |
| 89 return false; | 103 return false; |
| 90 } | 104 } |
| 91 | 105 |
| 92 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 106 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
| 93 return true; | 107 return true; |
| 94 } | 108 } |
| 95 | 109 |
| 96 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 110 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
| 97 return true; | 111 return true; |
| 98 } | 112 } |
| 99 | 113 |
| 100 string16 GoogleChromeSxSDistribution::ChannelName() { | 114 string16 GoogleChromeSxSDistribution::ChannelName() { |
| 101 return kChannelName; | 115 return kChannelName; |
| 102 } | 116 } |
| OLD | NEW |