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

Side by Side Diff: ui/message_center/notification_delegate.h

Issue 2547433002: Transfer responsibility for providing a close button for a notification to each implementation of M… (Closed)
Patch Set: WrapUnique -> MakeUnique Created 4 years 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 unified diff | Download patch
« no previous file with comments | « ui/message_center/BUILD.gn ('k') | ui/message_center/notification_delegate_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
18 namespace views { 18 #include "ui/message_center/views/custom_notification_content_view_delegate.h"
19 class View;
20 }
21 #endif 19 #endif
22 20
23 namespace message_center { 21 namespace message_center {
24 22
25 // 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
26 // methods for notification, and to provide an identity of the associated 24 // methods for notification, and to provide an identity of the associated
27 // notification. 25 // notification.
28 class MESSAGE_CENTER_EXPORT NotificationDelegate 26 class MESSAGE_CENTER_EXPORT NotificationDelegate
29 : public base::RefCountedThreadSafe<NotificationDelegate> { 27 : public base::RefCountedThreadSafe<NotificationDelegate> {
30 public: 28 public:
(...skipping 21 matching lines...) Expand all
52 50
53 // 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.
54 virtual void SettingsClick(); 52 virtual void SettingsClick();
55 53
56 // To be called in order to detect if a settings button should be displayed. 54 // To be called in order to detect if a settings button should be displayed.
57 virtual bool ShouldDisplaySettingsButton(); 55 virtual bool ShouldDisplaySettingsButton();
58 56
59 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) 57 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
60 // To be called to construct the contents view of a popup for notifications 58 // To be called to construct the contents view of a popup for notifications
61 // whose type is NOTIFICATION_TYPE_CUSTOM. 59 // whose type is NOTIFICATION_TYPE_CUSTOM.
62 virtual std::unique_ptr<views::View> CreateCustomContent(); 60 virtual std::unique_ptr<CustomContent> CreateCustomContent();
63 #endif 61 #endif
64 62
65 // Indicates whether this notification should be displayed when there is 63 // Indicates whether this notification should be displayed when there is
66 // fullscreen content being displayed. 64 // fullscreen content being displayed.
67 virtual bool ShouldDisplayOverFullscreen() const; 65 virtual bool ShouldDisplayOverFullscreen() const;
68 66
69 protected: 67 protected:
70 virtual ~NotificationDelegate() {} 68 virtual ~NotificationDelegate() {}
71 69
72 private: 70 private:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 109
112 private: 110 private:
113 ButtonClickCallback button_callback_; 111 ButtonClickCallback button_callback_;
114 112
115 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); 113 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate);
116 }; 114 };
117 115
118 } // namespace message_center 116 } // namespace message_center
119 117
120 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 118 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/message_center/BUILD.gn ('k') | ui/message_center/notification_delegate_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698