diff options
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/util/helper.cc | 13 | ||||
-rw-r--r-- | chrome/installer/util/helper.h | 8 | ||||
-rw-r--r-- | chrome/installer/util/package_properties.cc | 6 | ||||
-rw-r--r-- | chrome/installer/util/package_properties.h | 4 |
4 files changed, 27 insertions, 4 deletions
diff --git a/chrome/installer/util/helper.cc b/chrome/installer/util/helper.cc index aa6a264..6cddf25 100644 --- a/chrome/installer/util/helper.cc +++ b/chrome/installer/util/helper.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. @@ -12,6 +12,7 @@ #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/master_preferences.h" +#include "chrome/installer/util/package_properties.h" using base::win::RegKey; @@ -126,4 +127,14 @@ FilePath GetChromeFrameInstallPath(bool multi_install, bool system_install, return GetChromeInstallPath(system_install, chrome); } +std::wstring GetAppGuidForUpdates(bool system_install) { + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + + // If we're part of a multi-install, we need to poll using the multi-installer + // package's app guid rather than the browser's or Chrome Frame's app guid. + return IsInstalledAsMulti(system_install, dist) ? + ActivePackageProperties().GetAppGuid() : + dist->GetAppGuid(); +} + } // namespace installer. diff --git a/chrome/installer/util/helper.h b/chrome/installer/util/helper.h index e5f19ae..bcee4c6 100644 --- a/chrome/installer/util/helper.h +++ b/chrome/installer/util/helper.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. // @@ -8,6 +8,8 @@ #define CHROME_INSTALLER_UTIL_HELPER_H_ #pragma once +#include <string> + class BrowserDistribution; class CommandLine; class FilePath; @@ -51,6 +53,10 @@ FilePath GetChromeUserDataPath(BrowserDistribution* dist); FilePath GetChromeFrameInstallPath(bool multi_install, bool system_install, BrowserDistribution* dist); +// Returns the app guid under which the current process receives updates from +// Google Update. +std::wstring GetAppGuidForUpdates(bool system_install); + } // namespace installer #endif // CHROME_INSTALLER_UTIL_HELPER_H_ diff --git a/chrome/installer/util/package_properties.cc b/chrome/installer/util/package_properties.cc index 2ab87cb..e33c2f9 100644 --- a/chrome/installer/util/package_properties.cc +++ b/chrome/installer/util/package_properties.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. @@ -42,6 +42,10 @@ PackagePropertiesImpl::PackagePropertiesImpl( PackagePropertiesImpl::~PackagePropertiesImpl() { } +const std::wstring& PackagePropertiesImpl::GetAppGuid() { + return guid_; +} + const std::wstring& PackagePropertiesImpl::GetStateKey() { return state_key_; } diff --git a/chrome/installer/util/package_properties.h b/chrome/installer/util/package_properties.h index a3f7714..5fd5e5f5 100644 --- a/chrome/installer/util/package_properties.h +++ b/chrome/installer/util/package_properties.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. @@ -36,6 +36,7 @@ class PackageProperties { virtual bool ReceivesUpdates() const = 0; // Equivalent to BrowserDistribution::GetAppGuid() + virtual const std::wstring& GetAppGuid() = 0; virtual const std::wstring& GetStateKey() = 0; virtual const std::wstring& GetStateMediumKey() = 0; virtual const std::wstring& GetVersionKey() = 0; @@ -54,6 +55,7 @@ class PackagePropertiesImpl : public PackageProperties { const std::wstring& version_key); virtual ~PackagePropertiesImpl(); + virtual const std::wstring& GetAppGuid(); virtual const std::wstring& GetStateKey(); virtual const std::wstring& GetStateMediumKey(); virtual const std::wstring& GetVersionKey(); |