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

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 // TODO(hongbo): Add the implementation for Windows.
165 return false;
166 }
167
168 bool MediaDeviceNotificationsWindowWin::StopWatchingStorage(
169 const FilePath::StringType& path) {
170 // TODO(hongbo): Add the implementation for Windows.
171 return false;
172 }
173
174
162 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc( 175 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc(
163 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { 176 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
164 switch (message) { 177 switch (message) {
165 case WM_DEVICECHANGE: 178 case WM_DEVICECHANGE:
166 return OnDeviceChange(static_cast<UINT>(wparam), 179 return OnDeviceChange(static_cast<UINT>(wparam),
167 static_cast<DWORD>(lparam)); 180 static_cast<DWORD>(lparam));
168 default: 181 default:
169 break; 182 break;
170 } 183 }
171 184
172 return ::DefWindowProc(hwnd, message, wparam, lparam); 185 return ::DefWindowProc(hwnd, message, wparam, lparam);
173 } 186 }
174 187
175 // static 188 // static
176 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProcThunk( 189 LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProcThunk(
177 HWND hwnd, 190 HWND hwnd,
178 UINT message, 191 UINT message,
179 WPARAM wparam, 192 WPARAM wparam,
180 LPARAM lparam) { 193 LPARAM lparam) {
181 MediaDeviceNotificationsWindowWin* msg_wnd = 194 MediaDeviceNotificationsWindowWin* msg_wnd =
182 reinterpret_cast<MediaDeviceNotificationsWindowWin*>( 195 reinterpret_cast<MediaDeviceNotificationsWindowWin*>(
183 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 196 GetWindowLongPtr(hwnd, GWLP_USERDATA));
184 if (msg_wnd) 197 if (msg_wnd)
185 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 198 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
186 return ::DefWindowProc(hwnd, message, wparam, lparam); 199 return ::DefWindowProc(hwnd, message, wparam, lparam);
187 } 200 }
188 201
189 } // namespace chrome 202 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698