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

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

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « components/search/search.cc ('k') | components/test_runner/web_test_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/storage_monitor/volume_mount_watcher_win.h" 5 #include "components/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>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (drive_type == DRIVE_FIXED || drive_type == DRIVE_REMOTE || 63 if (drive_type == DRIVE_FIXED || drive_type == DRIVE_REMOTE ||
64 drive_type == DRIVE_RAMDISK) { 64 drive_type == DRIVE_RAMDISK) {
65 return FIXED; 65 return FIXED;
66 } 66 }
67 if (drive_type != DRIVE_REMOVABLE) 67 if (drive_type != DRIVE_REMOVABLE)
68 return FLOPPY; 68 return FLOPPY;
69 69
70 // Check device strings of the form "X:" and "\\.\X:" 70 // Check device strings of the form "X:" and "\\.\X:"
71 // For floppy drives, these will return strings like "/Device/Floppy0" 71 // For floppy drives, these will return strings like "/Device/Floppy0"
72 base::string16 device = mount_point; 72 base::string16 device = mount_point;
73 if (EndsWith(mount_point, L"\\", false)) 73 if (base::EndsWith(mount_point, L"\\", false))
74 device = mount_point.substr(0, mount_point.length() - 1); 74 device = mount_point.substr(0, mount_point.length() - 1);
75 base::string16 device_path; 75 base::string16 device_path;
76 base::string16 device_path_slash; 76 base::string16 device_path_slash;
77 DWORD dos_device = QueryDosDevice( 77 DWORD dos_device = QueryDosDevice(
78 device.c_str(), WriteInto(&device_path, kMaxPathBufLen), kMaxPathBufLen); 78 device.c_str(), WriteInto(&device_path, kMaxPathBufLen), kMaxPathBufLen);
79 base::string16 device_slash = base::string16(L"\\\\.\\"); 79 base::string16 device_slash = base::string16(L"\\\\.\\");
80 device_slash += device; 80 device_slash += device;
81 DWORD dos_device_slash = QueryDosDevice( 81 DWORD dos_device_slash = QueryDosDevice(
82 device_slash.c_str(), WriteInto(&device_path_slash, kMaxPathBufLen), 82 device_slash.c_str(), WriteInto(&device_path_slash, kMaxPathBufLen),
83 kMaxPathBufLen); 83 kMaxPathBufLen);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 callback.Run(StorageMonitor::EJECT_FAILURE); 542 callback.Run(StorageMonitor::EJECT_FAILURE);
543 return; 543 return;
544 } 544 }
545 545
546 device_info_task_runner_->PostTask( 546 device_info_task_runner_->PostTask(
547 FROM_HERE, base::Bind(&EjectDeviceInThreadPool, device, callback, 547 FROM_HERE, base::Bind(&EjectDeviceInThreadPool, device, callback,
548 device_info_task_runner_, 0)); 548 device_info_task_runner_, 0));
549 } 549 }
550 550
551 } // namespace storage_monitor 551 } // namespace storage_monitor
OLDNEW
« no previous file with comments | « components/search/search.cc ('k') | components/test_runner/web_test_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698