diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 16:50:46 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 16:50:46 +0000 |
commit | 756499cf199d964b055dc76e7b2f1edfbd53a4f0 (patch) | |
tree | 0e2bf4fff8ca23cf19ade034f45a2e9ae27aff49 /chrome/installer/util | |
parent | 2bac72e84e955e1401199ad2f4c9282c3c501212 (diff) | |
download | chromium_src-756499cf199d964b055dc76e7b2f1edfbd53a4f0.zip chromium_src-756499cf199d964b055dc76e7b2f1edfbd53a4f0.tar.gz chromium_src-756499cf199d964b055dc76e7b2f1edfbd53a4f0.tar.bz2 |
Cleaning up after the initial Chrome Frame commit.
Review URL: http://codereview.chromium.org/242025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/browser_distribution.cc | 9 | ||||
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.cc | 88 | ||||
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.h | 50 |
3 files changed, 141 insertions, 6 deletions
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index d4b2849..0d1772f 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -11,16 +11,13 @@ #include "base/registry.h" #include "chrome/installer/util/google_chrome_distribution.h" - -#if defined(CHROME_EXP_BUILD) -#include "chrome/installer/util/exp/experimental_browser_distribution.h" -#endif +#include "chrome/installer/util/chrome_frame_distribution.h" BrowserDistribution* BrowserDistribution::GetDistribution() { static BrowserDistribution* dist = NULL; if (dist == NULL) { -#if defined(CHROME_EXP_BUILD) - dist = new ExperimentalBrowserDistribution(); +#if defined(CHROME_FRAME_BUILD) + dist = new ChromeFrameDistribution(); #elif defined(GOOGLE_CHROME_BUILD) dist = new GoogleChromeDistribution(); #else diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc new file mode 100644 index 0000000..124edd3 --- /dev/null +++ b/chrome/installer/util/chrome_frame_distribution.cc @@ -0,0 +1,88 @@ +// Copyright (c) 2009 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. +// +// This file defines a specific implementation of BrowserDistribution class for +// Chrome Frame. It overrides the bare minimum of methods necessary to get a +// Chrome Frame installer that does not interact with Google Chrome or +// Chromium installations. + +#include "chrome/installer/util/chrome_frame_distribution.h" + +#include "chrome/installer/util/l10n_string_util.h" +#include "chrome/installer/util/google_update_constants.h" + +#include "installer_util_strings.h" + +std::wstring ChromeFrameDistribution::GetApplicationName() { + // TODO(robertshield): localize + return L"Google Chrome Frame"; +} + +std::wstring ChromeFrameDistribution::GetAlternateApplicationName() { + // TODO(robertshield): localize + return L"Chromium technology in your existing browser"; +} + +std::wstring ChromeFrameDistribution::GetInstallSubDir() { + // TODO(robertshield): localize + return L"Google\\Chrome Frame"; +} + +std::wstring ChromeFrameDistribution::GetPublisherName() { + const std::wstring& publisher_name = + installer_util::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); + return publisher_name; +} + +std::wstring ChromeFrameDistribution::GetAppDescription() { + return L"Chrome in a Frame."; +} + +std::wstring ChromeFrameDistribution::GetStateKey() { + std::wstring key(google_update::kRegPathClientState); + key.append(L"\\"); + key.append(google_update::kChromeGuid); + return key; +} + +std::wstring ChromeFrameDistribution::GetStateMediumKey() { + std::wstring key(google_update::kRegPathClientStateMedium); + key.append(L"\\"); + key.append(google_update::kChromeGuid); + return key; +} + +std::wstring ChromeFrameDistribution::GetStatsServerURL() { + return L"https://clients4.google.com/firefox/metrics/collect"; +} + + +std::wstring ChromeFrameDistribution::GetUninstallLinkName() { + return L"Uninstall Chrome Frame"; +} + +std::wstring ChromeFrameDistribution::GetUninstallRegPath() { + return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + L"Google Chrome Frame"; +} + +std::wstring ChromeFrameDistribution::GetVersionKey() { + std::wstring key(google_update::kRegPathClients); + key.append(L"\\"); + key.append(google_update::kChromeGuid); + return key; +} + +int ChromeFrameDistribution::GetInstallReturnCode( + installer_util::InstallStatus status) { + switch (status) { + case installer_util::FIRST_INSTALL_SUCCESS: + case installer_util::INSTALL_REPAIRED: + case installer_util::NEW_VERSION_UPDATED: + case installer_util::HIGHER_VERSION_EXISTS: + return 0; // For Google Update's benefit we need to return 0 for success + default: + return status; + } +} diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h new file mode 100644 index 0000000..98a250d --- /dev/null +++ b/chrome/installer/util/chrome_frame_distribution.h @@ -0,0 +1,50 @@ +// Copyright (c) 2009 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. +// +// This file extends the browser distribution with a specific implementation +// for Chrome Frame. + +#ifndef CHROME_INSTALLER_UTIL_CHROME_FRAME_DISTRIBUTION_H_ +#define CHROME_INSTALLER_UTIL_CHROME_FRAME_DISTRIBUTION_H_ + +#include <string> + +#include "chrome/installer/util/browser_distribution.h" +#include "chrome/installer/util/util_constants.h" + +class ChromeFrameDistribution : public BrowserDistribution { + public: + virtual std::wstring GetApplicationName(); + + virtual std::wstring GetAlternateApplicationName(); + + virtual std::wstring GetInstallSubDir(); + + virtual std::wstring GetPublisherName(); + + virtual std::wstring GetAppDescription(); + + virtual std::wstring GetStateKey(); + + virtual std::wstring GetStateMediumKey(); + + virtual std::wstring GetStatsServerURL(); + + virtual std::wstring GetUninstallLinkName(); + + virtual std::wstring GetUninstallRegPath(); + + virtual std::wstring GetVersionKey(); + + virtual int GetInstallReturnCode(installer_util::InstallStatus status); + + private: + friend class BrowserDistribution; + + // Disallow construction from non-friends. + ChromeFrameDistribution() {} + +}; + +#endif // CHROME_INSTALLER_UTIL_CHROME_FRAME_DISTRIBUTION_H_ |