| 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 "content/browser/system_message_window_win.h" | 5 #include "content/browser/system_message_window_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <dbt.h> | 8 #include <dbt.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 if (window_) { | 34 if (window_) { |
| 35 DestroyWindow(window_); | 35 DestroyWindow(window_); |
| 36 UnregisterClass(WindowClassName, instance_); | 36 UnregisterClass(WindowClassName, instance_); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 LRESULT SystemMessageWindowWin::OnDeviceChange(UINT event_type, DWORD data) { | 40 LRESULT SystemMessageWindowWin::OnDeviceChange(UINT event_type, DWORD data) { |
| 41 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | 41 base::SystemMonitor* monitor = base::SystemMonitor::Get(); |
| 42 switch (event_type) { | 42 switch (event_type) { |
| 43 case DBT_DEVNODES_CHANGED: | 43 case DBT_DEVNODES_CHANGED: |
| 44 monitor->ProcessDevicesChanged(); | 44 monitor->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_UNKNOWN); |
| 45 break; | 45 break; |
| 46 } | 46 } |
| 47 return TRUE; | 47 return TRUE; |
| 48 } | 48 } |
| 49 | 49 |
| 50 LRESULT CALLBACK SystemMessageWindowWin::WndProc(HWND hwnd, UINT message, | 50 LRESULT CALLBACK SystemMessageWindowWin::WndProc(HWND hwnd, UINT message, |
| 51 WPARAM wparam, LPARAM lparam) { | 51 WPARAM wparam, LPARAM lparam) { |
| 52 switch (message) { | 52 switch (message) { |
| 53 case WM_DEVICECHANGE: | 53 case WM_DEVICECHANGE: |
| 54 return OnDeviceChange(static_cast<UINT>(wparam), | 54 return OnDeviceChange(static_cast<UINT>(wparam), |
| 55 static_cast<DWORD>(lparam)); | 55 static_cast<DWORD>(lparam)); |
| 56 default: | 56 default: |
| 57 break; | 57 break; |
| 58 } | 58 } |
| 59 | 59 |
| 60 return ::DefWindowProc(hwnd, message, wparam, lparam); | 60 return ::DefWindowProc(hwnd, message, wparam, lparam); |
| 61 } | 61 } |
| OLD | NEW |