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

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: address the review comments 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
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 #include <tuple>
yoshiki 2016/12/06 05:28:27 Please remove this change.
yhanada 2016/12/06 06:41:26 Done.
10 11
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 #include "ui/message_center/message_center_export.h" 16 #include "ui/message_center/message_center_export.h"
16 17
17 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) 18 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
18 namespace views { 19 #include "ui/message_center/views/custom_notification_content_view_delegate.h"
19 class View;
20 }
21 #endif 20 #endif
22 21
23 namespace message_center { 22 namespace message_center {
24 23
25 // Delegate for a notification. This class has two roles: to implement callback 24 // Delegate for a notification. This class has two roles: to implement callback
26 // methods for notification, and to provide an identity of the associated 25 // methods for notification, and to provide an identity of the associated
27 // notification. 26 // notification.
28 class MESSAGE_CENTER_EXPORT NotificationDelegate 27 class MESSAGE_CENTER_EXPORT NotificationDelegate
29 : public base::RefCountedThreadSafe<NotificationDelegate> { 28 : public base::RefCountedThreadSafe<NotificationDelegate> {
30 public: 29 public:
(...skipping 21 matching lines...) Expand all
52 51
53 // To be called when the user clicks the settings button in a notification. 52 // To be called when the user clicks the settings button in a notification.
54 virtual void SettingsClick(); 53 virtual void SettingsClick();
55 54
56 // 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.
57 virtual bool ShouldDisplaySettingsButton(); 56 virtual bool ShouldDisplaySettingsButton();
58 57
59 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) 58 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
60 // To be called to construct the contents view of a popup for notifications 59 // To be called to construct the contents view of a popup for notifications
61 // whose type is NOTIFICATION_TYPE_CUSTOM. 60 // whose type is NOTIFICATION_TYPE_CUSTOM.
62 virtual std::unique_ptr<views::View> CreateCustomContent(); 61 virtual std::unique_ptr<CustomContent> CreateCustomContent();
63 #endif 62 #endif
64 63
65 // Indicates whether this notification should be displayed when there is 64 // Indicates whether this notification should be displayed when there is
66 // fullscreen content being displayed. 65 // fullscreen content being displayed.
67 virtual bool ShouldDisplayOverFullscreen() const; 66 virtual bool ShouldDisplayOverFullscreen() const;
68 67
69 protected: 68 protected:
70 virtual ~NotificationDelegate() {} 69 virtual ~NotificationDelegate() {}
71 70
72 private: 71 private:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 110
112 private: 111 private:
113 ButtonClickCallback button_callback_; 112 ButtonClickCallback button_callback_;
114 113
115 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); 114 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate);
116 }; 115 };
117 116
118 } // namespace message_center 117 } // namespace message_center
119 118
120 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 119 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698