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

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

Issue 10917166: Extend the capability of SystemMonitor to support watching storage free space change (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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/system_monitor/media_device_notifications_window_win.h" 5 #include "chrome/browser/system_monitor/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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 const std::string& id, 152 const std::string& id,
153 const FilePath::StringType& device_name, 153 const FilePath::StringType& device_name,
154 const FilePath& path) { 154 const FilePath& path) {
155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
156 156
157 SystemMonitor::Get()->ProcessRemovableStorageAttached(id, 157 SystemMonitor::Get()->ProcessRemovableStorageAttached(id,
158 device_name, 158 device_name,
159 path.value()); 159 path.value());
160 } 160 }
161 161
162 bool MediaDeviceNotificationsWindowWin::StartWatchingStorage(
163 const FilePath::StringType& path) {
164 return false;
165 }
166
167 bool MediaDeviceNotificationsWindowWin::StopWatchingStorage(
168 const FilePath::StringType& path) {
169 return false;
170 }
171
172
162 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc( 173 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc(
163 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { 174 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
164 switch (message) { 175 switch (message) {
165 case WM_DEVICECHANGE: 176 case WM_DEVICECHANGE:
166 return OnDeviceChange(static_cast<UINT>(wparam), 177 return OnDeviceChange(static_cast<UINT>(wparam),
167 static_cast<DWORD>(lparam)); 178 static_cast<DWORD>(lparam));
168 default: 179 default:
169 break; 180 break;
170 } 181 }
171 182
172 return ::DefWindowProc(hwnd, message, wparam, lparam); 183 return ::DefWindowProc(hwnd, message, wparam, lparam);
173 } 184 }
174 185
175 // static 186 // static
176 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProcThunk( 187 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProcThunk(
177 HWND hwnd, 188 HWND hwnd,
178 UINT message, 189 UINT message,
179 WPARAM wparam, 190 WPARAM wparam,
180 LPARAM lparam) { 191 LPARAM lparam) {
181 MediaDeviceNotificationsWindowWin* msg_wnd = 192 MediaDeviceNotificationsWindowWin* msg_wnd =
182 reinterpret_cast<MediaDeviceNotificationsWindowWin*>( 193 reinterpret_cast<MediaDeviceNotificationsWindowWin*>(
183 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 194 GetWindowLongPtr(hwnd, GWLP_USERDATA));
184 if (msg_wnd) 195 if (msg_wnd)
185 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 196 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
186 return ::DefWindowProc(hwnd, message, wparam, lparam); 197 return ::DefWindowProc(hwnd, message, wparam, lparam);
187 } 198 }
188 199
189 } // namespace chrome 200 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698