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/storage_monitor/volume_mount_watcher_win.h" | 5 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <dbt.h> | 9 #include <dbt.h> |
10 #include <fileapi.h> | 10 #include <fileapi.h> |
11 #include <winioctl.h> | 11 #include <winioctl.h> |
12 | 12 |
13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/task_runner_util.h" | 20 #include "base/task_runner_util.h" |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "base/win/scoped_handle.h" | 22 #include "base/win/scoped_handle.h" |
23 #include "chrome/browser/storage_monitor/media_storage_util.h" | 23 #include "chrome/browser/storage_monitor/media_storage_util.h" |
24 #include "chrome/browser/storage_monitor/storage_info.h" | 24 #include "chrome/browser/storage_monitor/storage_info.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
27 | 27 |
28 using content::BrowserThread; | 28 using content::BrowserThread; |
29 | 29 |
30 namespace chrome { | |
31 | |
32 namespace { | 30 namespace { |
33 | 31 |
34 const DWORD kMaxPathBufLen = MAX_PATH + 1; | 32 const DWORD kMaxPathBufLen = MAX_PATH + 1; |
35 | 33 |
36 enum DeviceType { | 34 enum DeviceType { |
37 FLOPPY, | 35 FLOPPY, |
38 REMOVABLE, | 36 REMOVABLE, |
39 FIXED, | 37 FIXED, |
40 }; | 38 }; |
41 | 39 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 518 } |
521 if (device_metadata_.erase(device) == 0) { | 519 if (device_metadata_.erase(device) == 0) { |
522 callback.Run(StorageMonitor::EJECT_FAILURE); | 520 callback.Run(StorageMonitor::EJECT_FAILURE); |
523 return; | 521 return; |
524 } | 522 } |
525 | 523 |
526 task_runner_->PostTask( | 524 task_runner_->PostTask( |
527 FROM_HERE, | 525 FROM_HERE, |
528 base::Bind(&EjectDeviceInThreadPool, device, callback, task_runner_, 0)); | 526 base::Bind(&EjectDeviceInThreadPool, device, callback, task_runner_, 0)); |
529 } | 527 } |
530 | |
531 } // namespace chrome | |
OLD | NEW |