Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: chrome/browser/chromeos/drive/fake_drive_file_system.cc

Issue 13579005: chromeos: Fix FilePath handling incompatibility between FakeDriveFileSystem::GetEntryInfoByResource… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/fake_drive_file_system.h" 5 #include "chrome/browser/chromeos/drive/fake_drive_file_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 DriveFileError error = util::GDataToDriveFileError(gdata_error); 390 DriveFileError error = util::GDataToDriveFileError(gdata_error);
391 if (error != DRIVE_FILE_OK) { 391 if (error != DRIVE_FILE_OK) {
392 callback.Run(error, scoped_ptr<DriveEntryProto>()); 392 callback.Run(error, scoped_ptr<DriveEntryProto>());
393 return; 393 return;
394 } 394 }
395 395
396 DCHECK(resource_list); 396 DCHECK(resource_list);
397 const ScopedVector<google_apis::ResourceEntry>& entries = 397 const ScopedVector<google_apis::ResourceEntry>& entries =
398 resource_list->entries(); 398 resource_list->entries();
399 for (size_t i = 0; i < entries.size(); ++i) { 399 for (size_t i = 0; i < entries.size(); ++i) {
400 const google_apis::ResourceEntry& entry = *entries[i]; 400 scoped_ptr<DriveEntryProto> entry(new DriveEntryProto(
401 if (base::FilePath(entry.title()) == base_name) { 401 ConvertResourceEntryToDriveEntryProto(*entries[i])));
402 if (entry->base_name() == base_name.AsUTF8Unsafe()) {
402 // Found the target entry. 403 // Found the target entry.
403 scoped_ptr<DriveEntryProto> entry_proto(new DriveEntryProto( 404 callback.Run(DRIVE_FILE_OK, entry.Pass());
404 ConvertResourceEntryToDriveEntryProto(entry)));
405 callback.Run(DRIVE_FILE_OK, entry_proto.Pass());
406 return; 405 return;
407 } 406 }
408 } 407 }
409 408
410 callback.Run(DRIVE_FILE_ERROR_NOT_FOUND, scoped_ptr<DriveEntryProto>()); 409 callback.Run(DRIVE_FILE_ERROR_NOT_FOUND, scoped_ptr<DriveEntryProto>());
411 } 410 }
412 411
413 } // namespace test_util 412 } // namespace test_util
414 } // namespace drive 413 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698