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 #ifndef CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ |
6 #define CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ | 6 #define CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Returns true and populates |usagestats| if the product has such a value; | 76 // Returns true and populates |usagestats| if the product has such a value; |
77 // otherwise, returns false and does not modify |usagestats|. Expected values | 77 // otherwise, returns false and does not modify |usagestats|. Expected values |
78 // are 0 (false) and 1 (true), although |usagestats| is given whatever is | 78 // are 0 (false) and 1 (true), although |usagestats| is given whatever is |
79 // found. | 79 // found. |
80 bool GetUsageStats(DWORD* usagestats) const; | 80 bool GetUsageStats(DWORD* usagestats) const; |
81 | 81 |
82 // True if the "msi" value in the ClientState key is present and non-zero. | 82 // True if the "msi" value in the ClientState key is present and non-zero. |
83 bool is_msi() const { return msi_; } | 83 bool is_msi() const { return msi_; } |
84 | 84 |
85 // The command to uninstall the product; may be empty. | 85 // The command to uninstall the product; may be empty. |
86 const CommandLine& uninstall_command() const { return uninstall_command_; } | 86 const base::CommandLine& uninstall_command() const { |
| 87 return uninstall_command_; |
| 88 } |
87 | 89 |
88 // True if |uninstall_command| contains --multi-install. | 90 // True if |uninstall_command| contains --multi-install. |
89 bool is_multi_install() const { return multi_install_; } | 91 bool is_multi_install() const { return multi_install_; } |
90 | 92 |
91 // Returns the set of Google Update commands. | 93 // Returns the set of Google Update commands. |
92 const AppCommands& commands() const { return commands_; } | 94 const AppCommands& commands() const { return commands_; } |
93 | 95 |
94 // Returns this object a la operator=(). | 96 // Returns this object a la operator=(). |
95 ProductState& CopyFrom(const ProductState& other); | 97 ProductState& CopyFrom(const ProductState& other); |
96 | 98 |
97 // Clears the state of this object. | 99 // Clears the state of this object. |
98 void Clear(); | 100 void Clear(); |
99 | 101 |
100 protected: | 102 protected: |
101 static bool InitializeCommands(const base::win::RegKey& version_key, | 103 static bool InitializeCommands(const base::win::RegKey& version_key, |
102 AppCommands* commands); | 104 AppCommands* commands); |
103 | 105 |
104 ChannelInfo channel_; | 106 ChannelInfo channel_; |
105 scoped_ptr<Version> version_; | 107 scoped_ptr<Version> version_; |
106 scoped_ptr<Version> old_version_; | 108 scoped_ptr<Version> old_version_; |
107 std::wstring brand_; | 109 std::wstring brand_; |
108 std::wstring rename_cmd_; | 110 std::wstring rename_cmd_; |
109 std::wstring oem_install_; | 111 std::wstring oem_install_; |
110 CommandLine uninstall_command_; | 112 base::CommandLine uninstall_command_; |
111 AppCommands commands_; | 113 AppCommands commands_; |
112 DWORD eula_accepted_; | 114 DWORD eula_accepted_; |
113 DWORD usagestats_; | 115 DWORD usagestats_; |
114 bool msi_ : 1; | 116 bool msi_ : 1; |
115 bool multi_install_ : 1; | 117 bool multi_install_ : 1; |
116 bool has_eula_accepted_ : 1; | 118 bool has_eula_accepted_ : 1; |
117 bool has_oem_install_ : 1; | 119 bool has_oem_install_ : 1; |
118 bool has_usagestats_ : 1; | 120 bool has_usagestats_ : 1; |
119 | 121 |
120 private: | 122 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ProductState user_products_[NUM_PRODUCTS]; | 163 ProductState user_products_[NUM_PRODUCTS]; |
162 ProductState system_products_[NUM_PRODUCTS]; | 164 ProductState system_products_[NUM_PRODUCTS]; |
163 | 165 |
164 private: | 166 private: |
165 DISALLOW_COPY_AND_ASSIGN(InstallationState); | 167 DISALLOW_COPY_AND_ASSIGN(InstallationState); |
166 }; // class InstallationState | 168 }; // class InstallationState |
167 | 169 |
168 } // namespace installer | 170 } // namespace installer |
169 | 171 |
170 #endif // CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ | 172 #endif // CHROME_INSTALLER_UTIL_INSTALLATION_STATE_H_ |
OLD | NEW |