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

Side by Side Diff: chrome/browser/chromeos/file_manager/volume_manager.cc

Issue 23541009: Return Drive mount point by getMountPoints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser test Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/file_manager/volume_manager.h" 5 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 153 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
154 DCHECK(observer); 154 DCHECK(observer);
155 observers_.RemoveObserver(observer); 155 observers_.RemoveObserver(observer);
156 } 156 }
157 157
158 std::vector<VolumeInfo> VolumeManager::GetVolumeInfoList() const { 158 std::vector<VolumeInfo> VolumeManager::GetVolumeInfoList() const {
159 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 159 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
160 160
161 std::vector<VolumeInfo> result; 161 std::vector<VolumeInfo> result;
162 162
163 // TODO(hidehiko): Adds Drive if available. 163 // Adds "Drive" volume.
164 if (drive_integration_service_ && drive_integration_service_->IsMounted())
165 result.push_back(CreateDriveVolumeInfo());
164 166
165 // Adds "Downloads". 167 // Adds "Downloads".
166 base::FilePath home_path; 168 base::FilePath home_path;
167 if (PathService::Get(base::DIR_HOME, &home_path)) { 169 if (PathService::Get(base::DIR_HOME, &home_path)) {
168 result.push_back( 170 result.push_back(
169 CreateDownloadsVolumeInfo(home_path.AppendASCII("Downloads"))); 171 CreateDownloadsVolumeInfo(home_path.AppendASCII("Downloads")));
170 } 172 }
171 173
172 // Adds disks (both removable disks and zip archives). 174 // Adds disks (both removable disks and zip archives).
173 const chromeos::disks::DiskMountManager::MountPointMap& mount_points = 175 const chromeos::disks::DiskMountManager::MountPointMap& mount_points =
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 LOG(INFO) << "Unmounting " << mount_path << " because of preference."; 386 LOG(INFO) << "Unmounting " << mount_path << " because of preference.";
385 disk_mount_manager_->UnmountPath( 387 disk_mount_manager_->UnmountPath(
386 mount_path, 388 mount_path,
387 chromeos::UNMOUNT_OPTIONS_NONE, 389 chromeos::UNMOUNT_OPTIONS_NONE,
388 chromeos::disks::DiskMountManager::UnmountPathCallback()); 390 chromeos::disks::DiskMountManager::UnmountPathCallback());
389 } 391 }
390 } 392 }
391 } 393 }
392 394
393 } // namespace file_manager 395 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698