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

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

Issue 490643005: Files.app: Start to use DeviceEventRouter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 chromeos::UNMOUNT_OPTIONS_LAZY, 502 chromeos::UNMOUNT_OPTIONS_LAZY,
503 chromeos::disks::DiskMountManager::UnmountPathCallback()); 503 chromeos::disks::DiskMountManager::UnmountPathCallback());
504 } 504 }
505 505
506 // Notify to observers. 506 // Notify to observers.
507 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, 507 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_,
508 OnDiskRemoved(*disk)); 508 OnDiskRemoved(*disk));
509 const std::string& device_path = disk->system_path_prefix(); 509 const std::string& device_path = disk->system_path_prefix();
510 if (mounted_disk_monitor_->DeviceIsHardUnpluggedButNotReported( 510 if (mounted_disk_monitor_->DeviceIsHardUnpluggedButNotReported(
511 device_path)) { 511 device_path)) {
512 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_,
513 OnHardUnplugged(device_path));
514 mounted_disk_monitor_->MarkAsHardUnpluggedReported(device_path); 512 mounted_disk_monitor_->MarkAsHardUnpluggedReported(device_path);
515 } 513 }
516 return; 514 return;
517 } 515 }
518 NOTREACHED(); 516 NOTREACHED();
519 } 517 }
520 518
521 void VolumeManager::OnDeviceEvent( 519 void VolumeManager::OnDeviceEvent(
522 chromeos::disks::DiskMountManager::DeviceEvent event, 520 chromeos::disks::DiskMountManager::DeviceEvent event,
523 const std::string& device_path) { 521 const std::string& device_path) {
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 return; 853 return;
856 if (error_code == chromeos::MOUNT_ERROR_NONE) 854 if (error_code == chromeos::MOUNT_ERROR_NONE)
857 mounted_volumes_.erase(volume_info.volume_id); 855 mounted_volumes_.erase(volume_info.volume_id);
858 856
859 FOR_EACH_OBSERVER(VolumeManagerObserver, 857 FOR_EACH_OBSERVER(VolumeManagerObserver,
860 observers_, 858 observers_,
861 OnVolumeUnmounted(error_code, volume_info)); 859 OnVolumeUnmounted(error_code, volume_info));
862 } 860 }
863 861
864 } // namespace file_manager 862 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698