Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: ui/arc/notification/arc_custom_notification_item.cc

Issue 2765923003: Extend notifications.mojom for expandable notifications. (Closed)
Patch Set: add Minversion to the enum Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/arc/notification/arc_custom_notification_item.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 message_center::NOTIFICATION_TYPE_CUSTOM, notification_id(), 94 message_center::NOTIFICATION_TYPE_CUSTOM, notification_id(),
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 105
105 if (!data->snapshot_image || data->snapshot_image->isNull()) { 106 if (!data->snapshot_image || data->snapshot_image->isNull()) {
106 snapshot_ = gfx::ImageSkia(); 107 snapshot_ = gfx::ImageSkia();
107 } else { 108 } else {
108 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( 109 snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep(
109 *data->snapshot_image, data->snapshot_image_scale)); 110 *data->snapshot_image, data->snapshot_image_scale));
110 } 111 }
111 112
112 for (auto& observer : observers_) 113 for (auto& observer : observers_)
113 observer.OnItemUpdated(); 114 observer.OnItemUpdated();
(...skipping 16 matching lines...) Expand all
130 } 131 }
131 132
132 void ArcCustomNotificationItem::DecrementWindowRefCount() { 133 void ArcCustomNotificationItem::DecrementWindowRefCount() {
133 DCHECK_GT(window_ref_count_, 0); 134 DCHECK_GT(window_ref_count_, 0);
134 --window_ref_count_; 135 --window_ref_count_;
135 if (window_ref_count_ == 0) 136 if (window_ref_count_ == 0)
136 manager()->CloseNotificationWindow(notification_key()); 137 manager()->CloseNotificationWindow(notification_key());
137 } 138 }
138 139
139 } // namespace arc 140 } // namespace arc
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_custom_notification_item.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698