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_GOOGLE_UPDATE_UTIL_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ |
6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ | 6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 namespace google_update { | 10 namespace google_update { |
9 | 11 |
10 // If user-level Google Update is absent, calls the system-level | 12 // If user-level Google Update is absent, calls the system-level |
11 // GoogleUpdateSetup.exe to install it, and waits until it finishes. | 13 // GoogleUpdateSetup.exe to install it, and waits until it finishes. |
12 // Returns true if already installed, installed successfully, or | 14 // Returns true if already installed, installed successfully, or |
13 // if Google Update is not present at system-level. | 15 // if Google Update is not present at system-level. |
14 // Returns false if the installation fails. | 16 // Returns false if the installation fails. |
15 bool EnsureUserLevelGoogleUpdatePresent(); | 17 bool EnsureUserLevelGoogleUpdatePresent(); |
16 | 18 |
17 // Tell Google Update that an uninstall has taken place. This gives it a chance | 19 // Tell Google Update that an uninstall has taken place. This gives it a chance |
18 // to uninstall itself straight away if no more products are installed on the | 20 // to uninstall itself straight away if no more products are installed on the |
19 // system rather than waiting for the next time the scheduled task runs. | 21 // system rather than waiting for the next time the scheduled task runs. |
20 // Returns false if Google Update could not be executed, or times out. | 22 // Returns false if Google Update could not be executed, or times out. |
21 bool UninstallGoogleUpdate(bool system_install); | 23 bool UninstallGoogleUpdate(bool system_install); |
22 | 24 |
23 // Run setup.exe to attempt to reenable updates for for Chrome while elevating | 25 // Run setup.exe to attempt to reenable updates for for Chrome while elevating |
24 // if needed. Setup.exe will call into | 26 // if needed. Setup.exe will call into |
25 // GoogleUpdateSettings::ReenableAutoupdatesForApp() to do the work. | 27 // GoogleUpdateSettings::ReenableAutoupdatesForApp() to do the work. |
26 void ElevateIfNeededToReenableUpdates(); | 28 void ElevateIfNeededToReenableUpdates(); |
27 | 29 |
| 30 // Returns the value corresponding to |key| in untrusted data passed from |
| 31 // Google Update. Returns an empty string if |key| is absent or if its value |
| 32 // contains non-printable characters. |
| 33 std::string GetUntrustedDataValue(const std::string& key); |
| 34 |
| 35 // Returns the value corresponding to |key| in untrusted data passed from |
| 36 // |tag|. |tag| should be a printable list of key-value pairs, e.g. |
| 37 // "key1=value1&key2=value2". Returns an empty string if |key| is absent or if |
| 38 // its value contains non-printable characters. |
| 39 std::string GetUntrustedDataValueFromTag(const std::string& tag, |
| 40 const std::string& key); |
| 41 |
28 } // namespace google_update | 42 } // namespace google_update |
29 | 43 |
30 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ | 44 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_UTIL_H_ |
OLD | NEW |