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

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: Linting. 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
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 13 matching lines...) Expand all
24 public: 24 public:
25 // Should only be called by browser start up code. 25 // Should only be called by browser start up code.
26 // Use StorageMonitor::GetInstance() instead. 26 // Use StorageMonitor::GetInstance() instead.
27 // To support unit tests, this constructor takes |volume_mount_watcher| and 27 // To support unit tests, this constructor takes |volume_mount_watcher| and
28 // |portable_device_watcher| objects. These params are either constructed in 28 // |portable_device_watcher| objects. These params are either constructed in
29 // unit tests or in StorageMonitorWin CreateInternal() function. 29 // unit tests or in StorageMonitorWin CreateInternal() function.
30 StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher, 30 StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher,
31 PortableDeviceWatcherWin* portable_device_watcher); 31 PortableDeviceWatcherWin* portable_device_watcher);
32 virtual ~StorageMonitorWin(); 32 virtual ~StorageMonitorWin();
33 33
34 void ChangeNotifyRegister();
vandebo (ex-Chrome) 2014/04/11 22:24:26 Make private. RegisterForDeviceChangeNotification
Kevin Bailey 2014/04/22 15:43:03 Done, and proposed better name.
35
34 // Must be called after the file thread is created. 36 // Must be called after the file thread is created.
35 virtual void Init() OVERRIDE; 37 virtual void Init() OVERRIDE;
36 38
37 // StorageMonitor: 39 // StorageMonitor:
38 virtual bool GetStorageInfoForPath(const base::FilePath& path, 40 virtual bool GetStorageInfoForPath(const base::FilePath& path,
39 StorageInfo* device_info) const OVERRIDE; 41 StorageInfo* device_info) const OVERRIDE;
40 virtual bool GetMTPStorageInfoFromDeviceId( 42 virtual bool GetMTPStorageInfoFromDeviceId(
41 const std::string& storage_device_id, 43 const std::string& storage_device_id,
42 base::string16* device_location, 44 base::string16* device_location,
43 base::string16* storage_object_id) const OVERRIDE; 45 base::string16* storage_object_id) const OVERRIDE;
(...skipping 10 matching lines...) Expand all
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
66 void OnMediaChanged(WPARAM wparam, LPARAM lparam);
64 void OnDeviceChange(UINT event_type, LPARAM data); 67 void OnDeviceChange(UINT event_type, LPARAM data);
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
73 // The volume mount point watcher, used to manage the mounted devices. 76 // The volume mount point watcher, used to manage the mounted devices.
74 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_; 77 scoped_ptr<VolumeMountWatcherWin> volume_mount_watcher_;
75 78
76 // The portable device watcher, used to manage media transfer protocol 79 // The portable device watcher, used to manage media transfer protocol
77 // devices. 80 // devices.
78 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; 81 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_;
79 82
80 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); 83 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin);
81 }; 84 };
82 85
83 } // namespace storage_monitor 86 } // namespace storage_monitor
84 87
85 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ 88 #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') | components/storage_monitor/storage_monitor_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698