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

Unified Diff: chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc

Issue 2358493002: Remove MTP support on Linux. (Closed)
Patch Set: move files Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc
diff --git a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc b/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc
deleted file mode 100644
index af5b12578fc5d813d530779b060b8a5594daac64..0000000000000000000000000000000000000000
--- a/chrome/browser/media_galleries/linux/mtp_device_object_enumerator.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/media_galleries/linux/mtp_device_object_enumerator.h"
-
-#include "base/logging.h"
-
-MTPDeviceObjectEnumerator::MTPDeviceObjectEnumerator(
- const std::vector<MtpFileEntry>& entries)
- : file_entries_(entries),
- index_(0U),
- is_index_ready_(false) {
-}
-
-MTPDeviceObjectEnumerator::~MTPDeviceObjectEnumerator() {
-}
-
-base::FilePath MTPDeviceObjectEnumerator::Next() {
- if (IsIndexReadyAndInRange())
- ++index_; // Normal traversal.
- else if (!is_index_ready_)
- is_index_ready_ = true; // First time calling Next().
-
- if (!HasMoreEntries())
- return base::FilePath();
- return base::FilePath(file_entries_[index_].file_name());
-}
-
-int64_t MTPDeviceObjectEnumerator::Size() {
- if (!IsIndexReadyAndInRange())
- return 0;
- return file_entries_[index_].file_size();
-}
-
-bool MTPDeviceObjectEnumerator::IsDirectory() {
- if (!IsIndexReadyAndInRange())
- return false;
- return file_entries_[index_].file_type() == MtpFileEntry::FILE_TYPE_FOLDER;
-}
-
-base::Time MTPDeviceObjectEnumerator::LastModifiedTime() {
- if (!IsIndexReadyAndInRange())
- return base::Time();
- return base::Time::FromTimeT(file_entries_[index_].modification_time());
-}
-
-bool MTPDeviceObjectEnumerator::GetEntryId(uint32_t* entry_id) const {
- DCHECK(entry_id);
- if (!IsIndexReadyAndInRange())
- return false;
-
- *entry_id = file_entries_[index_].item_id();
- return true;
-}
-
-bool MTPDeviceObjectEnumerator::HasMoreEntries() const {
- return index_ < file_entries_.size();
-}
-
-bool MTPDeviceObjectEnumerator::IsIndexReadyAndInRange() const {
- return is_index_ready_ && HasMoreEntries();
-}

Powered by Google App Engine
This is Rietveld 408576698