OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_APP_INSTALLER_WIN_APP_INSTALLER_UTIL_H_ |
| 6 #define CHROME_APP_INSTALLER_WIN_APP_INSTALLER_UTIL_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 11 #include "base/files/file_path.h" |
| 12 |
| 13 namespace app_installer { |
| 14 |
| 15 extern const char kInstallChromeApp[]; |
| 16 |
| 17 enum ExitCode { |
| 18 SUCCESS = 0, |
| 19 COULD_NOT_GET_FILE_PATH, |
| 20 COULD_NOT_READ_TAG, |
| 21 COULD_NOT_PARSE_TAG, |
| 22 INVALID_APP_ID, |
| 23 EULA_CANCELLED, |
| 24 COULD_NOT_FIND_CHROME, |
| 25 COULD_NOT_GET_TMP_FILE_PATH, |
| 26 FAILED_TO_DOWNLOAD_CHROME_SETUP, |
| 27 FAILED_TO_LAUNCH_CHROME_SETUP, |
| 28 }; |
| 29 |
| 30 // Gets the tag attached to a file by dl.google.com. This uses the same format |
| 31 // as Omaha. Returns the empty string on failure. |
| 32 std::string GetTag(const base::FilePath& file_name_path); |
| 33 |
| 34 // Parses |tag| as key-value pairs and overwrites |parsed_pairs| with |
| 35 // the result. |tag| should be a '&'-delimited list of '='-separated |
| 36 // key-value pairs, e.g. "key1=value1&key2=value2". |
| 37 // Returns true if the data could be parsed. |
| 38 bool ParseTag(const std::string& tag, |
| 39 std::map<std::string, std::string>* parsed_pairs); |
| 40 |
| 41 bool IsValidAppId(const std::string& app_id); |
| 42 |
| 43 base::FilePath GetChromeExePath(bool is_canary); |
| 44 |
| 45 // Shows UI to download and install Chrome. Returns a failure code, or SUCCESS |
| 46 // if the installation completed successfully. |
| 47 ExitCode GetChrome(bool is_canary); |
| 48 |
| 49 } // namespace app_installer |
| 50 |
| 51 #endif // CHROME_APP_INSTALLER_WIN_APP_INSTALLER_UTIL_H_ |
OLD | NEW |