OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_H_ | 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_H_ |
6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_ | 6 #define UI_MESSAGE_CENTER_NOTIFICATION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 // Delegate actions. | 241 // Delegate actions. |
242 void Display() const { delegate()->Display(); } | 242 void Display() const { delegate()->Display(); } |
243 bool HasClickedListener() const { return delegate()->HasClickedListener(); } | 243 bool HasClickedListener() const { return delegate()->HasClickedListener(); } |
244 void Click() const { delegate()->Click(); } | 244 void Click() const { delegate()->Click(); } |
245 void ButtonClick(int index) const { delegate()->ButtonClick(index); } | 245 void ButtonClick(int index) const { delegate()->ButtonClick(index); } |
246 void Close(bool by_user) const { delegate()->Close(by_user); } | 246 void Close(bool by_user) const { delegate()->Close(by_user); } |
247 | 247 |
248 // Helper method to create a simple system notification. |click_callback| | 248 // Helper method to create a simple system notification. |click_callback| |
249 // will be invoked when the notification is clicked. | 249 // will be invoked when the notification is clicked. |
250 static scoped_ptr<Notification> CreateSystemNotification( | 250 static std::unique_ptr<Notification> CreateSystemNotification( |
251 const std::string& notification_id, | 251 const std::string& notification_id, |
252 const base::string16& title, | 252 const base::string16& title, |
253 const base::string16& message, | 253 const base::string16& message, |
254 const gfx::Image& icon, | 254 const gfx::Image& icon, |
255 const std::string& system_component_id, | 255 const std::string& system_component_id, |
256 const base::Closure& click_callback); | 256 const base::Closure& click_callback); |
257 | 257 |
258 protected: | 258 protected: |
259 Notification& operator=(const Notification& other); | 259 Notification& operator=(const Notification& other); |
260 | 260 |
(...skipping 27 matching lines...) Expand all Loading... |
288 bool is_read_; // True if this has been seen in the message center. | 288 bool is_read_; // True if this has been seen in the message center. |
289 | 289 |
290 // A proxy object that allows access back to the JavaScript object that | 290 // A proxy object that allows access back to the JavaScript object that |
291 // represents the notification, for firing events. | 291 // represents the notification, for firing events. |
292 scoped_refptr<NotificationDelegate> delegate_; | 292 scoped_refptr<NotificationDelegate> delegate_; |
293 }; | 293 }; |
294 | 294 |
295 } // namespace message_center | 295 } // namespace message_center |
296 | 296 |
297 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 297 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
OLD | NEW |