| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SETTINGS_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| 6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 6 #define CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 namespace installer_util { | 13 namespace installer { |
| 14 class ChannelInfo; | 14 class ChannelInfo; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // This class provides accessors to the Google Update 'ClientState' information | 17 // This class provides accessors to the Google Update 'ClientState' information |
| 18 // that recorded when the user downloads the chrome installer. It is | 18 // that recorded when the user downloads the chrome installer. It is |
| 19 // google_update.exe responsability to write the initial values. | 19 // google_update.exe responsability to write the initial values. |
| 20 class GoogleUpdateSettings { | 20 class GoogleUpdateSettings { |
| 21 public: | 21 public: |
| 22 // Returns whether the user has given consent to collect UMA data and send | 22 // Returns whether the user has given consent to collect UMA data and send |
| 23 // crash dumps to Google. This information is collected by the web server | 23 // crash dumps to Google. This information is collected by the web server |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // not present already). | 101 // not present already). |
| 102 // - If full installer failed, still remove this magic | 102 // - If full installer failed, still remove this magic |
| 103 // string (if it is present already). | 103 // string (if it is present already). |
| 104 // | 104 // |
| 105 // diff_install: tells whether this is incremental install or not. | 105 // diff_install: tells whether this is incremental install or not. |
| 106 // install_return_code: if 0, means installation was successful. | 106 // install_return_code: if 0, means installation was successful. |
| 107 // value: current value of Google Update "ap" key. | 107 // value: current value of Google Update "ap" key. |
| 108 // Returns true if |value| is modified. | 108 // Returns true if |value| is modified. |
| 109 static bool UpdateGoogleUpdateApKey(bool diff_install, | 109 static bool UpdateGoogleUpdateApKey(bool diff_install, |
| 110 int install_return_code, | 110 int install_return_code, |
| 111 installer_util::ChannelInfo* value); | 111 installer::ChannelInfo* value); |
| 112 | 112 |
| 113 // For system-level installs, we need to be able to communicate the results | 113 // For system-level installs, we need to be able to communicate the results |
| 114 // of the Toast Experiments back to Google Update. The problem is just that | 114 // of the Toast Experiments back to Google Update. The problem is just that |
| 115 // the experiment is run in the context of the user, which doesn't have | 115 // the experiment is run in the context of the user, which doesn't have |
| 116 // write access to the HKLM key that Google Update expects the results in. | 116 // write access to the HKLM key that Google Update expects the results in. |
| 117 // However, when we are about to switch contexts from system to user, we can | 117 // However, when we are about to switch contexts from system to user, we can |
| 118 // duplicate the handle to the registry key and pass it (through handle | 118 // duplicate the handle to the registry key and pass it (through handle |
| 119 // inheritance) to the newly created child process that is launched as the | 119 // inheritance) to the newly created child process that is launched as the |
| 120 // user, allowing the child process to write to the key, with the | 120 // user, allowing the child process to write to the key, with the |
| 121 // WriteGoogleUpdateSystemClientKey function below. | 121 // WriteGoogleUpdateSystemClientKey function below. |
| 122 static int DuplicateGoogleUpdateSystemClientKey(); | 122 static int DuplicateGoogleUpdateSystemClientKey(); |
| 123 | 123 |
| 124 // Takes a |handle| to a registry key and writes |value| string into the | 124 // Takes a |handle| to a registry key and writes |value| string into the |
| 125 // specified |key|. See DuplicateGoogleUpdateSystemClientKey for details. | 125 // specified |key|. See DuplicateGoogleUpdateSystemClientKey for details. |
| 126 static bool WriteGoogleUpdateSystemClientKey(int handle, | 126 static bool WriteGoogleUpdateSystemClientKey(int handle, |
| 127 const std::wstring& key, | 127 const std::wstring& key, |
| 128 const std::wstring& value); | 128 const std::wstring& value); |
| 129 | 129 |
| 130 // True if a build is strictly organic, according to its brand code. | 130 // True if a build is strictly organic, according to its brand code. |
| 131 static bool IsOrganic(const std::wstring& brand); | 131 static bool IsOrganic(const std::wstring& brand); |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); | 134 DISALLOW_IMPLICIT_CONSTRUCTORS(GoogleUpdateSettings); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ | 137 #endif // CHROME_INSTALLER_UTIL_GOOGLE_UPDATE_SETTINGS_H_ |
| OLD | NEW |