| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 util functions for setup project. | 5 // This file declares util functions for setup project. |
| 6 | 6 |
| 7 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 7 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 8 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 8 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/installer/util/version.h" | 12 #include "chrome/installer/util/version.h" |
| 13 | 13 |
| 14 namespace setup_util { | 14 namespace setup_util { |
| 15 // Apply a diff patch to source file. First tries to apply it using courgette | 15 // Apply a diff patch to source file. First tries to apply it using courgette |
| 16 // since it checks for courgette header and fails quickly. If that fails | 16 // since it checks for courgette header and fails quickly. If that fails |
| 17 // tries to apply the patch using regular bsdiff. Returns status code. | 17 // tries to apply the patch using regular bsdiff. Returns status code. |
| 18 int ApplyDiffPatch(const std::wstring& src, | 18 int ApplyDiffPatch(const std::wstring& src, |
| 19 const std::wstring& patch, | 19 const std::wstring& patch, |
| 20 const std::wstring& dest); | 20 const std::wstring& dest); |
| 21 | 21 |
| 22 // Parse command line and read master preferences, if present, to get | 22 // Parse command line and read master preferences, if present, to get |
| 23 // distribution related install options. Merge them if any command line | 23 // distribution related install options. Merge them if any command line |
| 24 // options present (command line value takes precedence). | 24 // options present (command line value takes precedence). |
| 25 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line); | 25 DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line); |
| 26 | 26 |
| 27 // Find the version of Chrome from an install source directory. | 27 // Find the version of Chrome from an install source directory. |
| 28 // Chrome_path should contain a version folder. | 28 // Chrome_path should contain a version folder. |
| 29 // Returns the first version found or NULL if no version is found. | 29 // Returns the first version found or NULL if no version is found. |
| 30 installer::Version* GetVersionFromDir(const std::wstring& chrome_path); | 30 installer::Version* GetVersionFromDir(const std::wstring& chrome_path); |
| 31 } // namespace setup_util | 31 } // namespace setup_util |
| 32 | 32 |
| 33 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 33 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |