| 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 #include "chrome/browser/chromeos/system/timezone_settings.h" | 5 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // Create new symlink2. | 213 // Create new symlink2. |
| 214 if (symlink(timezone_file.value().c_str(), | 214 if (symlink(timezone_file.value().c_str(), |
| 215 timezone_symlink2.value().c_str()) == -1) { | 215 timezone_symlink2.value().c_str()) == -1) { |
| 216 LOG(ERROR) << "SetTimezoneID: Unable to create symlink " | 216 LOG(ERROR) << "SetTimezoneID: Unable to create symlink " |
| 217 << timezone_symlink2.value() << " to " << timezone_file.value(); | 217 << timezone_symlink2.value() << " to " << timezone_file.value(); |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 | 220 |
| 221 // Move symlink2 to symlink. | 221 // Move symlink2 to symlink. |
| 222 if (!file_util::ReplaceFile(timezone_symlink2, timezone_symlink)) { | 222 if (!base::ReplaceFile(timezone_symlink2, timezone_symlink, NULL)) { |
| 223 LOG(ERROR) << "SetTimezoneID: Unable to move symlink " | 223 LOG(ERROR) << "SetTimezoneID: Unable to move symlink " |
| 224 << timezone_symlink2.value() << " to " | 224 << timezone_symlink2.value() << " to " |
| 225 << timezone_symlink.value(); | 225 << timezone_symlink.value(); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 // Common code of the TimezoneSettings implementations. | 229 // Common code of the TimezoneSettings implementations. |
| 230 class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { | 230 class TimezoneSettingsBaseImpl : public chromeos::system::TimezoneSettings { |
| 231 public: | 231 public: |
| 232 virtual ~TimezoneSettingsBaseImpl(); | 232 virtual ~TimezoneSettingsBaseImpl(); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 // static | 451 // static |
| 452 string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { | 452 string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { |
| 453 icu::UnicodeString id; | 453 icu::UnicodeString id; |
| 454 timezone.getID(id); | 454 timezone.getID(id); |
| 455 return string16(id.getBuffer(), id.length()); | 455 return string16(id.getBuffer(), id.length()); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace system | 458 } // namespace system |
| 459 } // namespace chromeos | 459 } // namespace chromeos |
| OLD | NEW |