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

Side by Side Diff: chrome/browser/media_gallery/media_device_notifications_window_win.cc

Issue 10780023: Change base::SystemMonitor's media device functions to take a type and string16 instead of a FilePa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix win Created 8 years, 5 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
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 "chrome/browser/media_gallery/media_device_notifications_window_win.h" 5 #include "chrome/browser/media_gallery/media_device_notifications_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 <string> 10 #include <string>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 void MediaDeviceNotificationsWindowWin::ProcessMediaDeviceAttachedOnUIThread( 142 void MediaDeviceNotificationsWindowWin::ProcessMediaDeviceAttachedOnUIThread(
143 unsigned int id, 143 unsigned int id,
144 const FilePath::StringType& device_name, 144 const FilePath::StringType& device_name,
145 const FilePath& path) { 145 const FilePath& path) {
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
147 147
148 const std::string device_name_utf8(base::SysWideToUTF8(device_name)); 148 const std::string device_name_utf8(base::SysWideToUTF8(device_name));
149 base::SystemMonitor* monitor = base::SystemMonitor::Get(); 149 base::SystemMonitor* monitor = base::SystemMonitor::Get();
150 monitor->ProcessMediaDeviceAttached(id, device_name_utf8, path); 150 monitor->ProcessMediaDeviceAttached(id,
151 device_name_utf8,
152 base::SystemMonitor::TYPE_PATH,
153 path.value());
151 } 154 }
152 155
153 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc( 156 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc(
154 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { 157 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
155 switch (message) { 158 switch (message) {
156 case WM_DEVICECHANGE: 159 case WM_DEVICECHANGE:
157 return OnDeviceChange(static_cast<UINT>(wparam), 160 return OnDeviceChange(static_cast<UINT>(wparam),
158 static_cast<DWORD>(lparam)); 161 static_cast<DWORD>(lparam));
159 default: 162 default:
160 break; 163 break;
(...skipping 10 matching lines...) Expand all
171 LPARAM lparam) { 174 LPARAM lparam) {
172 MediaDeviceNotificationsWindowWin* msg_wnd = 175 MediaDeviceNotificationsWindowWin* msg_wnd =
173 reinterpret_cast<MediaDeviceNotificationsWindowWin*>( 176 reinterpret_cast<MediaDeviceNotificationsWindowWin*>(
174 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 177 GetWindowLongPtr(hwnd, GWLP_USERDATA));
175 if (msg_wnd) 178 if (msg_wnd)
176 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 179 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
177 return ::DefWindowProc(hwnd, message, wparam, lparam); 180 return ::DefWindowProc(hwnd, message, wparam, lparam);
178 } 181 }
179 182
180 } // namespace chrome 183 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698