| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 declares a class that contains various method related to branding. | 5 // This file declares a class that contains various method related to branding. |
| 6 | 6 |
| 7 #ifndef CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 7 #ifndef CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
| 8 #define CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 8 #define CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "chrome/installer/util/util_constants.h" | 16 #include "chrome/installer/util/util_constants.h" |
| 17 #include "chrome/installer/util/version.h" | 17 #include "chrome/installer/util/version.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 #include <windows.h> // NOLINT | 20 #include <windows.h> // NOLINT |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class CommandLine; | 23 class CommandLine; |
| 24 | 24 |
| 25 namespace installer { | 25 namespace installer { |
| 26 class Product; | 26 class Product; |
| 27 } | 27 } |
| 28 namespace installer_util { | 28 namespace installer { |
| 29 class MasterPreferences; | 29 class MasterPreferences; |
| 30 } | 30 } |
| 31 | 31 |
| 32 class BrowserDistribution { | 32 class BrowserDistribution { |
| 33 public: | 33 public: |
| 34 virtual ~BrowserDistribution() {} | 34 virtual ~BrowserDistribution() {} |
| 35 | 35 |
| 36 enum Type { | 36 enum Type { |
| 37 CHROME_BROWSER, | 37 CHROME_BROWSER, |
| 38 CHROME_FRAME, | 38 CHROME_FRAME, |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 static BrowserDistribution* GetDistribution(); | 41 static BrowserDistribution* GetDistribution(); |
| 42 | 42 |
| 43 static BrowserDistribution* GetSpecificDistribution( | 43 static BrowserDistribution* GetSpecificDistribution( |
| 44 Type type, const installer_util::MasterPreferences& prefs); | 44 Type type, const installer::MasterPreferences& prefs); |
| 45 | 45 |
| 46 Type GetType() const { return type_; } | 46 Type GetType() const { return type_; } |
| 47 | 47 |
| 48 static int GetInstallReturnCode(installer_util::InstallStatus install_status); | 48 static int GetInstallReturnCode(installer::InstallStatus install_status); |
| 49 | 49 |
| 50 virtual void DoPostUninstallOperations(const installer::Version& version, | 50 virtual void DoPostUninstallOperations(const installer::Version& version, |
| 51 const FilePath& local_data_path, | 51 const FilePath& local_data_path, |
| 52 const std::wstring& distribution_data); | 52 const std::wstring& distribution_data); |
| 53 | 53 |
| 54 virtual std::wstring GetAppGuid(); | 54 virtual std::wstring GetAppGuid(); |
| 55 | 55 |
| 56 virtual std::wstring GetApplicationName(); | 56 virtual std::wstring GetApplicationName(); |
| 57 | 57 |
| 58 virtual std::wstring GetAppShortCutName(); | 58 virtual std::wstring GetAppShortCutName(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 87 | 87 |
| 88 virtual std::wstring GetVersionKey(); | 88 virtual std::wstring GetVersionKey(); |
| 89 | 89 |
| 90 virtual bool CanSetAsDefault(); | 90 virtual bool CanSetAsDefault(); |
| 91 | 91 |
| 92 virtual int GetIconIndex(); | 92 virtual int GetIconIndex(); |
| 93 | 93 |
| 94 virtual bool GetChromeChannel(std::wstring* channel); | 94 virtual bool GetChromeChannel(std::wstring* channel); |
| 95 | 95 |
| 96 virtual void UpdateDiffInstallStatus(bool system_install, | 96 virtual void UpdateDiffInstallStatus(bool system_install, |
| 97 bool incremental_install, installer_util::InstallStatus install_status); | 97 bool incremental_install, installer::InstallStatus install_status); |
| 98 | 98 |
| 99 // After an install or upgrade the user might qualify to participate in an | 99 // After an install or upgrade the user might qualify to participate in an |
| 100 // experiment. This function determines if the user qualifies and if so it | 100 // experiment. This function determines if the user qualifies and if so it |
| 101 // sets the wheels in motion or in simple cases does the experiment itself. | 101 // sets the wheels in motion or in simple cases does the experiment itself. |
| 102 virtual void LaunchUserExperiment(installer_util::InstallStatus status, | 102 virtual void LaunchUserExperiment(installer::InstallStatus status, |
| 103 const installer::Version& version, | 103 const installer::Version& version, |
| 104 const installer::Product& installation, | 104 const installer::Product& installation, |
| 105 bool system_level); | 105 bool system_level); |
| 106 | 106 |
| 107 // The user has qualified for the inactive user toast experiment and this | 107 // The user has qualified for the inactive user toast experiment and this |
| 108 // function just performs it. | 108 // function just performs it. |
| 109 virtual void InactiveUserToastExperiment(int flavor, | 109 virtual void InactiveUserToastExperiment(int flavor, |
| 110 const installer::Product& installation); | 110 const installer::Product& installation); |
| 111 | 111 |
| 112 // A key-file is a file such as a DLL on Windows that is expected to be | 112 // A key-file is a file such as a DLL on Windows that is expected to be |
| 113 // in use when the product is being used. For example "chrome.dll" for | 113 // in use when the product is being used. For example "chrome.dll" for |
| 114 // Chrome. Before attempting to delete an installation directory during | 114 // Chrome. Before attempting to delete an installation directory during |
| 115 // an uninstallation, the uninstaller will check if any one of a potential | 115 // an uninstallation, the uninstaller will check if any one of a potential |
| 116 // set of key files is in use and if they are, abort the delete operation. | 116 // set of key files is in use and if they are, abort the delete operation. |
| 117 // Only if none of the key files are in use, can the folder be deleted. | 117 // Only if none of the key files are in use, can the folder be deleted. |
| 118 // Note that this function does not return a full path to the key file(s), | 118 // Note that this function does not return a full path to the key file(s), |
| 119 // only (a) file name(s). | 119 // only (a) file name(s). |
| 120 virtual std::vector<FilePath> GetKeyFiles(); | 120 virtual std::vector<FilePath> GetKeyFiles(); |
| 121 | 121 |
| 122 // Returns the list of Com Dlls that this product cares about having | 122 // Returns the list of Com Dlls that this product cares about having |
| 123 // registered and unregistered. The list may be empty. | 123 // registered and unregistered. The list may be empty. |
| 124 virtual std::vector<FilePath> GetComDllList(); | 124 virtual std::vector<FilePath> GetComDllList(); |
| 125 | 125 |
| 126 // Given a command line, appends the set of uninstall flags the uninstaller | 126 // Given a command line, appends the set of uninstall flags the uninstaller |
| 127 // for this distribution will require. | 127 // for this distribution will require. |
| 128 virtual void AppendUninstallCommandLineFlags(CommandLine* cmd_line); | 128 virtual void AppendUninstallCommandLineFlags(CommandLine* cmd_line); |
| 129 | 129 |
| 130 protected: | 130 protected: |
| 131 explicit BrowserDistribution(const installer_util::MasterPreferences& prefs); | 131 explicit BrowserDistribution(const installer::MasterPreferences& prefs); |
| 132 | 132 |
| 133 template<class DistributionClass> | 133 template<class DistributionClass> |
| 134 static BrowserDistribution* GetOrCreateBrowserDistribution( | 134 static BrowserDistribution* GetOrCreateBrowserDistribution( |
| 135 const installer_util::MasterPreferences& prefs, | 135 const installer::MasterPreferences& prefs, |
| 136 BrowserDistribution** dist); | 136 BrowserDistribution** dist); |
| 137 | 137 |
| 138 Type type_; | 138 Type type_; |
| 139 | 139 |
| 140 private: | 140 private: |
| 141 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution); | 141 DISALLOW_COPY_AND_ASSIGN(BrowserDistribution); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ | 144 #endif // CHROME_INSTALLER_UTIL_BROWSER_DISTRIBUTION_H_ |
| OLD | NEW |