Chromium Code Reviews| Index: chrome/browser/storage_monitor/storage_monitor_win.cc |
| diff --git a/chrome/browser/storage_monitor/removable_device_notifications_window_win.cc b/chrome/browser/storage_monitor/storage_monitor_win.cc |
| similarity index 81% |
| rename from chrome/browser/storage_monitor/removable_device_notifications_window_win.cc |
| rename to chrome/browser/storage_monitor/storage_monitor_win.cc |
| index 7f60507fe2ebae0d6d7f5172705f4c2c8fada45e..f5f026fcc100b67eab60d779155abc340ff62f13 100644 |
| --- a/chrome/browser/storage_monitor/removable_device_notifications_window_win.cc |
| +++ b/chrome/browser/storage_monitor/storage_monitor_win.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/storage_monitor/removable_device_notifications_window_win.h" |
| +#include "chrome/browser/storage_monitor/storage_monitor_win.h" |
| #include <windows.h> |
| #include <dbt.h> |
| @@ -23,17 +23,17 @@ const char16 kWindowClassName[] = L"Chrome_RemovableDeviceNotificationWindow"; |
| } // namespace |
| -// RemovableDeviceNotificationsWindowWin -------------------------------------- |
| +// StorageMonitorWindowWin -------------------------------------- |
| // static |
| -RemovableDeviceNotificationsWindowWin* |
| - RemovableDeviceNotificationsWindowWin::Create() { |
| - return new RemovableDeviceNotificationsWindowWin( |
| +StorageMonitorWin* |
| + StorageMonitorWin::Create() { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| + return new StorageMonitorWin( |
| new VolumeMountWatcherWin(), new PortableDeviceWatcherWin()); |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| } |
| -RemovableDeviceNotificationsWindowWin:: |
| - RemovableDeviceNotificationsWindowWin( |
| +StorageMonitorWin:: |
| + StorageMonitorWin( |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| VolumeMountWatcherWin* volume_mount_watcher, |
| PortableDeviceWatcherWin* portable_device_watcher) |
| : window_class_(0), |
| @@ -47,8 +47,8 @@ RemovableDeviceNotificationsWindowWin:: |
| portable_device_watcher_->SetNotifications(receiver()); |
| } |
| -RemovableDeviceNotificationsWindowWin:: |
| - ~RemovableDeviceNotificationsWindowWin() { |
| +StorageMonitorWin:: |
| + ~StorageMonitorWin() { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line warp.
|
| volume_mount_watcher_->SetNotifications(NULL); |
| portable_device_watcher_->SetNotifications(NULL); |
| @@ -59,12 +59,12 @@ RemovableDeviceNotificationsWindowWin:: |
| UnregisterClass(MAKEINTATOM(window_class_), instance_); |
| } |
| -void RemovableDeviceNotificationsWindowWin::Init() { |
| +void StorageMonitorWin::Init() { |
| WNDCLASSEX window_class; |
| base::win::InitializeWindowClass( |
| kWindowClassName, |
| &base::win::WrappedWindowProc< |
| - RemovableDeviceNotificationsWindowWin::WndProcThunk>, |
| + StorageMonitorWin::WndProcThunk>, |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| 0, 0, 0, NULL, NULL, NULL, NULL, NULL, |
| &window_class); |
| instance_ = window_class.hInstance; |
| @@ -78,7 +78,7 @@ void RemovableDeviceNotificationsWindowWin::Init() { |
| portable_device_watcher_->Init(window_); |
| } |
| -bool RemovableDeviceNotificationsWindowWin::GetStorageInfoForPath( |
| +bool StorageMonitorWin::GetStorageInfoForPath( |
| const base::FilePath& path, |
| StorageInfo* device_info) const { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| string16 location; |
| @@ -125,12 +125,12 @@ bool RemovableDeviceNotificationsWindowWin::GetStorageInfoForPath( |
| return true; |
| } |
| -uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize( |
| +uint64 StorageMonitorWin::GetStorageSize( |
| const base::FilePath::StringType& location) const { |
| return volume_mount_watcher_->GetStorageSize(location); |
| } |
| -bool RemovableDeviceNotificationsWindowWin::GetMTPStorageInfoFromDeviceId( |
| +bool StorageMonitorWin::GetMTPStorageInfoFromDeviceId( |
| const std::string& storage_device_id, |
| string16* device_location, |
| string16* storage_object_id) const { |
| @@ -142,17 +142,17 @@ bool RemovableDeviceNotificationsWindowWin::GetMTPStorageInfoFromDeviceId( |
| } |
| // static |
| -LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk( |
| +LRESULT CALLBACK StorageMonitorWin::WndProcThunk( |
| HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| - RemovableDeviceNotificationsWindowWin* msg_wnd = |
| - reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( |
| + StorageMonitorWin* msg_wnd = |
| + reinterpret_cast<StorageMonitorWin*>( |
| GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| if (msg_wnd) |
| return msg_wnd->WndProc(hwnd, message, wparam, lparam); |
| return ::DefWindowProc(hwnd, message, wparam, lparam); |
| } |
| -LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc( |
| +LRESULT CALLBACK StorageMonitorWin::WndProc( |
| HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| switch (message) { |
| case WM_DEVICECHANGE: |
| @@ -165,7 +165,7 @@ LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProc( |
| return ::DefWindowProc(hwnd, message, wparam, lparam); |
| } |
| -bool RemovableDeviceNotificationsWindowWin::GetDeviceInfo( |
| +bool StorageMonitorWin::GetDeviceInfo( |
| const base::FilePath& device_path, string16* device_location, |
| std::string* unique_id, string16* name, bool* removable, |
| uint64* total_size_in_bytes) const { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
reindent; one arg per line, aligned after (
|
| @@ -177,7 +177,7 @@ bool RemovableDeviceNotificationsWindowWin::GetDeviceInfo( |
| total_size_in_bytes); |
| } |
| -void RemovableDeviceNotificationsWindowWin::OnDeviceChange(UINT event_type, |
| +void StorageMonitorWin::OnDeviceChange(UINT event_type, |
| LPARAM data) { |
|
vandebo (ex-Chrome)
2013/03/01 19:47:39
nit: line wrap.
|
| volume_mount_watcher_->OnWindowMessage(event_type, data); |
| portable_device_watcher_->OnWindowMessage(event_type, data); |