| 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 int kSxSIconIndex = 4; | 19 const int kSxSIconIndex = 4; |
| 20 const wchar_t kCommandExecuteImplUuid[] = |
| 21 L"{1BEAC3E3-B852-44F4-B468-8906C062422E}"; |
| 20 | 22 |
| 21 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. | 23 // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc. |
| 22 const int kSxSAppLauncherIconIndex = 6; | 24 const int kSxSAppLauncherIconIndex = 6; |
| 23 | 25 |
| 24 } // namespace | 26 } // namespace |
| 25 | 27 |
| 26 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() | 28 GoogleChromeSxSDistribution::GoogleChromeSxSDistribution() |
| 27 : GoogleChromeDistribution() { | 29 : GoogleChromeDistribution(), |
| 30 enable_set_as_default_(false) { |
| 28 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); | 31 GoogleChromeDistribution::set_product_guid(kChromeSxSGuid); |
| 29 } | 32 } |
| 30 | 33 |
| 31 string16 GoogleChromeSxSDistribution::GetBaseAppName() { | 34 string16 GoogleChromeSxSDistribution::GetBaseAppName() { |
| 32 return L"Google Chrome Canary"; | 35 return L"Google Chrome Canary"; |
| 33 } | 36 } |
| 34 | 37 |
| 35 string16 GoogleChromeSxSDistribution::GetShortcutName( | 38 string16 GoogleChromeSxSDistribution::GetShortcutName( |
| 36 ShortcutType shortcut_type) { | 39 ShortcutType shortcut_type) { |
| 37 switch (shortcut_type) { | 40 switch (shortcut_type) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 return GoogleChromeDistribution::GetInstallSubDir().append( | 60 return GoogleChromeDistribution::GetInstallSubDir().append( |
| 58 installer::kSxSSuffix); | 61 installer::kSxSSuffix); |
| 59 } | 62 } |
| 60 | 63 |
| 61 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { | 64 string16 GoogleChromeSxSDistribution::GetUninstallRegPath() { |
| 62 return GoogleChromeDistribution::GetUninstallRegPath().append( | 65 return GoogleChromeDistribution::GetUninstallRegPath().append( |
| 63 installer::kSxSSuffix); | 66 installer::kSxSSuffix); |
| 64 } | 67 } |
| 65 | 68 |
| 66 bool GoogleChromeSxSDistribution::CanSetAsDefault() { | 69 bool GoogleChromeSxSDistribution::CanSetAsDefault() { |
| 67 return false; | 70 return enable_set_as_default_; |
| 71 } |
| 72 |
| 73 void GoogleChromeSxSDistribution::DebugEnableSetAsDefault() { |
| 74 enable_set_as_default_ = true; |
| 68 } | 75 } |
| 69 | 76 |
| 70 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { | 77 int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) { |
| 71 if (shortcut_type == SHORTCUT_APP_LAUNCHER) | 78 if (shortcut_type == SHORTCUT_APP_LAUNCHER) |
| 72 return kSxSAppLauncherIconIndex; | 79 return kSxSAppLauncherIconIndex; |
| 73 DCHECK(shortcut_type == SHORTCUT_CHROME || | 80 DCHECK(shortcut_type == SHORTCUT_CHROME || |
| 74 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; | 81 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; |
| 75 return kSxSIconIndex; | 82 return kSxSIconIndex; |
| 76 } | 83 } |
| 77 | 84 |
| 78 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { | 85 bool GoogleChromeSxSDistribution::GetChromeChannel(string16* channel) { |
| 79 *channel = kChannelName; | 86 *channel = kChannelName; |
| 80 return true; | 87 return true; |
| 81 } | 88 } |
| 82 | 89 |
| 83 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( | 90 bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid( |
| 84 string16* handler_class_uuid) { | 91 string16* handler_class_uuid) { |
| 85 return false; | 92 if (handler_class_uuid) |
| 93 *handler_class_uuid = kCommandExecuteImplUuid; |
| 94 return true; |
| 86 } | 95 } |
| 87 | 96 |
| 88 bool GoogleChromeSxSDistribution::AppHostIsSupported() { | 97 bool GoogleChromeSxSDistribution::AppHostIsSupported() { |
| 89 return false; | 98 return false; |
| 90 } | 99 } |
| 91 | 100 |
| 92 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { | 101 bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() { |
| 93 return true; | 102 return true; |
| 94 } | 103 } |
| 95 | 104 |
| 96 bool GoogleChromeSxSDistribution::HasUserExperiments() { | 105 bool GoogleChromeSxSDistribution::HasUserExperiments() { |
| 97 return true; | 106 return true; |
| 98 } | 107 } |
| 99 | 108 |
| 100 string16 GoogleChromeSxSDistribution::ChannelName() { | 109 string16 GoogleChromeSxSDistribution::ChannelName() { |
| 101 return kChannelName; | 110 return kChannelName; |
| 102 } | 111 } |
| OLD | NEW |