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

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

Issue 379743004: Add a method in DiskMountManager to refresh mount entries in addition to devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments + Fix up MockDiskMountManager. Created 6 years, 5 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/fake_disk_mount_manager.h" 5 #include "chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h"
6 6
7 #include "base/callback.h"
7 #include "base/stl_util.h" 8 #include "base/stl_util.h"
8 9
9 namespace file_manager { 10 namespace file_manager {
10 11
11 FakeDiskMountManager::MountRequest::MountRequest( 12 FakeDiskMountManager::MountRequest::MountRequest(
12 const std::string& source_path, 13 const std::string& source_path,
13 const std::string& source_format, 14 const std::string& source_format,
14 const std::string& mount_label, 15 const std::string& mount_label,
15 chromeos::MountType type) 16 chromeos::MountType type)
16 : source_path(source_path), 17 : source_path(source_path),
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (iter == disks_.end()) 56 if (iter == disks_.end())
56 return NULL; 57 return NULL;
57 return iter->second; 58 return iter->second;
58 } 59 }
59 60
60 const chromeos::disks::DiskMountManager::MountPointMap& 61 const chromeos::disks::DiskMountManager::MountPointMap&
61 FakeDiskMountManager::mount_points() const { 62 FakeDiskMountManager::mount_points() const {
62 return mount_points_; 63 return mount_points_;
63 } 64 }
64 65
65 void FakeDiskMountManager::RequestMountInfoRefresh() { 66 void FakeDiskMountManager::EnsureMountInfoRefreshed(
67 const EnsureMountInfoRefreshedCallback& callback) {
68 callback.Run(true);
66 } 69 }
67 70
68 void FakeDiskMountManager::MountPath(const std::string& source_path, 71 void FakeDiskMountManager::MountPath(const std::string& source_path,
69 const std::string& source_format, 72 const std::string& source_format,
70 const std::string& mount_label, 73 const std::string& mount_label,
71 chromeos::MountType type) { 74 chromeos::MountType type) {
72 mount_requests_.push_back( 75 mount_requests_.push_back(
73 MountRequest(source_path, source_format, mount_label, type)); 76 MountRequest(source_path, source_format, mount_label, type));
74 77
75 const MountPointInfo mount_point( 78 const MountPointInfo mount_point(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 124
122 void FakeDiskMountManager::InvokeDiskEventForTest( 125 void FakeDiskMountManager::InvokeDiskEventForTest(
123 chromeos::disks::DiskMountManager::DiskEvent event, 126 chromeos::disks::DiskMountManager::DiskEvent event,
124 const chromeos::disks::DiskMountManager::Disk* disk) { 127 const chromeos::disks::DiskMountManager::Disk* disk) {
125 FOR_EACH_OBSERVER(chromeos::disks::DiskMountManager::Observer, 128 FOR_EACH_OBSERVER(chromeos::disks::DiskMountManager::Observer,
126 observers_, 129 observers_,
127 OnDiskEvent(event, disk)); 130 OnDiskEvent(event, disk));
128 } 131 }
129 132
130 } // namespace file_manager 133 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h ('k') | chrome/browser/chromeos/file_manager/volume_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698