| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void SetSystemPriority(); | 160 void SetSystemPriority(); |
| 161 | 161 |
| 162 // Delegate actions. | 162 // Delegate actions. |
| 163 void Display() const { delegate()->Display(); } | 163 void Display() const { delegate()->Display(); } |
| 164 void Error() const { delegate()->Error(); } | 164 void Error() const { delegate()->Error(); } |
| 165 bool HasClickedListener() const { return delegate()->HasClickedListener(); } | 165 bool HasClickedListener() const { return delegate()->HasClickedListener(); } |
| 166 void Click() const { delegate()->Click(); } | 166 void Click() const { delegate()->Click(); } |
| 167 void ButtonClick(int index) const { delegate()->ButtonClick(index); } | 167 void ButtonClick(int index) const { delegate()->ButtonClick(index); } |
| 168 void Close(bool by_user) const { delegate()->Close(by_user); } | 168 void Close(bool by_user) const { delegate()->Close(by_user); } |
| 169 | 169 |
| 170 // Helper method to create a simple System notification. |click_callback| |
| 171 // will be invoked when the notification is clicked. |
| 172 static scoped_ptr<Notification> CreateSystemNotification( |
| 173 const std::string& notification_id, |
| 174 const base::string16& title, |
| 175 const base::string16& message, |
| 176 const gfx::Image& icon, |
| 177 const base::Closure& click_callback); |
| 178 |
| 170 protected: | 179 protected: |
| 171 // The type of notification we'd like displayed. | 180 // The type of notification we'd like displayed. |
| 172 NotificationType type_; | 181 NotificationType type_; |
| 173 | 182 |
| 174 std::string id_; | 183 std::string id_; |
| 175 string16 title_; | 184 string16 title_; |
| 176 string16 message_; | 185 string16 message_; |
| 177 | 186 |
| 178 // Image data for the associated icon, used by Ash when available. | 187 // Image data for the associated icon, used by Ash when available. |
| 179 gfx::Image icon_; | 188 gfx::Image icon_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 191 bool is_expanded_; // True if this has been expanded in the message center. | 200 bool is_expanded_; // True if this has been expanded in the message center. |
| 192 | 201 |
| 193 // A proxy object that allows access back to the JavaScript object that | 202 // A proxy object that allows access back to the JavaScript object that |
| 194 // represents the notification, for firing events. | 203 // represents the notification, for firing events. |
| 195 scoped_refptr<NotificationDelegate> delegate_; | 204 scoped_refptr<NotificationDelegate> delegate_; |
| 196 }; | 205 }; |
| 197 | 206 |
| 198 } // namespace message_center | 207 } // namespace message_center |
| 199 | 208 |
| 200 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ | 209 #endif // UI_MESSAGE_CENTER_NOTIFICATION_H_ |
| OLD | NEW |