Chromium Code Reviews| Index: chrome/browser/chromeos/extensions/file_browser_notifications.h |
| diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications.h b/chrome/browser/chromeos/extensions/file_browser_notifications.h |
| index 1eb5496d91ef61835cb8363dcb280c75c66e7b83..8613f00a8b9427ca87ccdb25235f629af8a14fbf 100644 |
| --- a/chrome/browser/chromeos/extensions/file_browser_notifications.h |
| +++ b/chrome/browser/chromeos/extensions/file_browser_notifications.h |
| @@ -19,24 +19,27 @@ class Profile; |
| class FileBrowserNotifications |
| : public base::SupportsWeakPtr<FileBrowserNotifications> { |
| public: |
| + // If changing the enum, please also update kNotificationTypes in .cc file. |
| enum NotificationType { |
| DEVICE, |
| DEVICE_FAIL, |
| DEVICE_HARD_UNPLUG, |
| + DEVICE_EXTERNAL_STORAGE_DISABLED, |
| FORMAT_SUCCESS, |
| FORMAT_FAIL, |
| FORMAT_START, |
| FORMAT_START_FAIL, |
| - GDATA_SYNC, |
| - GDATA_SYNC_SUCCESS, |
| - GDATA_SYNC_FAIL, |
| }; |
| explicit FileBrowserNotifications(Profile* profile); |
| virtual ~FileBrowserNotifications(); |
| - void RegisterDevice(const std::string& path); |
| - void UnregisterDevice(const std::string& path); |
| + // Registers the removable device whose mount events will be handled in |
| + // |ManageNotificationsOnMountComplete|. |
| + void RegisterDevice(const std::string& system_path); |
|
stevenjb
2012/11/27 01:20:08
nit: blank line
|
| + // Unregisters the removable device whose mount events will be handled in |
| + // |ManageNotificationsOnMountComplete|. |
| + void UnregisterDevice(const std::string& system_path); |
| void ManageNotificationsOnMountCompleted(const std::string& system_path, |
| const std::string& label, |
| @@ -47,12 +50,8 @@ class FileBrowserNotifications |
| void ManageNotificationOnGDataSyncProgress(int count); |
| void ManageNotificationOnGDataSyncFinish(bool success); |
| - // Retreives message body based on |type|. |
| + // Primary method for showing a notification. |
| void ShowNotification(NotificationType type, const std::string& path); |
| - // Primary method for showing a notification. Virtual for mock in unittest. |
| - virtual void ShowNotificationWithMessage(NotificationType type, |
| - const std::string& path, |
| - const string16& message); |
| void ShowNotificationDelayed(NotificationType type, |
| const std::string& path, |
| base::TimeDelta delay); |
| @@ -66,10 +65,13 @@ class FileBrowserNotifications |
| size_t GetNotificationCountForTest() const { |
| return notification_map_.size(); |
| } |
| + |
| bool HasNotificationForTest(const std::string& id) const { |
| return notification_map_.find(id) != notification_map_.end(); |
| } |
| + string16 GetNotificationMessageForTest(const std::string& id) const; |
| + |
| private: |
| class NotificationMessage; |
| struct MountRequestsInfo; |
| @@ -77,8 +79,10 @@ class FileBrowserNotifications |
| typedef std::map<std::string, MountRequestsInfo> MountRequestsMap; |
| typedef std::map<std::string, NotificationMessage*> NotificationMap; |
| - std::string CreateNotificationId(NotificationType type, |
| - const std::string& path); |
| + // Virtual for mock in unittest. |
| + virtual void ShowNotificationWithMessage(NotificationType type, |
| + const std::string& path, |
| + const string16& message); |
| void ShowNotificationById(NotificationType type, |
| const std::string& notification_id, |
| const string16& message); |