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

Unified Diff: chrome/browser/chromeos/extensions/file_browser_event_router.cc

Issue 9969148: Hide scanning notification when device with no media is detected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/imageburner/burn_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_browser_event_router.cc
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc
index d2820cf5b04912802b1db48c7244565d1b48a070..87c9dfae8948d849bafcb61420cb0f547c7c6f7d 100644
--- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc
@@ -311,6 +311,7 @@ void FileBrowserEventRouter::DispatchFolderChangeEvent(
}
}
+// TODO(tbarzic): This is not used anymore. Remove it.
void FileBrowserEventRouter::DispatchDiskEvent(
const DiskMountManager::Disk* disk, bool added) {
if (!profile_) {
@@ -411,11 +412,16 @@ void FileBrowserEventRouter::OnDiskAdded(
return;
}
- // If disk is not mounted yet, give it a try.
- if (disk->mount_path().empty()) {
+ // If disk is not mounted yet and it has media, give it a try.
+ if (disk->mount_path().empty() && disk->has_media()) {
// Initiate disk mount operation.
DiskMountManager::GetInstance()->MountPath(
disk->device_path(), chromeos::MOUNT_TYPE_DEVICE);
+ } else {
+ // Either the disk was mounted or it has no media. In both cases we don't
+ // want the Scanning notification to persist.
+ notifications_->HideNotification(FileBrowserNotifications::DEVICE,
+ disk->system_path_prefix());
}
DispatchDiskEvent(disk, true);
}
@@ -437,7 +443,7 @@ void FileBrowserEventRouter::OnDeviceAdded(
notifications_->RegisterDevice(device_path);
notifications_->ShowNotificationDelayed(FileBrowserNotifications::DEVICE,
device_path,
- 4000);
+ 5000);
}
void FileBrowserEventRouter::OnDeviceRemoved(
« no previous file with comments | « no previous file | chrome/browser/chromeos/imageburner/burn_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698