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

Side by Side Diff: content/browser/system_message_window_win.cc

Issue 10933084: Fix device broadcast DCHECK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <dbt.h> 7 #include <dbt.h>
8 #include <ks.h> 8 #include <ks.h>
9 #include <ksmedia.h> 9 #include <ksmedia.h>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 case DBT_DEVICEREMOVECOMPLETE: 105 case DBT_DEVICEREMOVECOMPLETE:
106 case DBT_DEVICEARRIVAL: { 106 case DBT_DEVICEARRIVAL: {
107 // This notification has more details about the specific device that 107 // This notification has more details about the specific device that
108 // was added or removed. See if this is a category we're interested 108 // was added or removed. See if this is a category we're interested
109 // in monitoring and if so report the specific device type. If we don't 109 // in monitoring and if so report the specific device type. If we don't
110 // find the category in our map, ignore the notification and do not 110 // find the category in our map, ignore the notification and do not
111 // notify the system monitor. 111 // notify the system monitor.
112 DEV_BROADCAST_DEVICEINTERFACE* device_interface = 112 DEV_BROADCAST_DEVICEINTERFACE* device_interface =
113 reinterpret_cast<DEV_BROADCAST_DEVICEINTERFACE*>(data); 113 reinterpret_cast<DEV_BROADCAST_DEVICEINTERFACE*>(data);
114 DCHECK_EQ(device_interface->dbcc_devicetype, 114 if (device_interface->dbcc_devicetype != DBT_DEVTYP_DEVICEINTERFACE)
115 static_cast<DWORD>(DBT_DEVTYP_DEVICEINTERFACE)); 115 return TRUE;
116 for (int i = 0; i < arraysize(kDeviceCategoryMap); ++i) { 116 for (int i = 0; i < arraysize(kDeviceCategoryMap); ++i) {
117 if (kDeviceCategoryMap[i].device_category == 117 if (kDeviceCategoryMap[i].device_category ==
118 device_interface->dbcc_classguid) { 118 device_interface->dbcc_classguid) {
119 device_type = kDeviceCategoryMap[i].device_type; 119 device_type = kDeviceCategoryMap[i].device_type;
120 break; 120 break;
121 } 121 }
122 } 122 }
123 123
124 // Devices that we do not have a DEVTYPE_ for, get detected via 124 // Devices that we do not have a DEVTYPE_ for, get detected via
125 // DBT_DEVNODES_CHANGED, so we avoid sending additional notifications 125 // DBT_DEVNODES_CHANGED, so we avoid sending additional notifications
(...skipping 16 matching lines...) Expand all
142 WPARAM wparam, LPARAM lparam) { 142 WPARAM wparam, LPARAM lparam) {
143 switch (message) { 143 switch (message) {
144 case WM_DEVICECHANGE: 144 case WM_DEVICECHANGE:
145 return OnDeviceChange(static_cast<UINT>(wparam), lparam); 145 return OnDeviceChange(static_cast<UINT>(wparam), lparam);
146 default: 146 default:
147 break; 147 break;
148 } 148 }
149 149
150 return ::DefWindowProc(hwnd, message, wparam, lparam); 150 return ::DefWindowProc(hwnd, message, wparam, lparam);
151 } 151 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698