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

Side by Side Diff: chrome/browser/system_monitor/removable_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: Update and add unit test 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
« no previous file with comments | « chrome/browser/system_monitor/removable_device_notifications_window_win.h ('k') | 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 "chrome/browser/system_monitor/removable_device_notifications_window_wi n.h" 5 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi n.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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const std::string& id, 154 const std::string& id,
155 const FilePath::StringType& device_name, 155 const FilePath::StringType& device_name,
156 const FilePath& path) { 156 const FilePath& path) {
157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
158 158
159 SystemMonitor::Get()->ProcessRemovableStorageAttached(id, 159 SystemMonitor::Get()->ProcessRemovableStorageAttached(id,
160 device_name, 160 device_name,
161 path.value()); 161 path.value());
162 } 162 }
163 163
164 void RemovableDeviceNotificationsWindowWin::StartWatchingStorage(
165 const FilePath& path) {
166 NOTIMPLEMENTED();
167 }
168
169 void RemovableDeviceNotificationsWindowWin::StopWatchingStorage(
170 const FilePath& path) {
171 NOTIMPLEMENTED();
172 }
173
164 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc( 174 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc(
165 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { 175 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
166 switch (message) { 176 switch (message) {
167 case WM_DEVICECHANGE: 177 case WM_DEVICECHANGE:
168 return OnDeviceChange(static_cast<UINT>(wparam), 178 return OnDeviceChange(static_cast<UINT>(wparam),
169 static_cast<DWORD>(lparam)); 179 static_cast<DWORD>(lparam));
170 default: 180 default:
171 break; 181 break;
172 } 182 }
173 183
174 return ::DefWindowProc(hwnd, message, wparam, lparam); 184 return ::DefWindowProc(hwnd, message, wparam, lparam);
175 } 185 }
176 186
177 // static 187 // static
178 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk( 188 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk(
179 HWND hwnd, 189 HWND hwnd,
180 UINT message, 190 UINT message,
181 WPARAM wparam, 191 WPARAM wparam,
182 LPARAM lparam) { 192 LPARAM lparam) {
183 RemovableDeviceNotificationsWindowWin* msg_wnd = 193 RemovableDeviceNotificationsWindowWin* msg_wnd =
184 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( 194 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>(
185 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 195 GetWindowLongPtr(hwnd, GWLP_USERDATA));
186 if (msg_wnd) 196 if (msg_wnd)
187 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 197 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
188 return ::DefWindowProc(hwnd, message, wparam, lparam); 198 return ::DefWindowProc(hwnd, message, wparam, lparam);
189 } 199 }
190 200
191 } // namespace chrome 201 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/system_monitor/removable_device_notifications_window_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698