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

Side by Side Diff: chrome/browser/media_gallery/linux/mtp_device_object_enumerator.cc

Issue 11855005: [Linux, Media Gallery] Fix MTPRecursiveDeviceObjectEnumerator to recursively enumerate all the medi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 7 years, 11 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
OLDNEW
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/media_gallery/linux/mtp_device_object_enumerator.h" 5 #include "chrome/browser/media_gallery/linux/mtp_device_object_enumerator.h"
6 6
7 #include "base/logging.h"
8
7 namespace chrome { 9 namespace chrome {
8 10
9 MTPDeviceObjectEnumerator::MTPDeviceObjectEnumerator( 11 MTPDeviceObjectEnumerator::MTPDeviceObjectEnumerator(
10 const MtpFileEntries& entries) 12 const MtpFileEntries& entries)
11 : file_entries_(entries), 13 : file_entries_(entries),
12 file_entry_iter_(file_entries_.begin()) { 14 file_entry_iter_(file_entries_.begin()) {
13 } 15 }
14 16
15 MTPDeviceObjectEnumerator::~MTPDeviceObjectEnumerator() { 17 MTPDeviceObjectEnumerator::~MTPDeviceObjectEnumerator() {
16 } 18 }
(...skipping 12 matching lines...) Expand all
29 } 31 }
30 32
31 bool MTPDeviceObjectEnumerator::IsDirectory() { 33 bool MTPDeviceObjectEnumerator::IsDirectory() {
32 return current_file_info_.file_type() == MtpFileEntry::FILE_TYPE_FOLDER; 34 return current_file_info_.file_type() == MtpFileEntry::FILE_TYPE_FOLDER;
33 } 35 }
34 36
35 base::Time MTPDeviceObjectEnumerator::LastModifiedTime() { 37 base::Time MTPDeviceObjectEnumerator::LastModifiedTime() {
36 return base::Time::FromTimeT(current_file_info_.modification_time()); 38 return base::Time::FromTimeT(current_file_info_.modification_time());
37 } 39 }
38 40
41 bool MTPDeviceObjectEnumerator::GetEntryId(uint32_t* entry_id) {
42 DCHECK(entry_id);
43 if (file_entry_iter_ == file_entries_.end())
44 return false;
45
46 *entry_id = (*file_entry_iter_).item_id();
47 return true;
48 }
49
50 bool MTPDeviceObjectEnumerator::HasMoreEntries() {
51 return file_entry_iter_ != file_entries_.end();
52 }
53
39 } // namespace chrome 54 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698