| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/arc/notification/arc_custom_notification_item.h" | 5 #include "ui/arc/notification/arc_custom_notification_item.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 base::UTF8ToUTF16(data->title), base::UTF8ToUTF16(data->message), | 95 base::UTF8ToUTF16(data->title), base::UTF8ToUTF16(data->message), |
| 96 gfx::Image(), | 96 gfx::Image(), |
| 97 base::UTF8ToUTF16("arc"), // display source | 97 base::UTF8ToUTF16("arc"), // display source |
| 98 GURL(), // empty origin url, for system component | 98 GURL(), // empty origin url, for system component |
| 99 notifier_id, rich_data, new ArcNotificationDelegate(this)); | 99 notifier_id, rich_data, new ArcNotificationDelegate(this)); |
| 100 notification->set_timestamp(base::Time::FromJavaTime(data->time)); | 100 notification->set_timestamp(base::Time::FromJavaTime(data->time)); |
| 101 SetNotification(std::move(notification)); | 101 SetNotification(std::move(notification)); |
| 102 | 102 |
| 103 pinned_ = rich_data.pinned; | 103 pinned_ = rich_data.pinned; |
| 104 expand_state_ = data->expand_state; | 104 expand_state_ = data->expand_state; |
| 105 shown_contents_ = data->shown_contents; |
| 105 | 106 |
| 106 if (!data->snapshot_image || data->snapshot_image->isNull()) { | 107 if (!data->snapshot_image || data->snapshot_image->isNull()) { |
| 107 snapshot_ = gfx::ImageSkia(); | 108 snapshot_ = gfx::ImageSkia(); |
| 108 } else { | 109 } else { |
| 109 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( | 110 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( |
| 110 *data->snapshot_image, data->snapshot_image_scale)); | 111 *data->snapshot_image, data->snapshot_image_scale)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 for (auto& observer : observers_) | 114 for (auto& observer : observers_) |
| 114 observer.OnItemUpdated(); | 115 observer.OnItemUpdated(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 131 } | 132 } |
| 132 | 133 |
| 133 void ArcCustomNotificationItem::DecrementWindowRefCount() { | 134 void ArcCustomNotificationItem::DecrementWindowRefCount() { |
| 134 DCHECK_GT(window_ref_count_, 0); | 135 DCHECK_GT(window_ref_count_, 0); |
| 135 --window_ref_count_; | 136 --window_ref_count_; |
| 136 if (window_ref_count_ == 0) | 137 if (window_ref_count_ == 0) |
| 137 manager()->CloseNotificationWindow(notification_key()); | 138 manager()->CloseNotificationWindow(notification_key()); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace arc | 141 } // namespace arc |
| OLD | NEW |