| 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/system_monitor/removable_device_notifications_window_wi
n.h" | 5 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi
n.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <dbt.h> | 8 #include <dbt.h> |
| 9 #include <fileapi.h> | 9 #include <fileapi.h> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize( | 129 uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize( |
| 130 const std::string& location) const { | 130 const std::string& location) const { |
| 131 NOTIMPLEMENTED(); | 131 NOTIMPLEMENTED(); |
| 132 return 0ULL; | 132 return 0ULL; |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool RemovableDeviceNotificationsWindowWin::GetMTPStorageInfoFromDeviceId( |
| 136 const std::string& storage_device_id, |
| 137 string16* device_location, |
| 138 string16* storage_object_id) const { |
| 139 MediaStorageUtil::Type type; |
| 140 MediaStorageUtil::CrackDeviceId(storage_device_id, &type, NULL); |
| 141 return ((type == MediaStorageUtil::MTP_OR_PTP) && |
| 142 portable_device_watcher_->GetMTPStorageInfoFromDeviceId( |
| 143 storage_device_id, device_location, storage_object_id)); |
| 144 } |
| 145 |
| 135 // static | 146 // static |
| 136 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk( | 147 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk( |
| 137 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { | 148 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
| 138 RemovableDeviceNotificationsWindowWin* msg_wnd = | 149 RemovableDeviceNotificationsWindowWin* msg_wnd = |
| 139 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( | 150 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( |
| 140 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | 151 GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
| 141 if (msg_wnd) | 152 if (msg_wnd) |
| 142 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | 153 return msg_wnd->WndProc(hwnd, message, wparam, lparam); |
| 143 return ::DefWindowProc(hwnd, message, wparam, lparam); | 154 return ::DefWindowProc(hwnd, message, wparam, lparam); |
| 144 } | 155 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 172 portable_device_watcher_->OnWindowMessage(event_type, data); | 183 portable_device_watcher_->OnWindowMessage(event_type, data); |
| 173 } | 184 } |
| 174 | 185 |
| 175 // static | 186 // static |
| 176 RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() { | 187 RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() { |
| 177 DCHECK(g_removable_device_notifications_window_win); | 188 DCHECK(g_removable_device_notifications_window_win); |
| 178 return g_removable_device_notifications_window_win; | 189 return g_removable_device_notifications_window_win; |
| 179 } | 190 } |
| 180 | 191 |
| 181 } // namespace chrome | 192 } // namespace chrome |
| OLD | NEW |