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

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: Delete debug logs 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>
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)
19 #include "ui/message_center/views/custom_notification_content_view_delegate.h"
20 #endif
21
22 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
18 namespace views { 23 namespace views {
19 class View; 24 class View;
20 } 25 }
21 #endif 26 #endif
22 27
23 namespace message_center { 28 namespace message_center {
24 29
25 // Delegate for a notification. This class has two roles: to implement callback 30 // Delegate for a notification. This class has two roles: to implement callback
26 // methods for notification, and to provide an identity of the associated 31 // methods for notification, and to provide an identity of the associated
27 // notification. 32 // notification.
(...skipping 24 matching lines...) Expand all
52 57
53 // To be called when the user clicks the settings button in a notification. 58 // To be called when the user clicks the settings button in a notification.
54 virtual void SettingsClick(); 59 virtual void SettingsClick();
55 60
56 // To be called in order to detect if a settings button should be displayed. 61 // To be called in order to detect if a settings button should be displayed.
57 virtual bool ShouldDisplaySettingsButton(); 62 virtual bool ShouldDisplaySettingsButton();
58 63
59 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) 64 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
60 // To be called to construct the contents view of a popup for notifications 65 // To be called to construct the contents view of a popup for notifications
61 // whose type is NOTIFICATION_TYPE_CUSTOM. 66 // whose type is NOTIFICATION_TYPE_CUSTOM.
62 virtual std::unique_ptr<views::View> CreateCustomContent(); 67 virtual std::tuple<
68 std::unique_ptr<views::View>,
69 std::unique_ptr<message_center::CustomNotificationContentViewDelegate>>
70 CreateCustomContent();
63 #endif 71 #endif
64 72
65 // Indicates whether this notification should be displayed when there is 73 // Indicates whether this notification should be displayed when there is
66 // fullscreen content being displayed. 74 // fullscreen content being displayed.
67 virtual bool ShouldDisplayOverFullscreen() const; 75 virtual bool ShouldDisplayOverFullscreen() const;
68 76
69 protected: 77 protected:
70 virtual ~NotificationDelegate() {} 78 virtual ~NotificationDelegate() {}
71 79
72 private: 80 private:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 119
112 private: 120 private:
113 ButtonClickCallback button_callback_; 121 ButtonClickCallback button_callback_;
114 122
115 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); 123 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate);
116 }; 124 };
117 125
118 } // namespace message_center 126 } // namespace message_center
119 127
120 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ 128 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698