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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/desktop_notifications.h

Issue 23945002: file_manager: Move non-binding code to c/b/chromeos/file_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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/chromeos/extensions/file_manager/desktop_notifications.h
diff --git a/chrome/browser/chromeos/extensions/file_manager/desktop_notifications.h b/chrome/browser/chromeos/extensions/file_manager/desktop_notifications.h
deleted file mode 100644
index 40e9d3346b5d9d6f2fc5d40e4ceacfc8bfc01f7f..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/extensions/file_manager/desktop_notifications.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DESKTOP_NOTIFICATIONS_H_
-#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DESKTOP_NOTIFICATIONS_H_
-
-#include <map>
-#include <set>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/weak_ptr.h"
-#include "base/strings/string16.h"
-#include "base/time/time.h"
-
-class Profile;
-
-namespace file_manager {
-
-// The class is used for showing desktop notifications about activities of
-// Files.app, such as a new storage device getting detected.
-//
-// Note that updates for file transfers from/to Drive shown in the ash tray,
-// hence not handled in this class. See ash/system/drive/tray_drive.h for
-// details.
-class DesktopNotifications
- : public base::SupportsWeakPtr<DesktopNotifications> {
- public:
- // If changing the enum, please also update kNotificationTypes in .cc file.
- enum NotificationType {
- DEVICE,
- DEVICE_FAIL,
- DEVICE_EXTERNAL_STORAGE_DISABLED,
- FORMAT_START,
- FORMAT_START_FAIL,
- FORMAT_SUCCESS,
- FORMAT_FAIL,
- };
-
- explicit DesktopNotifications(Profile* profile);
- virtual ~DesktopNotifications();
-
- // Registers the removable device whose mount events will be handled in
- // |ManageNotificationsOnMountComplete|.
- void RegisterDevice(const std::string& system_path);
-
- // 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,
- bool is_parent,
- bool success,
- bool is_unsupported);
-
- // Primary method for showing a notification.
- void ShowNotification(NotificationType type, const std::string& path);
- void ShowNotificationDelayed(NotificationType type,
- const std::string& path,
- base::TimeDelta delay);
-
- // Primary method for hiding a notification. Virtual for mock in unittest.
- virtual void HideNotification(NotificationType type, const std::string& path);
- void HideNotificationDelayed(NotificationType type,
- const std::string& path,
- base::TimeDelta delay);
-
- 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;
-
- typedef std::map<std::string, MountRequestsInfo> MountRequestsMap;
- typedef std::map<std::string, NotificationMessage*> NotificationMap;
-
- // 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);
- void HideNotificationById(const std::string& notification_id);
- void RemoveNotificationById(const std::string& notification_id);
-
- NotificationMap notification_map_;
- std::set<std::string> hidden_notifications_;
- MountRequestsMap mount_requests_;
- Profile* profile_;
-
- DISALLOW_COPY_AND_ASSIGN(DesktopNotifications);
-};
-
-} // namespace file_manager
-
-#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_DESKTOP_NOTIFICATIONS_H_

Powered by Google App Engine
This is Rietveld 408576698