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_PRODUCT_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_PRODUCT_H_ |
6 #define CHROME_INSTALLER_UTIL_PRODUCT_H_ | 6 #define CHROME_INSTALLER_UTIL_PRODUCT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 // Returns true if the set of options is mutated by this operation. | 71 // Returns true if the set of options is mutated by this operation. |
72 bool SetOption(const std::wstring& option, bool set) { | 72 bool SetOption(const std::wstring& option, bool set) { |
73 if (set) | 73 if (set) |
74 return options_.insert(option).second; | 74 return options_.insert(option).second; |
75 else | 75 else |
76 return options_.erase(option) != 0; | 76 return options_.erase(option) != 0; |
77 } | 77 } |
78 | 78 |
79 // Returns the path to the directory that holds the user data. This is always | 79 // Returns the path(s) to the directory that holds the user data (primary |
80 // inside "Users\<user>\Local Settings". Note that this is the default user | 80 // and, if applicable to |dist|, alternate). This is always inside a user's |
81 // data directory and does not take into account that it can be overriden with | 81 // local application data folder (e.g., "AppData\Local or "Local |
82 // a command line parameter. | 82 // Settings\Application Data" in %USERPROFILE%). Note that these are the |
83 FilePath GetUserDataPath() const; | 83 // defaults and do not take into account that they can be overriden with a |
| 84 // command line parameter. |paths| may be empty on return, but is guaranteed |
| 85 // not to contain empty paths otherwise. If more than one path is returned, |
| 86 // they are guaranteed to be siblings. |
| 87 void GetUserDataPaths(std::vector<FilePath>* paths) const; |
84 | 88 |
85 // Launches Chrome without waiting for it to exit. | 89 // Launches Chrome without waiting for it to exit. |
86 bool LaunchChrome(const FilePath& application_path) const; | 90 bool LaunchChrome(const FilePath& application_path) const; |
87 | 91 |
88 // Launches Chrome with given command line, waits for Chrome indefinitely | 92 // Launches Chrome with given command line, waits for Chrome indefinitely |
89 // (until it terminates), and gets the process exit code if available. | 93 // (until it terminates), and gets the process exit code if available. |
90 // The function returns true as long as Chrome is successfully launched. | 94 // The function returns true as long as Chrome is successfully launched. |
91 // The status of Chrome at the return of the function is given by exit_code. | 95 // The status of Chrome at the return of the function is given by exit_code. |
92 // NOTE: The 'options' CommandLine object should only contain parameters. | 96 // NOTE: The 'options' CommandLine object should only contain parameters. |
93 // The program part will be ignored. | 97 // The program part will be ignored. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 scoped_ptr<ProductOperations> operations_; | 132 scoped_ptr<ProductOperations> operations_; |
129 std::set<std::wstring> options_; | 133 std::set<std::wstring> options_; |
130 | 134 |
131 private: | 135 private: |
132 DISALLOW_COPY_AND_ASSIGN(Product); | 136 DISALLOW_COPY_AND_ASSIGN(Product); |
133 }; | 137 }; |
134 | 138 |
135 } // namespace installer | 139 } // namespace installer |
136 | 140 |
137 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ | 141 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ |
OLD | NEW |