OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 class NotificationManager : public NotificationManagerInterface, | 34 class NotificationManager : public NotificationManagerInterface, |
35 public extensions::AppIconLoader::Delegate { | 35 public extensions::AppIconLoader::Delegate { |
36 public: | 36 public: |
37 NotificationManager(Profile* profile, | 37 NotificationManager(Profile* profile, |
38 const ProvidedFileSystemInfo& file_system_info); | 38 const ProvidedFileSystemInfo& file_system_info); |
39 virtual ~NotificationManager(); | 39 virtual ~NotificationManager(); |
40 | 40 |
41 // NotificationManagerInterface overrides: | 41 // NotificationManagerInterface overrides: |
42 virtual void ShowUnresponsiveNotification( | 42 virtual void ShowUnresponsiveNotification( |
43 int id, | 43 int id, |
44 const NotificationCallback& callback) OVERRIDE; | 44 const NotificationCallback& callback) override; |
45 virtual void HideUnresponsiveNotification(int id) OVERRIDE; | 45 virtual void HideUnresponsiveNotification(int id) override; |
46 | 46 |
47 // Invoked when a button on the notification is clicked. | 47 // Invoked when a button on the notification is clicked. |
48 void OnButtonClick(int button_index); | 48 void OnButtonClick(int button_index); |
49 | 49 |
50 // Invoked when the notification failed to show up. | 50 // Invoked when the notification failed to show up. |
51 void OnError(); | 51 void OnError(); |
52 | 52 |
53 // Invoked when the notification got closed either by user or by system. | 53 // Invoked when the notification got closed either by user or by system. |
54 void OnClose(); | 54 void OnClose(); |
55 | 55 |
56 // extensions::AppIconLoader::Delegate overrides: | 56 // extensions::AppIconLoader::Delegate overrides: |
57 virtual void SetAppImage(const std::string& id, | 57 virtual void SetAppImage(const std::string& id, |
58 const gfx::ImageSkia& image) OVERRIDE; | 58 const gfx::ImageSkia& image) override; |
59 | 59 |
60 private: | 60 private: |
61 typedef std::map<int, NotificationCallback> CallbackMap; | 61 typedef std::map<int, NotificationCallback> CallbackMap; |
62 | 62 |
63 // Creates a notification object for the actual state of the manager. | 63 // Creates a notification object for the actual state of the manager. |
64 scoped_ptr<message_center::Notification> CreateNotification(); | 64 scoped_ptr<message_center::Notification> CreateNotification(); |
65 | 65 |
66 // Handles a notification result by calling all registered callbacks and | 66 // Handles a notification result by calling all registered callbacks and |
67 // clearing the list. | 67 // clearing the list. |
68 void OnNotificationResult(NotificationResult result); | 68 void OnNotificationResult(NotificationResult result); |
69 | 69 |
70 Profile* profile_; // Not owned. | 70 Profile* profile_; // Not owned. |
71 ProvidedFileSystemInfo file_system_info_; | 71 ProvidedFileSystemInfo file_system_info_; |
72 CallbackMap callbacks_; | 72 CallbackMap callbacks_; |
73 scoped_ptr<extensions::AppIconLoader> icon_loader_; | 73 scoped_ptr<extensions::AppIconLoader> icon_loader_; |
74 scoped_ptr<gfx::Image> extension_icon_; | 74 scoped_ptr<gfx::Image> extension_icon_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(NotificationManager); | 76 DISALLOW_COPY_AND_ASSIGN(NotificationManager); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace file_system_provider | 79 } // namespace file_system_provider |
80 } // namespace chromeos | 80 } // namespace chromeos |
81 | 81 |
82 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_NOTIFICATION_MANAGER_H_ |
OLD | NEW |