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

Side by Side Diff: chrome/browser/system_monitor/media_device_notifications_chromeos.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: Rebase and add available_capacity into the observer callback 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
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 // chromeos::MediaDeviceNotifications implementation. 5 // chromeos::MediaDeviceNotifications implementation.
6 6
7 #include "chrome/browser/system_monitor/media_device_notifications_chromeos.h" 7 #include "chrome/browser/system_monitor/media_device_notifications_chromeos.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 } // namespace 41 } // namespace
42 42
43 using content::BrowserThread; 43 using content::BrowserThread;
44 44
45 MediaDeviceNotifications::MediaDeviceNotifications() { 45 MediaDeviceNotifications::MediaDeviceNotifications() {
46 DCHECK(disks::DiskMountManager::GetInstance()); 46 DCHECK(disks::DiskMountManager::GetInstance());
47 disks::DiskMountManager::GetInstance()->AddObserver(this); 47 disks::DiskMountManager::GetInstance()->AddObserver(this);
48 CheckExistingMountPointsOnUIThread(); 48 CheckExistingMountPointsOnUIThread();
49 if (base::SystemMonitor::Get())
50 base::SystemMonitor::Get()->set_storage_free_space_delegate(this);
vandebo (ex-Chrome) 2012/09/12 17:54:47 Since free space observer isn't really implemented
Hongbo Min 2012/09/13 13:40:53 Done.
49 } 51 }
50 52
51 MediaDeviceNotifications::~MediaDeviceNotifications() { 53 MediaDeviceNotifications::~MediaDeviceNotifications() {
54 if (base::SystemMonitor::Get())
vandebo (ex-Chrome) 2012/09/12 17:54:47 Since we're removing the delegate here, we'll need
Hongbo Min 2012/09/13 13:40:53 Done.
55 base::SystemMonitor::Get()->set_storage_free_space_delegate(NULL);
52 disks::DiskMountManager* manager = disks::DiskMountManager::GetInstance(); 56 disks::DiskMountManager* manager = disks::DiskMountManager::GetInstance();
53 if (manager) { 57 if (manager) {
54 manager->RemoveObserver(this); 58 manager->RemoveObserver(this);
55 } 59 }
56 } 60 }
57 61
58 void MediaDeviceNotifications::CheckExistingMountPointsOnUIThread() { 62 void MediaDeviceNotifications::CheckExistingMountPointsOnUIThread() {
59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
60 const disks::DiskMountManager::MountPointMap& mount_point_map = 64 const disks::DiskMountManager::MountPointMap& mount_point_map =
61 disks::DiskMountManager::GetInstance()->mount_points(); 65 disks::DiskMountManager::GetInstance()->mount_points();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 157
154 std::string device_id = chrome::MediaStorageUtil::MakeDeviceId( 158 std::string device_id = chrome::MediaStorageUtil::MakeDeviceId(
155 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id); 159 chrome::MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM, unique_id);
156 mount_map_.insert(std::make_pair(mount_info.mount_path, device_id)); 160 mount_map_.insert(std::make_pair(mount_info.mount_path, device_id));
157 base::SystemMonitor::Get()->ProcessRemovableStorageAttached( 161 base::SystemMonitor::Get()->ProcessRemovableStorageAttached(
158 device_id, 162 device_id,
159 device_label, 163 device_label,
160 mount_info.mount_path); 164 mount_info.mount_path);
161 } 165 }
162 166
167 bool MediaDeviceNotifications::IsWatchingStorage(const FilePath& path) {
168 NOTIMPLEMENTED();
169 return false;
170 }
171
172 void MediaDeviceNotifications::StartWatchingStorage(const FilePath& path) {
173 NOTIMPLEMENTED();
174 }
175
176 void MediaDeviceNotifications::StopWatchingStorage(const FilePath& path) {
177 NOTIMPLEMENTED();
178 }
179
163 } // namespace chrome 180 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698