OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/file_manager/event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 chromeos::MountError error, | 242 chromeos::MountError error, |
243 const VolumeInfo& volume_info, | 243 const VolumeInfo& volume_info, |
244 bool is_remounting) { | 244 bool is_remounting) { |
245 file_browser_private::MountCompletedEvent event; | 245 file_browser_private::MountCompletedEvent event; |
246 event.event_type = event_type; | 246 event.event_type = event_type; |
247 event.status = MountErrorToMountCompletedStatus(error); | 247 event.status = MountErrorToMountCompletedStatus(error); |
248 util::VolumeInfoToVolumeMetadata( | 248 util::VolumeInfoToVolumeMetadata( |
249 profile, volume_info, &event.volume_metadata); | 249 profile, volume_info, &event.volume_metadata); |
250 event.is_remounting = is_remounting; | 250 event.is_remounting = is_remounting; |
251 | 251 |
252 if (!volume_info.mount_path.empty() && | |
253 event.volume_metadata.mount_path.empty()) { | |
254 event.status = | |
255 file_browser_private::MOUNT_COMPLETED_STATUS_ERROR_PATH_UNMOUNTED; | |
256 } | |
257 | |
258 BroadcastEvent( | 252 BroadcastEvent( |
259 profile, | 253 profile, |
260 file_browser_private::OnMountCompleted::kEventName, | 254 file_browser_private::OnMountCompleted::kEventName, |
261 file_browser_private::OnMountCompleted::Create(event)); | 255 file_browser_private::OnMountCompleted::Create(event)); |
262 } | 256 } |
263 | 257 |
264 file_browser_private::CopyProgressStatusType | 258 file_browser_private::CopyProgressStatusType |
265 CopyProgressTypeToCopyProgressStatusType( | 259 CopyProgressTypeToCopyProgressStatusType( |
266 fileapi::FileSystemOperation::CopyProgressType type) { | 260 fileapi::FileSystemOperation::CopyProgressType type) { |
267 switch (type) { | 261 switch (type) { |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 } | 916 } |
923 } | 917 } |
924 | 918 |
925 void EventRouter::OnOwnerEntryChanged(aura::Window* window) { | 919 void EventRouter::OnOwnerEntryChanged(aura::Window* window) { |
926 BroadcastEvent(profile_, | 920 BroadcastEvent(profile_, |
927 file_browser_private::OnDesktopChanged::kEventName, | 921 file_browser_private::OnDesktopChanged::kEventName, |
928 file_browser_private::OnDesktopChanged::Create()); | 922 file_browser_private::OnDesktopChanged::Create()); |
929 } | 923 } |
930 | 924 |
931 } // namespace file_manager | 925 } // namespace file_manager |
OLD | NEW |