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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_win.cc

Issue 16703025: [StorageMonitor] Move StorageMonitor ownership to BrowserProcessImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 5 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/storage_monitor/storage_monitor_win.h" 5 #include "chrome/browser/storage_monitor/storage_monitor_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <dbt.h> 8 #include <dbt.h>
9 #include <fileapi.h> 9 #include <fileapi.h>
10 10
11 #include "base/win/wrapped_window_proc.h" 11 #include "base/win/wrapped_window_proc.h"
12 #include "chrome/browser/storage_monitor/portable_device_watcher_win.h" 12 #include "chrome/browser/storage_monitor/portable_device_watcher_win.h"
13 #include "chrome/browser/storage_monitor/removable_device_constants.h" 13 #include "chrome/browser/storage_monitor/removable_device_constants.h"
14 #include "chrome/browser/storage_monitor/storage_info.h" 14 #include "chrome/browser/storage_monitor/storage_info.h"
15 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" 15 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h"
16 16
17 namespace chrome { 17 namespace chrome {
18 18
19 // StorageMonitorWin ------------------------------------------------------- 19 // StorageMonitorWin -------------------------------------------------------
20 20
21 // static
22 StorageMonitorWin* StorageMonitorWin::Create() {
23 return new StorageMonitorWin(new VolumeMountWatcherWin(),
24 new PortableDeviceWatcherWin());
25 }
26
27 StorageMonitorWin::StorageMonitorWin( 21 StorageMonitorWin::StorageMonitorWin(
28 VolumeMountWatcherWin* volume_mount_watcher, 22 VolumeMountWatcherWin* volume_mount_watcher,
29 PortableDeviceWatcherWin* portable_device_watcher) 23 PortableDeviceWatcherWin* portable_device_watcher)
30 : window_class_(0), 24 : window_class_(0),
31 instance_(NULL), 25 instance_(NULL),
32 window_(NULL), 26 window_(NULL),
33 volume_mount_watcher_(volume_mount_watcher), 27 volume_mount_watcher_(volume_mount_watcher),
34 portable_device_watcher_(portable_device_watcher) { 28 portable_device_watcher_(portable_device_watcher) {
35 DCHECK(volume_mount_watcher_); 29 DCHECK(volume_mount_watcher_);
36 DCHECK(portable_device_watcher_); 30 DCHECK(portable_device_watcher_);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // function when we have the functionality to add a sub directory of 154 // function when we have the functionality to add a sub directory of
161 // portable device as a media gallery. 155 // portable device as a media gallery.
162 return volume_mount_watcher_->GetDeviceInfo(device_path, info); 156 return volume_mount_watcher_->GetDeviceInfo(device_path, info);
163 } 157 }
164 158
165 void StorageMonitorWin::OnDeviceChange(UINT event_type, LPARAM data) { 159 void StorageMonitorWin::OnDeviceChange(UINT event_type, LPARAM data) {
166 volume_mount_watcher_->OnWindowMessage(event_type, data); 160 volume_mount_watcher_->OnWindowMessage(event_type, data);
167 portable_device_watcher_->OnWindowMessage(event_type, data); 161 portable_device_watcher_->OnWindowMessage(event_type, data);
168 } 162 }
169 163
164 StorageMonitor* StorageMonitor::Create() {
165 return new StorageMonitorWin(new VolumeMountWatcherWin(),
vandebo (ex-Chrome) 2013/07/10 16:57:45 Is this what you mean by the factory? Would makin
Greg Billock 2013/07/10 21:11:16 Yes, this is the windows factory impl. You mean ma
vandebo (ex-Chrome) 2013/07/11 15:53:00 The StorageMonitorWin constructor is currently pub
166 new PortableDeviceWatcherWin());
167 }
168
170 } // namespace chrome 169 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698