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

Unified Diff: chrome/browser/media_gallery/media_galleries_dialog_controller.cc

Issue 11573048: [Media Galleries] Move RemovableStorageInfo notifications to chrome namespace (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working on windows Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_gallery/media_galleries_dialog_controller.cc
diff --git a/chrome/browser/media_gallery/media_galleries_dialog_controller.cc b/chrome/browser/media_gallery/media_galleries_dialog_controller.cc
index a5aabbbce25a7a96992e94257fcb7aa12dc8e251..7fc9e5d9ecae50c01187131ae676c9e5aaa970b4 100644
--- a/chrome/browser/media_gallery/media_galleries_dialog_controller.cc
+++ b/chrome/browser/media_gallery/media_galleries_dialog_controller.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/media_gallery/media_file_system_registry.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/system_monitor/media_storage_util.h"
+#include "chrome/browser/system_monitor/removable_storage_notifications.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
@@ -28,8 +29,8 @@ bool IsAttachedDevice(const std::string& device_id) {
if (!MediaStorageUtil::IsRemovableDevice(device_id))
return false;
- std::vector<base::SystemMonitor::RemovableStorageInfo> removable_storages =
- base::SystemMonitor::Get()->GetAttachedRemovableStorage();
+ std::vector<RemovableStorageNotifications::StorageInfo> removable_storages =
+ RemovableStorageNotifications::GetInstance()->GetAttachedStorage();
for (size_t i = 0; i < removable_storages.size(); ++i) {
if (removable_storages[i].device_id == device_id)
return true;
@@ -54,9 +55,10 @@ MediaGalleriesDialogController::MediaGalleriesDialogController(
dialog_.reset(MediaGalleriesDialog::Create(this));
- base::SystemMonitor* monitor = base::SystemMonitor::Get();
- if (monitor)
- monitor->AddDevicesChangedObserver(this);
+ RemovableStorageNotifications* notifications =
+ RemovableStorageNotifications::GetInstance();
+ if (notifications)
+ notifications->AddObserver(this);
}
MediaGalleriesDialogController::MediaGalleriesDialogController()
@@ -65,9 +67,10 @@ MediaGalleriesDialogController::MediaGalleriesDialogController()
preferences_(NULL) {}
MediaGalleriesDialogController::~MediaGalleriesDialogController() {
- base::SystemMonitor* monitor = base::SystemMonitor::Get();
- if (monitor)
- monitor->RemoveDevicesChangedObserver(this);
+ RemovableStorageNotifications* notifications =
+ RemovableStorageNotifications::GetInstance();
+ if (notifications)
+ notifications->RemoveObserver(this);
if (select_folder_dialog_.get())
select_folder_dialog_->ListenerDestroyed();
@@ -204,15 +207,13 @@ void MediaGalleriesDialogController::FileSelected(const FilePath& path,
}
void MediaGalleriesDialogController::OnRemovableStorageAttached(
- const std::string& id,
- const string16& /*name*/,
- const FilePath::StringType& /*location*/) {
- UpdateGalleryOnDeviceEvent(id, true /* attached */);
+ const RemovableStorageNotifications::StorageInfo& info) {
+ UpdateGalleryOnDeviceEvent(info.device_id, true /* attached */);
}
void MediaGalleriesDialogController::OnRemovableStorageDetached(
- const std::string& id) {
- UpdateGalleryOnDeviceEvent(id, false /* detached */);
+ const RemovableStorageNotifications::StorageInfo& info) {
+ UpdateGalleryOnDeviceEvent(info.device_id, false /* detached */);
}
void MediaGalleriesDialogController::InitializePermissions() {
« no previous file with comments | « chrome/browser/media_gallery/media_galleries_dialog_controller.h ('k') | chrome/browser/system_monitor/media_storage_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698