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

Side by Side Diff: components/storage_monitor/storage_monitor_win.h

Issue 231063002: Add notification for media changed, and notify volume mount watcher when it occurs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Name and constant change Created 6 years, 8 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 | « no previous file | components/storage_monitor/storage_monitor_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ 5 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_
6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ 6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 base::string16* storage_object_id) const OVERRIDE; 43 base::string16* storage_object_id) const OVERRIDE;
44 44
45 virtual void EjectDevice( 45 virtual void EjectDevice(
46 const std::string& device_id, 46 const std::string& device_id,
47 base::Callback<void(EjectStatus)> callback) OVERRIDE; 47 base::Callback<void(EjectStatus)> callback) OVERRIDE;
48 48
49 private: 49 private:
50 class PortableDeviceNotifications; 50 class PortableDeviceNotifications;
51 friend class TestStorageMonitorWin; 51 friend class TestStorageMonitorWin;
52 52
53 void MediaChangeNotificationRegister();
54
53 // Gets the removable storage information given a |device_path|. On success, 55 // Gets the removable storage information given a |device_path|. On success,
54 // returns true and fills in |info|. 56 // returns true and fills in |info|.
55 bool GetDeviceInfo(const base::FilePath& device_path, 57 bool GetDeviceInfo(const base::FilePath& device_path,
56 StorageInfo* info) const; 58 StorageInfo* info) const;
57 59
58 static LRESULT CALLBACK WndProcThunk(HWND hwnd, UINT message, WPARAM wparam, 60 static LRESULT CALLBACK WndProcThunk(HWND hwnd, UINT message, WPARAM wparam,
59 LPARAM lparam); 61 LPARAM lparam);
60 62
61 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, 63 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam,
62 LPARAM lparam); 64 LPARAM lparam);
63 65
64 void OnDeviceChange(UINT event_type, LPARAM data); 66 void OnDeviceChange(UINT event_type, LPARAM data);
67 void OnMediaChange(WPARAM wparam, LPARAM lparam);
65 68
66 // The window class of |window_|. 69 // The window class of |window_|.
67 ATOM window_class_; 70 ATOM window_class_;
68 71
69 // The handle of the module that contains the window procedure of |window_|. 72 // The handle of the module that contains the window procedure of |window_|.
70 HMODULE instance_; 73 HMODULE instance_;
71 HWND window_; 74 HWND window_;
72 75
76 // The handle of a registration for shell notifications.
77 ULONG shell_change_notify_id_;
78
73 // The volume mount point watcher, used to manage the mounted devices. 79 // The volume mount point watcher, used to manage the mounted devices.
74 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_; 80 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_;
75 81
76 // The portable device watcher, used to manage media transfer protocol 82 // The portable device watcher, used to manage media transfer protocol
77 // devices. 83 // devices.
78 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; 84 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_;
79 85
80 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); 86 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin);
81 }; 87 };
82 88
83 } // namespace storage_monitor 89 } // namespace storage_monitor
84 90
85 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ 91 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | components/storage_monitor/storage_monitor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698