Chromium Code Reviews| 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 "base/files/file_path.h" | |
| 9 | |
| 10 namespace app_installer { | |
| 11 | |
| 12 extern const char kInstallChromeApp[]; | |
| 13 | |
| 14 enum ExitCode { | |
| 15 SUCCESS = 0, | |
| 16 COULD_NOT_GET_FILE_PATH, | |
| 17 COULD_NOT_READ_TAG, | |
| 18 COULD_NOT_PARSE_TAG, | |
| 19 INVALID_APP_ID, | |
| 20 EULA_CANCELLED, | |
| 21 COULD_NOT_FIND_CHROME, | |
| 22 COULD_NOT_GET_TMP_FILE_PATH, | |
| 23 FAILED_TO_DOWNLOAD_CHROME_SETUP, | |
| 24 FAILED_TO_LAUNCH_CHROME_SETUP, | |
| 25 }; | |
| 26 | |
| 27 // Gets the tag attached to a file by dl.google.com. This uses the same format | |
| 28 // as Omaha. Returns the empty string on failure. | |
| 29 std::string GetTag(const base::FilePath& file_name_path); | |
|
grt (UTC plus 2)
2014/11/07 03:13:36
#include <string>
jackhou1
2014/11/07 05:37:52
Done.
| |
| 30 | |
| 31 // Parses |tag| as key-value pairs and overwrites |parsed_pairs| with | |
| 32 // the result. |tag| should be a '&'-delimited list of '='-separated | |
| 33 // key-value pairs, e.g. "key1=value1&key2=value2". | |
| 34 // Returns true if the data could be parsed. | |
| 35 bool ParseTag(const std::string& tag, | |
| 36 std::map<std::string, std::string>* parsed_pairs); | |
|
grt (UTC plus 2)
2014/11/07 03:13:36
#include <map>
jackhou1
2014/11/07 05:37:52
Done.
| |
| 37 | |
| 38 bool IsValidAppId(const std::string& app_id); | |
| 39 | |
| 40 base::FilePath GetChromeExePath(bool is_canary); | |
| 41 | |
| 42 // Shows UI to download and install Chrome. Returns a failure code, or SUCCESS | |
| 43 // if the installation completed successfully. | |
| 44 ExitCode GetChrome(bool is_canary); | |
| 45 | |
| 46 } // namespace app_installer | |
| 47 | |
| 48 #endif // CHROME_APP_INSTALLER_WIN_APP_INSTALLER_UTIL_H_ | |
| OLD | NEW |