OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See the corresponding header file for description of the functions in this | 5 // See the corresponding header file for description of the functions in this |
6 // file. | 6 // file. |
7 | 7 |
8 #include "chrome/installer/util/install_util.h" | 8 #include "chrome/installer/util/install_util.h" |
9 | 9 |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 switch (status) { | 233 switch (status) { |
234 case installer::FIRST_INSTALL_SUCCESS: | 234 case installer::FIRST_INSTALL_SUCCESS: |
235 case installer::INSTALL_REPAIRED: | 235 case installer::INSTALL_REPAIRED: |
236 case installer::NEW_VERSION_UPDATED: | 236 case installer::NEW_VERSION_UPDATED: |
237 case installer::IN_USE_UPDATED: | 237 case installer::IN_USE_UPDATED: |
238 return 0; | 238 return 0; |
239 default: | 239 default: |
240 return status; | 240 return status; |
241 } | 241 } |
242 } | 242 } |
| 243 |
| 244 std::wstring InstallUtil::GetCurrentDate() { |
| 245 static const wchar_t kDateFormat[] = L"yyyyMMdd"; |
| 246 wchar_t date_str[arraysize(kDateFormat)] = {0}; |
| 247 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, |
| 248 date_str, arraysize(date_str)); |
| 249 if (len) { |
| 250 --len; // Subtract terminating \0. |
| 251 } else { |
| 252 PLOG(DFATAL) << "GetDateFormat"; |
| 253 } |
| 254 |
| 255 return std::wstring(date_str, len); |
| 256 } |
OLD | NEW |