Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 23 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
| 24 : GoogleChromeDistribution() { | 24 : GoogleChromeDistribution() { |
| 25 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); | 25 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); |
| 26 } | 26 } |
| 27 | 27 |
| 28 string16 GoogleChromeSxSDistribution::GetBaseAppName() { | 28 string16 GoogleChromeSxSDistribution::GetBaseAppName() { |
| 29 return L"Google Chrome Canary"; | 29 return L"Google Chrome Canary"; |
| 30 } | 30 } |
| 31 | 31 |
| 32 string16 GoogleChromeSxSDistribution::GetAppShortCutName() { | 32 string16 GoogleChromeSxSDistribution::GetShortcutName( |
| 33 const string16& shortcut_name = | 33 ShortcutType shortcut_type) { |
| 34 installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE); | 34 switch (shortcut_type) { |
|
grt (UTC plus 2)
2013/07/05 17:27:37
I think it's bad for this to ever return the empty
calamity
2013/07/16 04:05:17
Done.
| |
| 35 return shortcut_name; | 35 case SHORTCUT_CHROME: |
| 36 return GetBaseAppName(); | |
|
gab
2013/07/05 14:23:37
Make this
installer::GetLocalizedString(IDS_SXS_SH
calamity
2013/07/16 04:05:17
Done.
| |
| 37 case SHORTCUT_ALTERNATE_CHROME: | |
| 38 return L"The Internet"; | |
|
gab
2013/07/05 14:23:37
Actually, this should just use GoogleChromeDsitrib
calamity
2013/07/16 04:05:17
Done.
| |
| 39 case SHORTCUT_APP_LAUNCHER: | |
| 40 // TODO(calamity): Replace with a localized string. | |
| 41 return L"Chrome App Launcher Canary"; | |
| 42 default: | |
| 43 NOTREACHED(); | |
| 44 return string16(); | |
| 45 } | |
| 36 } | 46 } |
| 37 | 47 |
| 38 string16 GoogleChromeSxSDistribution::GetBaseAppId() { | 48 string16 GoogleChromeSxSDistribution::GetBaseAppId() { |
| 39 return kBrowserAppId; | 49 return kBrowserAppId; |
| 40 } | 50 } |
| 41 | 51 |
| 42 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { | 52 string16 GoogleChromeSxSDistribution::GetInstallSubDir() { |
| 43 return GoogleChromeDistribution::GetInstallSubDir().append( | 53 return GoogleChromeDistribution::GetInstallSubDir().append( |
| 44 installer::kSxSSuffix); | 54 installer::kSxSSuffix); |
| 45 } | 55 } |
| 46 | 56 |
| 47 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 57 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
| 48 return GoogleChromeDistribution::GetUninstallRegPath().append( | 58 return GoogleChromeDistribution::GetUninstallRegPath().append( |
| 49 installer::kSxSSuffix); | 59 installer::kSxSSuffix); |
| 50 } | 60 } |
| 51 | 61 |
| 52 bool GoogleChromeSxSDistribution::CanSetAsDefault() { | 62 bool GoogleChromeSxSDistribution::CanSetAsDefault() { |
| 53 return false; | 63 return false; |
| 54 } | 64 } |
| 55 | 65 |
| 56 int GoogleChromeSxSDistribution::GetIconIndex() { | 66 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { |
| 57 return kSxSIconIndex; | 67 switch (shortcut_type) { |
| 68 case SHORTCUT_CHROME: | |
| 69 case SHORTCUT_ALTERNATE_CHROME: | |
| 70 return kSxSIconIndex; | |
| 71 case SHORTCUT_APP_LAUNCHER: | |
| 72 return 5; | |
| 73 default: | |
| 74 NOTREACHED(); | |
| 75 return 0; | |
|
grt (UTC plus 2)
2013/07/05 17:27:37
this should never return 0, since that would resul
calamity
2013/07/16 04:05:17
Done.
| |
| 76 } | |
| 58 } | 77 } |
| 59 | 78 |
| 60 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { | 79 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { |
| 61 *channel = kChannelName; | 80 *channel = kChannelName; |
| 62 return true; | 81 return true; |
| 63 } | 82 } |
| 64 | 83 |
| 65 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( | 84 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( |
| 66 string16* handler_class_uuid) { | 85 string16* handler_class_uuid) { |
| 67 return false; | 86 return false; |
| 68 } | 87 } |
| 69 | 88 |
| 70 bool GoogleChromeSxSDistribution::AppHostIsSupported() { | 89 bool GoogleChromeSxSDistribution::AppHostIsSupported() { |
| 71 return false; | 90 return false; |
| 72 } | 91 } |
| 73 | 92 |
| 74 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 93 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
| 75 return true; | 94 return true; |
| 76 } | 95 } |
| 77 | 96 |
| 78 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 97 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
| 79 return true; | 98 return true; |
| 80 } | 99 } |
| 81 | 100 |
| 82 string16 GoogleChromeSxSDistribution::ChannelName() { | 101 string16 GoogleChromeSxSDistribution::ChannelName() { |
| 83 return kChannelName; | 102 return kChannelName; |
| 84 } | 103 } |
| OLD | NEW |