| 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 #include "chrome/common/chrome_icon_resources_win.h" | 11 #include "chrome/common/chrome_icon_resources_win.h" |
| 12 #include "chrome/installer/util/installer_util_strings.h" | 12 #include "chrome/installer/util/installer_util_strings.h" |
| 13 #include "chrome/installer/util/updating_app_registration_data.h" | 13 #include "chrome/installer/util/updating_app_registration_data.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; | 17 const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; |
| 18 const wchar_t kBrowserProgIdPrefix[] = L"ChromeSSHTM"; | |
| 19 const wchar_t kBrowserProgIdDesc[] = L"Chrome Canary HTML Document"; | |
| 20 const wchar_t kCommandExecuteImplUuid[] = | 18 const wchar_t kCommandExecuteImplUuid[] = |
| 21 L"{1BEAC3E3-B852-44F4-B468-8906C062422E}"; | 19 L"{1BEAC3E3-B852-44F4-B468-8906C062422E}"; |
| 22 | 20 |
| 23 } // namespace | 21 } // namespace |
| 24 | 22 |
| 25 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
| 26 : GoogleChromeDistribution(std::unique_ptr<AppRegistrationData>( | 24 : GoogleChromeDistribution(std::unique_ptr<AppRegistrationData>( |
| 27 new UpdatingAppRegistrationData(kChromeSxSGuid))) {} | 25 new UpdatingAppRegistrationData(kChromeSxSGuid))) {} |
| 28 | 26 |
| 29 base::string16 GoogleChromeSxSDistribution::GetBaseAppName() { | 27 base::string16 GoogleChromeSxSDistribution::GetBaseAppName() { |
| 30 return L"Google Chrome Canary"; | 28 return L"Google Chrome Canary"; |
| 31 } | 29 } |
| 32 | 30 |
| 33 base::string16 GoogleChromeSxSDistribution::GetShortcutName() { | 31 base::string16 GoogleChromeSxSDistribution::GetShortcutName() { |
| 34 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); | 32 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); |
| 35 } | 33 } |
| 36 | 34 |
| 37 base::string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( | 35 base::string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( |
| 38 Subfolder subfolder_type) { | 36 Subfolder subfolder_type) { |
| 39 switch (subfolder_type) { | 37 switch (subfolder_type) { |
| 40 case SUBFOLDER_APPS: | 38 case SUBFOLDER_APPS: |
| 41 return installer::GetLocalizedString( | 39 return installer::GetLocalizedString( |
| 42 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); | 40 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); |
| 43 default: | 41 default: |
| 44 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); | 42 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); |
| 45 return GetShortcutName(); | 43 return GetShortcutName(); |
| 46 } | 44 } |
| 47 } | 45 } |
| 48 | 46 |
| 49 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { | |
| 50 return kBrowserProgIdPrefix; | |
| 51 } | |
| 52 | |
| 53 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdDesc() { | |
| 54 return kBrowserProgIdDesc; | |
| 55 } | |
| 56 | |
| 57 base::string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 47 base::string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
| 58 return GoogleChromeDistribution::GetUninstallRegPath().append( | 48 return GoogleChromeDistribution::GetUninstallRegPath().append( |
| 59 installer::kSxSSuffix); | 49 installer::kSxSSuffix); |
| 60 } | 50 } |
| 61 | 51 |
| 62 BrowserDistribution::DefaultBrowserControlPolicy | 52 BrowserDistribution::DefaultBrowserControlPolicy |
| 63 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { | 53 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { |
| 64 return DEFAULT_BROWSER_OS_CONTROL_ONLY; | 54 return DEFAULT_BROWSER_OS_CONTROL_ONLY; |
| 65 } | 55 } |
| 66 | 56 |
| 67 int GoogleChromeSxSDistribution::GetIconIndex() { | 57 int GoogleChromeSxSDistribution::GetIconIndex() { |
| 68 return icon_resources::kSxSApplicationIndex; | 58 return icon_resources::kSxSApplicationIndex; |
| 69 } | 59 } |
| 70 | 60 |
| 71 base::string16 GoogleChromeSxSDistribution::GetCommandExecuteImplClsid() { | 61 base::string16 GoogleChromeSxSDistribution::GetCommandExecuteImplClsid() { |
| 72 return kCommandExecuteImplUuid; | 62 return kCommandExecuteImplUuid; |
| 73 } | 63 } |
| 74 | 64 |
| 75 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 65 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
| 76 return true; | 66 return true; |
| 77 } | 67 } |
| 78 | 68 |
| 79 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 69 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
| 80 return true; | 70 return true; |
| 81 } | 71 } |
| OLD | NEW |