| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 27 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
| 28 : GoogleChromeDistribution(std::unique_ptr<AppRegistrationData>( | 28 : GoogleChromeDistribution(std::unique_ptr<AppRegistrationData>( |
| 29 new UpdatingAppRegistrationData(kChromeSxSGuid))) {} | 29 new UpdatingAppRegistrationData(kChromeSxSGuid))) {} |
| 30 | 30 |
| 31 base::string16 GoogleChromeSxSDistribution::GetBaseAppName() { | 31 base::string16 GoogleChromeSxSDistribution::GetBaseAppName() { |
| 32 return L"Google Chrome Canary"; | 32 return L"Google Chrome Canary"; |
| 33 } | 33 } |
| 34 | 34 |
| 35 base::string16 GoogleChromeSxSDistribution::GetShortcutName( | 35 base::string16 GoogleChromeSxSDistribution::GetShortcutName() { |
| 36 ShortcutType shortcut_type) { | 36 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); |
| 37 switch (shortcut_type) { | |
| 38 case SHORTCUT_APP_LAUNCHER: | |
| 39 return installer::GetLocalizedString( | |
| 40 IDS_APP_LIST_SHORTCUT_NAME_CANARY_BASE); | |
| 41 default: | |
| 42 DCHECK_EQ(SHORTCUT_CHROME, shortcut_type); | |
| 43 return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); | |
| 44 } | |
| 45 } | 37 } |
| 46 | 38 |
| 47 base::string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( | 39 base::string16 GoogleChromeSxSDistribution::GetStartMenuShortcutSubfolder( |
| 48 Subfolder subfolder_type) { | 40 Subfolder subfolder_type) { |
| 49 switch (subfolder_type) { | 41 switch (subfolder_type) { |
| 50 case SUBFOLDER_APPS: | 42 case SUBFOLDER_APPS: |
| 51 return installer::GetLocalizedString( | 43 return installer::GetLocalizedString( |
| 52 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); | 44 IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY_BASE); |
| 53 default: | 45 default: |
| 54 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); | 46 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); |
| 55 return GetShortcutName(SHORTCUT_CHROME); | 47 return GetShortcutName(); |
| 56 } | 48 } |
| 57 } | 49 } |
| 58 | 50 |
| 59 base::string16 GoogleChromeSxSDistribution::GetBaseAppId() { | 51 base::string16 GoogleChromeSxSDistribution::GetBaseAppId() { |
| 60 return kBrowserAppId; | 52 return kBrowserAppId; |
| 61 } | 53 } |
| 62 | 54 |
| 63 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { | 55 base::string16 GoogleChromeSxSDistribution::GetBrowserProgIdPrefix() { |
| 64 return kBrowserProgIdPrefix; | 56 return kBrowserProgIdPrefix; |
| 65 } | 57 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 76 base::string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 68 base::string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
| 77 return GoogleChromeDistribution::GetUninstallRegPath().append( | 69 return GoogleChromeDistribution::GetUninstallRegPath().append( |
| 78 installer::kSxSSuffix); | 70 installer::kSxSSuffix); |
| 79 } | 71 } |
| 80 | 72 |
| 81 BrowserDistribution::DefaultBrowserControlPolicy | 73 BrowserDistribution::DefaultBrowserControlPolicy |
| 82 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { | 74 GoogleChromeSxSDistribution::GetDefaultBrowserControlPolicy() { |
| 83 return DEFAULT_BROWSER_OS_CONTROL_ONLY; | 75 return DEFAULT_BROWSER_OS_CONTROL_ONLY; |
| 84 } | 76 } |
| 85 | 77 |
| 86 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { | 78 int GoogleChromeSxSDistribution::GetIconIndex() { |
| 87 if (shortcut_type == SHORTCUT_APP_LAUNCHER) | |
| 88 return icon_resources::kSxSAppLauncherIndex; | |
| 89 DCHECK_EQ(SHORTCUT_CHROME, shortcut_type); | |
| 90 return icon_resources::kSxSApplicationIndex; | 79 return icon_resources::kSxSApplicationIndex; |
| 91 } | 80 } |
| 92 | 81 |
| 93 bool GoogleChromeSxSDistribution::GetChromeChannel(base::string16* channel) { | 82 bool GoogleChromeSxSDistribution::GetChromeChannel(base::string16* channel) { |
| 94 *channel = kChannelName; | 83 *channel = kChannelName; |
| 95 return true; | 84 return true; |
| 96 } | 85 } |
| 97 | 86 |
| 98 base::string16 GoogleChromeSxSDistribution::GetCommandExecuteImplClsid() { | 87 base::string16 GoogleChromeSxSDistribution::GetCommandExecuteImplClsid() { |
| 99 return kCommandExecuteImplUuid; | 88 return kCommandExecuteImplUuid; |
| 100 } | 89 } |
| 101 | 90 |
| 102 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 91 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
| 103 return true; | 92 return true; |
| 104 } | 93 } |
| 105 | 94 |
| 106 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 95 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
| 107 return true; | 96 return true; |
| 108 } | 97 } |
| 109 | 98 |
| 110 base::string16 GoogleChromeSxSDistribution::ChannelName() { | 99 base::string16 GoogleChromeSxSDistribution::ChannelName() { |
| 111 return kChannelName; | 100 return kChannelName; |
| 112 } | 101 } |
| OLD | NEW |