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

Side by Side Diff: components/storage_monitor/storage_monitor_linux.cc

Issue 120303003: [StorageMonitor] Move gallery name generation to StorageInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // StorageMonitorLinux implementation. 5 // StorageMonitorLinux implementation.
6 6
7 #include "components/storage_monitor/storage_monitor_linux.h" 7 #include "components/storage_monitor/storage_monitor_linux.h"
8 8
9 #include <mntent.h> 9 #include <mntent.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (MediaStorageUtil::HasDcim(mount_point)) 176 if (MediaStorageUtil::HasDcim(mount_point))
177 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; 177 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM;
178 else 178 else
179 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; 179 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM;
180 } 180 }
181 181
182 results_recorder.set_result(true); 182 results_recorder.set_result(true);
183 183
184 storage_info.reset(new StorageInfo( 184 storage_info.reset(new StorageInfo(
185 StorageInfo::MakeDeviceId(type, unique_id), 185 StorageInfo::MakeDeviceId(type, unique_id),
186 base::string16(),
187 mount_point.value(), 186 mount_point.value(),
188 volume_label, 187 volume_label,
189 vendor_name, 188 vendor_name,
190 model_name, 189 model_name,
191 GetDeviceStorageSize(device_path, device.get()))); 190 GetDeviceStorageSize(device_path, device.get())));
192 return storage_info.Pass(); 191 return storage_info.Pass();
193 } 192 }
194 193
195 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( 194 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread(
196 const base::FilePath& mtab_path, 195 const base::FilePath& mtab_path,
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 mount_priority_map_[mount_device][mount_point] = removable; 497 mount_priority_map_[mount_device][mount_point] = removable;
499 receiver()->ProcessAttach(*storage_info); 498 receiver()->ProcessAttach(*storage_info);
500 } 499 }
501 500
502 StorageMonitor* StorageMonitor::CreateInternal() { 501 StorageMonitor* StorageMonitor::CreateInternal() {
503 const base::FilePath kDefaultMtabPath("/etc/mtab"); 502 const base::FilePath kDefaultMtabPath("/etc/mtab");
504 return new StorageMonitorLinux(kDefaultMtabPath); 503 return new StorageMonitorLinux(kDefaultMtabPath);
505 } 504 }
506 505
507 } // namespace storage_monitor 506 } // namespace storage_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698