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

Unified Diff: chrome/browser/ui/webui/filebrowse_ui.cc

Issue 6674043: Rewritten MountLibrary to work with non-blocking mount API calls in libcros.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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/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);
« chrome/browser/sessions/session_restore.cc ('K') | « chrome/browser/ui/browser_init.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698