| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
| 6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "ui/message_center/message_center_export.h" | 15 #include "ui/message_center/message_center_export.h" |
| 16 | 16 |
| 17 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 17 namespace message_center { |
| 18 #include "ui/message_center/views/custom_notification_content_view_delegate.h" | |
| 19 #endif | |
| 20 | 18 |
| 21 namespace message_center { | 19 class MessageCenterController; |
| 20 class MessageView; |
| 21 class Notification; |
| 22 | 22 |
| 23 // Delegate for a notification. This class has two roles: to implement callback | 23 // Delegate for a notification. This class has two roles: to implement callback |
| 24 // methods for notification, and to provide an identity of the associated | 24 // methods for notification, and to provide an identity of the associated |
| 25 // notification. | 25 // notification. |
| 26 class MESSAGE_CENTER_EXPORT NotificationDelegate | 26 class MESSAGE_CENTER_EXPORT NotificationDelegate |
| 27 : public base::RefCountedThreadSafe<NotificationDelegate> { | 27 : public base::RefCountedThreadSafe<NotificationDelegate> { |
| 28 public: | 28 public: |
| 29 // To be called when the desktop notification is actually shown. | 29 // To be called when the desktop notification is actually shown. |
| 30 virtual void Display(); | 30 virtual void Display(); |
| 31 | 31 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 const base::string16& reply); | 49 const base::string16& reply); |
| 50 | 50 |
| 51 // To be called when the user clicks the settings button in a notification. | 51 // To be called when the user clicks the settings button in a notification. |
| 52 // Returns whether the settings click was handled by the delegate. | 52 // Returns whether the settings click was handled by the delegate. |
| 53 virtual bool SettingsClick(); | 53 virtual bool SettingsClick(); |
| 54 | 54 |
| 55 // To be called in order to detect if a settings button should be displayed. | 55 // To be called in order to detect if a settings button should be displayed. |
| 56 virtual bool ShouldDisplaySettingsButton(); | 56 virtual bool ShouldDisplaySettingsButton(); |
| 57 | 57 |
| 58 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 58 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
| 59 // To be called to construct the contents view of a popup for notifications | 59 // To be called to construct the message view for notifications whose type is |
| 60 // whose type is NOTIFICATION_TYPE_CUSTOM. | 60 // NOTIFICATION_TYPE_CUSTOM. |
| 61 virtual std::unique_ptr<CustomContent> CreateCustomContent(); | 61 virtual std::unique_ptr<MessageView> CreateCustomMessageView( |
| 62 MessageCenterController* controller, |
| 63 const Notification& notification); |
| 62 #endif | 64 #endif |
| 63 | 65 |
| 64 // Indicates whether this notification should be displayed when there is | 66 // Indicates whether this notification should be displayed when there is |
| 65 // fullscreen content being displayed. | 67 // fullscreen content being displayed. |
| 66 virtual bool ShouldDisplayOverFullscreen() const; | 68 virtual bool ShouldDisplayOverFullscreen() const; |
| 67 | 69 |
| 68 protected: | 70 protected: |
| 69 virtual ~NotificationDelegate() {} | 71 virtual ~NotificationDelegate() {} |
| 70 | 72 |
| 71 private: | 73 private: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 112 |
| 111 private: | 113 private: |
| 112 ButtonClickCallback button_callback_; | 114 ButtonClickCallback button_callback_; |
| 113 | 115 |
| 114 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace message_center | 119 } // namespace message_center |
| 118 | 120 |
| 119 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 121 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
| OLD | NEW |