| Index: chrome/browser/ui/webui/filebrowse_ui.cc
|
| ===================================================================
|
| --- chrome/browser/ui/webui/filebrowse_ui.cc (revision 78219)
|
| +++ chrome/browser/ui/webui/filebrowse_ui.cc (working copy)
|
| @@ -122,9 +122,11 @@
|
| virtual void RegisterMessages();
|
|
|
| #if defined(OS_CHROMEOS)
|
| - void MountChanged(chromeos::MountLibrary* obj,
|
| - chromeos::MountEventType evt,
|
| - const std::string& path);
|
| + // chromeos::MountLibrary::Observer interface
|
| + virtual void DiskChanged(chromeos::MountLibraryEventType event,
|
| + const chromeos::MountLibrary::Disk* disk);
|
| + virtual void DeviceChanged(chromeos::MountLibraryEventType event,
|
| + const std::string& device_path);
|
| #endif
|
|
|
| // DownloadItem::Observer interface
|
| @@ -553,14 +555,17 @@
|
| }
|
|
|
| #if defined(OS_CHROMEOS)
|
| -void FilebrowseHandler::MountChanged(chromeos::MountLibrary* obj,
|
| - chromeos::MountEventType evt,
|
| - const std::string& path) {
|
| - if (evt == chromeos::DISK_REMOVED ||
|
| - evt == chromeos::DISK_CHANGED) {
|
| +void FilebrowseHandler::DiskChanged(chromeos::MountLibraryEventType event,
|
| + const chromeos::MountLibrary::Disk* disk) {
|
| + if (event == chromeos::MOUNT_DISK_REMOVED ||
|
| + event == chromeos::MOUNT_DISK_CHANGED) {
|
| web_ui_->CallJavascriptFunction("rootsChanged");
|
| }
|
| }
|
| +
|
| +void FilebrowseHandler::DeviceChanged(chromeos::MountLibraryEventType event,
|
| + const std::string& device_path) {
|
| +}
|
| #endif
|
|
|
| void FilebrowseHandler::OnURLFetchComplete(const URLFetcher* source,
|
| @@ -585,15 +590,16 @@
|
| DictionaryValue info_value;
|
| // TODO(dhg): add other entries, make this more general
|
| #if defined(OS_CHROMEOS)
|
| - chromeos::MountLibrary* lib =
|
| - chromeos::CrosLibrary::Get()->GetMountLibrary();
|
| - const chromeos::MountLibrary::DiskVector& disks = lib->disks();
|
| -
|
| - for (size_t i = 0; i < disks.size(); ++i) {
|
| - if (!disks[i].mount_path.empty()) {
|
| + chromeos::MountLibrary* lib = chromeos::CrosLibrary::Get()->GetMountLibrary();
|
| + for (chromeos::MountLibrary::DiskMap::const_iterator iter =
|
| + lib->disks().begin();
|
| + iter != lib->disks().end();
|
| + ++iter) {
|
| + const chromeos::MountLibrary::Disk* disk = iter->second;
|
| + if (!disk->mount_path().empty()) {
|
| DictionaryValue* page_value = new DictionaryValue();
|
| - page_value->SetString(kPropertyPath, disks[i].mount_path);
|
| - FilePath currentpath(disks[i].mount_path);
|
| + page_value->SetString(kPropertyPath, disk->mount_path());
|
| + FilePath currentpath(disk->mount_path());
|
| std::string filename;
|
| filename = currentpath.BaseName().value();
|
| page_value->SetString(kPropertyTitle, filename);
|
|
|