summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 18:01:42 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 18:01:42 +0000
commit5ec8bbb0cd82e8f714013d3a3b8c8ab14869168c (patch)
treed47fcfee1349bdbeea62f63a3a1b2e1eb5d46e57
parent23c69d15ffe788daf9619e2701443dc886ce43e3 (diff)
downloadchromium_src-5ec8bbb0cd82e8f714013d3a3b8c8ab14869168c.zip
chromium_src-5ec8bbb0cd82e8f714013d3a3b8c8ab14869168c.tar.gz
chromium_src-5ec8bbb0cd82e8f714013d3a3b8c8ab14869168c.tar.bz2
No longer block installs of multi-install Chrome Frame when an existing install of Chrome is around on a different channel.
BUG=83571 TEST=install user level single Chrome then install user level multi Chrome Frame from a different channel. R=robertshield@chromium.org Review URL: http://codereview.chromium.org/6966035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87045 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/installer/setup/setup_main.cc26
-rw-r--r--chrome/installer/util/channel_info.cc14
-rw-r--r--chrome/installer/util/channel_info.h6
-rw-r--r--chrome/installer/util/channel_info_unittest.cc45
4 files changed, 5 insertions, 86 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 572ac65..58a40b9 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -261,7 +261,6 @@ installer::InstallStatus RenameChromeExecutables(
// preserved (i.e., the --ready-mode command-line option is ignored).
// --multi-install --chrome-frame
// - If a non-multi Chrome Frame installation is present, fail.
-// - If a Chrome installation on a different channel is present, fail.
// - If --ready-mode and no Chrome installation is present, fail.
// - If a Chrome installation is present, add it to the set of products to
// install.
@@ -311,29 +310,8 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
original_state.GetProductState(system_level,
BrowserDistribution::CHROME_BROWSER);
if (chrome_state != NULL) {
- // Chrome Frame may not yet be installed if this is a first install, so
- // use InstallationState's GetNonVersionedProductState() which lets us
- // access the ap value from the partially constructed product state.
- // There will be no value if we're not being managed by Google Update.
- const ProductState* cf_non_versioned_state =
- original_state.GetNonVersionedProductState(
- system_level, BrowserDistribution::CHROME_FRAME);
- DCHECK(cf_non_versioned_state);
- const installer::ChannelInfo& cf_channel(
- cf_non_versioned_state->channel());
-
- // Fail if Chrome is already installed but is on a different update
- // channel.
- if (!cf_channel.EqualsBaseOf(chrome_state->channel())) {
- LOG(ERROR) << "Cannot install Chrome Frame because existing Chrome "
- "install is on a different update channel.";
- *status = installer::CONFLICTING_CHANNEL_EXISTS;
- installer_state->WriteInstallerResult(*status,
- IDS_INSTALL_CONFLICTING_CHANNEL_EXISTS_BASE, NULL);
- return false;
- }
- // Otherwise, add Chrome to the set of products (making it multi-install
- // in the process) so that it is updated, too.
+ // Add Chrome to the set of products (making it multi-install in the
+ // process) so that it is updated, too.
scoped_ptr<Product> multi_chrome(new Product(
BrowserDistribution::GetSpecificDistribution(
BrowserDistribution::CHROME_BROWSER)));
diff --git a/chrome/installer/util/channel_info.cc b/chrome/installer/util/channel_info.cc
index 8e6665e..172ac7b 100644
--- a/chrome/installer/util/channel_info.cc
+++ b/chrome/installer/util/channel_info.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -181,18 +181,6 @@ bool ChannelInfo::GetChannelName(std::wstring* channel_name) const {
return false;
}
-bool ChannelInfo::EqualsBaseOf(const ChannelInfo& other) const {
- std::wstring::size_type this_base_end;
- std::wstring::size_type other_base_end;
-
- if (!FindModifier(MOD_STAGE, value_, &this_base_end, NULL))
- this_base_end = FindInsertionPoint(MOD_STAGE, value_);
- if (!FindModifier(MOD_STAGE, other.value_, &other_base_end, NULL))
- other_base_end = FindInsertionPoint(MOD_STAGE, other.value_);
- return value_.compare(0, this_base_end,
- other.value_, 0, other_base_end) == 0;
-}
-
bool ChannelInfo::IsCeee() const {
return HasModifier(MOD_CEEE, value_);
}
diff --git a/chrome/installer/util/channel_info.h b/chrome/installer/util/channel_info.h
index c032abd..d1c8e95 100644
--- a/chrome/installer/util/channel_info.h
+++ b/chrome/installer/util/channel_info.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -44,10 +44,6 @@ class ChannelInfo {
// determined.
bool GetChannelName(std::wstring* channel_name) const;
- // Returns true if this object and |other| have a common base (that which
- // remains when all modifiers and suffixes are omitted).
- bool EqualsBaseOf(const ChannelInfo& other) const;
-
// Returns true if the -CEEE modifier is present in the value.
bool IsCeee() const;
diff --git a/chrome/installer/util/channel_info_unittest.cc b/chrome/installer/util/channel_info_unittest.cc
index 2dec71a..2a015cc 100644
--- a/chrome/installer/util/channel_info_unittest.cc
+++ b/chrome/installer/util/channel_info_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -164,49 +164,6 @@ TEST(ChannelInfoTest, Combinations) {
EXPECT_TRUE(ci.IsChrome());
}
-TEST(ChannelInfoTest, EqualsBaseOf) {
- ChannelInfo ci1;
- ChannelInfo ci2;
-
- std::pair<std::wstring, std::wstring> trues[] = {
- std::make_pair(std::wstring(L""), std::wstring(L"")),
- std::make_pair(std::wstring(L"2.0-beta"), std::wstring(L"2.0-beta")),
- std::make_pair(std::wstring(L"-full"), std::wstring(L"-full")),
- std::make_pair(std::wstring(L""), std::wstring(L"-multi")),
- std::make_pair(std::wstring(L"2.0-beta"),
- std::wstring(L"2.0-beta-stage:finishing")),
- std::make_pair(std::wstring(L"2.0-beta-stage:finishing"),
- std::wstring(L"2.0-beta")),
- std::make_pair(std::wstring(L"2.0-beta-stage:executing"),
- std::wstring(L"2.0-beta-stage:finishing")),
- std::make_pair(std::wstring(L"2.0-beta-stage:spamming"),
- std::wstring(L"2.0-beta-stage:")),
- };
- for (int i = 0; i < arraysize(trues); ++i) {
- std::pair<std::wstring, std::wstring>& the_pair = trues[i];
- ci1.set_value(the_pair.first);
- ci2.set_value(the_pair.second);
- EXPECT_TRUE(ci1.EqualsBaseOf(ci2)) << the_pair.first << " "
- << the_pair.second;
- }
-
- std::pair<std::wstring, std::wstring> falses[] = {
- std::make_pair(std::wstring(L""), std::wstring(L"2.0-beta")),
- std::make_pair(std::wstring(L"2.0-gamma"), std::wstring(L"2.0-beta")),
- std::make_pair(std::wstring(L"spam-full"), std::wstring(L"-full")),
- std::make_pair(std::wstring(L"multi"), std::wstring(L"-multi")),
- std::make_pair(std::wstring(L"2.0-beta"),
- std::wstring(L"2.0-stage:finishing")),
- };
- for (int i = 0; i < arraysize(falses); ++i) {
- std::pair<std::wstring, std::wstring>& the_pair = falses[i];
- ci1.set_value(the_pair.first);
- ci2.set_value(the_pair.second);
- EXPECT_FALSE(ci1.EqualsBaseOf(ci2)) << the_pair.first << " "
- << the_pair.second;
- }
-}
-
TEST(ChannelInfoTest, GetStage) {
ChannelInfo ci;