| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/notifications/notification_conversion_helper.h" | 5 #include "chrome/browser/notifications/notification_conversion_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 GfxImageToNotificationBitmap(&rich_data->small_image, icon_mask.get()); | 46 GfxImageToNotificationBitmap(&rich_data->small_image, icon_mask.get()); |
| 47 options->app_icon_mask_bitmap = icon_mask.Pass(); | 47 options->app_icon_mask_bitmap = icon_mask.Pass(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 options->priority.reset(new int(rich_data->priority)); | 50 options->priority.reset(new int(rich_data->priority)); |
| 51 | 51 |
| 52 options->is_clickable.reset(new bool(rich_data->clickable)); | 52 options->is_clickable.reset(new bool(rich_data->clickable)); |
| 53 | 53 |
| 54 options->event_time.reset(new double(rich_data->timestamp.ToDoubleT())); | 54 options->event_time.reset(new double(rich_data->timestamp.ToDoubleT())); |
| 55 | 55 |
| 56 if (!rich_data->context_message.empty()) | 56 if (!rich_data->context_message.message.empty()) |
| 57 options->context_message.reset( | 57 options->context_message.reset( |
| 58 new std::string(base::UTF16ToUTF8(rich_data->context_message))); | 58 new std::string(base::UTF16ToUTF8(rich_data->context_message.message))); |
| 59 | 59 |
| 60 if (!rich_data->buttons.empty()) { | 60 if (!rich_data->buttons.empty()) { |
| 61 scoped_ptr<std::vector< | 61 scoped_ptr<std::vector< |
| 62 linked_ptr<extensions::api::notifications::NotificationButton> > > | 62 linked_ptr<extensions::api::notifications::NotificationButton> > > |
| 63 button_list(new std::vector< | 63 button_list(new std::vector< |
| 64 linked_ptr<extensions::api::notifications::NotificationButton> >); | 64 linked_ptr<extensions::api::notifications::NotificationButton> >); |
| 65 for (size_t i = 0; i < rich_data->buttons.size(); i++) { | 65 for (size_t i = 0; i < rich_data->buttons.size(); i++) { |
| 66 linked_ptr<extensions::api::notifications::NotificationButton> button( | 66 linked_ptr<extensions::api::notifications::NotificationButton> button( |
| 67 new extensions::api::notifications::NotificationButton); | 67 new extensions::api::notifications::NotificationButton); |
| 68 button->title = base::UTF16ToUTF8(rich_data->buttons[i].title); | 68 button->title = base::UTF16ToUTF8(rich_data->buttons[i].title); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return "image"; | 206 return "image"; |
| 207 case message_center::NOTIFICATION_TYPE_MULTIPLE: | 207 case message_center::NOTIFICATION_TYPE_MULTIPLE: |
| 208 return "list"; | 208 return "list"; |
| 209 case message_center::NOTIFICATION_TYPE_PROGRESS: | 209 case message_center::NOTIFICATION_TYPE_PROGRESS: |
| 210 return "progress"; | 210 return "progress"; |
| 211 default: | 211 default: |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 return ""; | 213 return ""; |
| 214 } | 214 } |
| 215 } | 215 } |
| OLD | NEW |