| 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 "ui/message_center/message_center_export.h" | 15 #include "ui/message_center/message_center_export.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class RenderViewHost; | 18 class RenderViewHost; |
| 18 } | 19 } |
| 19 | 20 |
| 20 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 21 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
| 21 namespace views { | 22 namespace views { |
| 22 class View; | 23 class View; |
| 23 } | 24 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 // Returns true if the delegate can handle click event. | 42 // Returns true if the delegate can handle click event. |
| 42 virtual bool HasClickedListener(); | 43 virtual bool HasClickedListener(); |
| 43 | 44 |
| 44 // To be called when a desktop notification is clicked. | 45 // To be called when a desktop notification is clicked. |
| 45 virtual void Click(); | 46 virtual void Click(); |
| 46 | 47 |
| 47 // To be called when the user clicks a button in a notification. | 48 // To be called when the user clicks a button in a notification. |
| 48 virtual void ButtonClick(int button_index); | 49 virtual void ButtonClick(int button_index); |
| 49 | 50 |
| 51 // To be called when the user types a reply to a notification. |
| 52 virtual void ButtonClickWithReply(int button_index, |
| 53 const base::string16& reply); |
| 54 |
| 50 // To be called when the user clicks the settings button in a notification. | 55 // To be called when the user clicks the settings button in a notification. |
| 51 virtual void SettingsClick(); | 56 virtual void SettingsClick(); |
| 52 | 57 |
| 53 // To be called in order to detect if a settings button should be displayed. | 58 // To be called in order to detect if a settings button should be displayed. |
| 54 virtual bool ShouldDisplaySettingsButton(); | 59 virtual bool ShouldDisplaySettingsButton(); |
| 55 | 60 |
| 56 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 61 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
| 57 // To be called to construct the contents view of a popup for notifications | 62 // To be called to construct the contents view of a popup for notifications |
| 58 // whose type is NOTIFICATION_TYPE_CUSTOM. | 63 // whose type is NOTIFICATION_TYPE_CUSTOM. |
| 59 virtual std::unique_ptr<views::View> CreateCustomContent(); | 64 virtual std::unique_ptr<views::View> CreateCustomContent(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 113 |
| 109 private: | 114 private: |
| 110 ButtonClickCallback button_callback_; | 115 ButtonClickCallback button_callback_; |
| 111 | 116 |
| 112 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); | 117 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); |
| 113 }; | 118 }; |
| 114 | 119 |
| 115 } // namespace message_center | 120 } // namespace message_center |
| 116 | 121 |
| 117 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 122 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
| OLD | NEW |