| 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 this, id, device_name, path)); | 149 this, id, device_name, path)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void | 152 void |
| 153 RemovableDeviceNotificationsWindowWin::ProcessRemovableDeviceAttachedOnUIThread( | 153 RemovableDeviceNotificationsWindowWin::ProcessRemovableDeviceAttachedOnUIThread( |
| 154 const std::string& id, | 154 const std::string& id, |
| 155 const FilePath::StringType& device_name, | 155 const FilePath::StringType& device_name, |
| 156 const FilePath& path) { | 156 const FilePath& path) { |
| 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 158 | 158 |
| 159 // TODO(kmadhusu) Record device info histogram. |
| 159 SystemMonitor::Get()->ProcessRemovableStorageAttached(id, | 160 SystemMonitor::Get()->ProcessRemovableStorageAttached(id, |
| 160 device_name, | 161 device_name, |
| 161 path.value()); | 162 path.value()); |
| 162 } | 163 } |
| 163 | 164 |
| 164 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc( | 165 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc( |
| 165 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { | 166 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
| 166 switch (message) { | 167 switch (message) { |
| 167 case WM_DEVICECHANGE: | 168 case WM_DEVICECHANGE: |
| 168 return OnDeviceChange(static_cast<UINT>(wparam), | 169 return OnDeviceChange(static_cast<UINT>(wparam), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 182 LPARAM lparam) { | 183 LPARAM lparam) { |
| 183 RemovableDeviceNotificationsWindowWin* msg_wnd = | 184 RemovableDeviceNotificationsWindowWin* msg_wnd = |
| 184 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( | 185 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( |
| 185 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | 186 GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
| 186 if (msg_wnd) | 187 if (msg_wnd) |
| 187 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | 188 return msg_wnd->WndProc(hwnd, message, wparam, lparam); |
| 188 return ::DefWindowProc(hwnd, message, wparam, lparam); | 189 return ::DefWindowProc(hwnd, message, wparam, lparam); |
| 189 } | 190 } |
| 190 | 191 |
| 191 } // namespace chrome | 192 } // namespace chrome |
| OLD | NEW |