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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 // Returns true if the set of options is mutated by this operation. | 76 // Returns true if the set of options is mutated by this operation. |
77 bool SetOption(const std::wstring& option, bool set) { | 77 bool SetOption(const std::wstring& option, bool set) { |
78 if (set) | 78 if (set) |
79 return options_.insert(option).second; | 79 return options_.insert(option).second; |
80 else | 80 else |
81 return options_.erase(option) != 0; | 81 return options_.erase(option) != 0; |
82 } | 82 } |
83 | 83 |
84 // Returns the path(s) to the directory that holds the user data (primary | 84 // Returns the path to the directory that holds the user data. This is always |
85 // and, if applicable to |dist|, alternate). This is always inside a user's | 85 // inside a user's local application data folder (e.g., "AppData\Local or |
86 // local application data folder (e.g., "AppData\Local or "Local | 86 // "Local Settings\Application Data" in %USERPROFILE%). Note that this is the |
87 // Settings\Application Data" in %USERPROFILE%). Note that these are the | 87 // default user data directory and does not take into account that it can be |
88 // defaults and do not take into account that they can be overriden with a | 88 // overriden with a command line parameter. |
89 // command line parameter. |paths| may be empty on return, but is guaranteed | 89 base::FilePath GetUserDataPath() const; |
90 // not to contain empty paths otherwise. If more than one path is returned, | |
91 // they are guaranteed to be siblings. | |
92 void GetUserDataPaths(std::vector<base::FilePath>* paths) const; | |
93 | 90 |
94 // Launches Chrome without waiting for it to exit. | 91 // Launches Chrome without waiting for it to exit. |
95 bool LaunchChrome(const base::FilePath& application_path) const; | 92 bool LaunchChrome(const base::FilePath& application_path) const; |
96 | 93 |
97 // Launches Chrome with given command line, waits for Chrome indefinitely | 94 // Launches Chrome with given command line, waits for Chrome indefinitely |
98 // (until it terminates), and gets the process exit code if available. | 95 // (until it terminates), and gets the process exit code if available. |
99 // The function returns true as long as Chrome is successfully launched. | 96 // The function returns true as long as Chrome is successfully launched. |
100 // The status of Chrome at the return of the function is given by exit_code. | 97 // The status of Chrome at the return of the function is given by exit_code. |
101 // NOTE: The 'options' CommandLine object should only contain parameters. | 98 // NOTE: The 'options' CommandLine object should only contain parameters. |
102 // The program part will be ignored. | 99 // The program part will be ignored. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 scoped_ptr<ProductOperations> operations_; | 143 scoped_ptr<ProductOperations> operations_; |
147 std::set<std::wstring> options_; | 144 std::set<std::wstring> options_; |
148 | 145 |
149 private: | 146 private: |
150 DISALLOW_COPY_AND_ASSIGN(Product); | 147 DISALLOW_COPY_AND_ASSIGN(Product); |
151 }; | 148 }; |
152 | 149 |
153 } // namespace installer | 150 } // namespace installer |
154 | 151 |
155 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ | 152 #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_ |
OLD | NEW |