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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(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 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 |
313 void PrepareWritableFileAndRun(Profile* profile, | 313 void PrepareWritableFileAndRun(Profile* profile, |
314 const base::FilePath& path, | 314 const base::FilePath& path, |
315 const PrepareWritableFileCallback& callback) { | 315 const PrepareWritableFileCallback& callback) { |
316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
317 DCHECK(!callback.is_null()); | 317 DCHECK(!callback.is_null()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 const bool disable_sync_over_celluar = | 406 const bool disable_sync_over_celluar = |
407 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); | 407 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); |
408 | 408 |
409 if (is_connection_cellular && disable_sync_over_celluar) | 409 if (is_connection_cellular && disable_sync_over_celluar) |
410 return DRIVE_CONNECTED_METERED; | 410 return DRIVE_CONNECTED_METERED; |
411 return DRIVE_CONNECTED; | 411 return DRIVE_CONNECTED; |
412 } | 412 } |
413 | 413 |
414 } // namespace util | 414 } // namespace util |
415 } // namespace drive | 415 } // namespace drive |
OLD | NEW |