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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/device_event_router.cc

Issue 479563007: Files.app: Remove MountedDiskMonitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/thread_task_runner_handle.h" 6 #include "base/thread_task_runner_handle.h"
7 #include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h" 7 #include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h"
8 #include "chrome/browser/chromeos/file_manager/volume_manager.h" 8 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 const std::string& device_path = disk.system_path_prefix(); 115 const std::string& device_path = disk.system_path_prefix();
116 if (!disk.mount_path().empty() && 116 if (!disk.mount_path().empty() &&
117 GetDeviceState(device_path) != DEVICE_HARD_UNPLUGGED_AND_REPORTED) { 117 GetDeviceState(device_path) != DEVICE_HARD_UNPLUGGED_AND_REPORTED) {
118 OnDeviceEvent(file_browser_private::DEVICE_EVENT_TYPE_HARD_UNPLUGGED, 118 OnDeviceEvent(file_browser_private::DEVICE_EVENT_TYPE_HARD_UNPLUGGED,
119 device_path); 119 device_path);
120 SetDeviceState(device_path, DEVICE_HARD_UNPLUGGED_AND_REPORTED); 120 SetDeviceState(device_path, DEVICE_HARD_UNPLUGGED_AND_REPORTED);
121 } 121 }
122 } 122 }
123 123
124 void DeviceEventRouter::OnVolumeMounted(chromeos::MountError error_code, 124 void DeviceEventRouter::OnVolumeMounted(chromeos::MountError error_code,
125 const VolumeInfo& volume_info, 125 const VolumeInfo& volume_info) {
126 bool is_remounting) {
127 DCHECK(thread_checker_.CalledOnValidThread()); 126 DCHECK(thread_checker_.CalledOnValidThread());
128 127
129 const std::string& device_path = 128 const std::string& device_path =
130 volume_info.system_path_prefix.AsUTF8Unsafe(); 129 volume_info.system_path_prefix.AsUTF8Unsafe();
131 SetDeviceState(device_path, DEVICE_STATE_USUAL); 130 SetDeviceState(device_path, DEVICE_STATE_USUAL);
132 } 131 }
133 132
134 void DeviceEventRouter::OnVolumeUnmounted(chromeos::MountError error_code, 133 void DeviceEventRouter::OnVolumeUnmounted(chromeos::MountError error_code,
135 const VolumeInfo& volume_info) { 134 const VolumeInfo& volume_info) {
136 // Do nothing. 135 // Do nothing.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 device_states_[device_path] = state; 189 device_states_[device_path] = state;
191 } else { 190 } else {
192 const std::map<std::string, DeviceState>::iterator it = 191 const std::map<std::string, DeviceState>::iterator it =
193 device_states_.find(device_path); 192 device_states_.find(device_path);
194 if (it != device_states_.end()) 193 if (it != device_states_.end())
195 device_states_.erase(it); 194 device_states_.erase(it);
196 } 195 }
197 } 196 }
198 197
199 } // namespace file_manager 198 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698