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/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 c = (HexDigitToInt(filename[i + 1]) << 4) + | 292 c = (HexDigitToInt(filename[i + 1]) << 4) + |
293 HexDigitToInt(filename[i + 2]); | 293 HexDigitToInt(filename[i + 2]); |
294 i += 2; | 294 i += 2; |
295 } | 295 } |
296 unescaped.push_back(c); | 296 unescaped.push_back(c); |
297 } | 297 } |
298 return unescaped; | 298 return unescaped; |
299 } | 299 } |
300 | 300 |
301 std::string NormalizeFileName(const std::string& input) { | 301 std::string NormalizeFileName(const std::string& input) { |
302 DCHECK(IsStringUTF8(input)); | 302 DCHECK(base::IsStringUTF8(input)); |
303 | 303 |
304 std::string output; | 304 std::string output; |
305 if (!base::ConvertToUtf8AndNormalize(input, base::kCodepageUTF8, &output)) | 305 if (!base::ConvertToUtf8AndNormalize(input, base::kCodepageUTF8, &output)) |
306 output = input; | 306 output = input; |
307 base::ReplaceChars(output, kSlash, std::string(kEscapedChars), &output); | 307 base::ReplaceChars(output, kSlash, std::string(kEscapedChars), &output); |
308 if (!output.empty() && output.find_first_not_of(kDot, 0) == std::string::npos) | 308 if (!output.empty() && output.find_first_not_of(kDot, 0) == std::string::npos) |
309 output = kEscapedChars; | 309 output = kEscapedChars; |
310 return output; | 310 return output; |
311 } | 311 } |
312 | 312 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const bool disable_sync_over_celluar = | 420 const bool disable_sync_over_celluar = |
421 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); | 421 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); |
422 | 422 |
423 if (is_connection_cellular && disable_sync_over_celluar) | 423 if (is_connection_cellular && disable_sync_over_celluar) |
424 return DRIVE_CONNECTED_METERED; | 424 return DRIVE_CONNECTED_METERED; |
425 return DRIVE_CONNECTED; | 425 return DRIVE_CONNECTED; |
426 } | 426 } |
427 | 427 |
428 } // namespace util | 428 } // namespace util |
429 } // namespace drive | 429 } // namespace drive |
OLD | NEW |