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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/arc/bitmap/bitmap_type_converters.h" | 10 #include "components/arc/bitmap/bitmap_type_converters.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 DCHECK(!data.message.is_null()); | 74 DCHECK(!data.message.is_null()); |
75 SetNotification(base::MakeUnique<message_center::Notification>( | 75 SetNotification(base::MakeUnique<message_center::Notification>( |
76 message_center::NOTIFICATION_TYPE_CUSTOM, notification_id(), | 76 message_center::NOTIFICATION_TYPE_CUSTOM, notification_id(), |
77 base::UTF8ToUTF16(data.title.get()), | 77 base::UTF8ToUTF16(data.title.get()), |
78 base::UTF8ToUTF16(data.message.get()), gfx::Image(), | 78 base::UTF8ToUTF16(data.message.get()), gfx::Image(), |
79 base::UTF8ToUTF16("arc"), // display source | 79 base::UTF8ToUTF16("arc"), // display source |
80 GURL(), // empty origin url, for system component | 80 GURL(), // empty origin url, for system component |
81 notifier_id, rich_data, new ArcNotificationDelegate(this))); | 81 notifier_id, rich_data, new ArcNotificationDelegate(this))); |
82 | 82 |
83 pinned_ = rich_data.pinned; | 83 pinned_ = rich_data.pinned; |
84 if (!data.accessible_name.is_null()) { | |
85 accessible_name_ = base::UTF8ToUTF16(data.accessible_name.get()); | |
yawano
2016/09/06 08:07:16
You will need to set empty string to accessible_na
yhanada
2016/09/06 10:15:01
Done.
| |
86 } | |
84 | 87 |
85 if (data.snapshot_image.is_null()) { | 88 if (data.snapshot_image.is_null()) { |
86 snapshot_ = gfx::ImageSkia(); | 89 snapshot_ = gfx::ImageSkia(); |
87 } else { | 90 } else { |
88 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( | 91 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( |
89 data.snapshot_image.To<SkBitmap>(), data.snapshot_image_scale)); | 92 data.snapshot_image.To<SkBitmap>(), data.snapshot_image_scale)); |
90 } | 93 } |
91 | 94 |
92 FOR_EACH_OBSERVER(Observer, observers_, OnItemUpdated()); | 95 FOR_EACH_OBSERVER(Observer, observers_, OnItemUpdated()); |
93 | 96 |
(...skipping 22 matching lines...) Expand all Loading... | |
116 } | 119 } |
117 | 120 |
118 void ArcCustomNotificationItem::DecrementWindowRefCount() { | 121 void ArcCustomNotificationItem::DecrementWindowRefCount() { |
119 DCHECK_GT(window_ref_count_, 0); | 122 DCHECK_GT(window_ref_count_, 0); |
120 --window_ref_count_; | 123 --window_ref_count_; |
121 if (window_ref_count_ == 0) | 124 if (window_ref_count_ == 0) |
122 manager()->CloseNotificationWindow(notification_key()); | 125 manager()->CloseNotificationWindow(notification_key()); |
123 } | 126 } |
124 | 127 |
125 } // namespace arc | 128 } // namespace arc |
OLD | NEW |