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_notification_item.h" | 5 #include "ui/arc/notification/arc_notification_item.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 void ArcNotificationItem::OpenSettings() { | 274 void ArcNotificationItem::OpenSettings() { |
275 manager_->OpenNotificationSettings(notification_key_); | 275 manager_->OpenNotificationSettings(notification_key_); |
276 } | 276 } |
277 | 277 |
278 bool ArcNotificationItem::IsOpeningSettingsSupported() const { | 278 bool ArcNotificationItem::IsOpeningSettingsSupported() const { |
279 return manager_->IsOpeningSettingsSupported(); | 279 return manager_->IsOpeningSettingsSupported(); |
280 } | 280 } |
281 | 281 |
| 282 void ArcNotificationItem::ToggleExpansion() { |
| 283 manager_->SendNotificationToggleExpansionOnChrome(notification_key_); |
| 284 } |
| 285 |
282 // Converts from Android notification priority to Chrome notification priority. | 286 // Converts from Android notification priority to Chrome notification priority. |
283 // On Android, PRIORITY_DEFAULT does not pop up, so this maps PRIORITY_DEFAULT | 287 // On Android, PRIORITY_DEFAULT does not pop up, so this maps PRIORITY_DEFAULT |
284 // to Chrome's -1 to adapt that behavior. Also, this maps PRIORITY_LOW and _HIGH | 288 // to Chrome's -1 to adapt that behavior. Also, this maps PRIORITY_LOW and _HIGH |
285 // to -2 and 0 respectively to adjust the value with keeping the order among | 289 // to -2 and 0 respectively to adjust the value with keeping the order among |
286 // _LOW, _DEFAULT and _HIGH. | 290 // _LOW, _DEFAULT and _HIGH. |
287 // static | 291 // static |
288 int ArcNotificationItem::ConvertAndroidPriority(int android_priority) { | 292 int ArcNotificationItem::ConvertAndroidPriority(int android_priority) { |
289 switch (android_priority) { | 293 switch (android_priority) { |
290 case -2: // PRIORITY_MIN | 294 case -2: // PRIORITY_MIN |
291 case -1: // PRIORITY_LOW | 295 case -1: // PRIORITY_LOW |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 337 |
334 void ArcNotificationItem::OnImageDecoded(const SkBitmap& bitmap) { | 338 void ArcNotificationItem::OnImageDecoded(const SkBitmap& bitmap) { |
335 DCHECK(thread_checker_.CalledOnValidThread()); | 339 DCHECK(thread_checker_.CalledOnValidThread()); |
336 | 340 |
337 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmap); | 341 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmap); |
338 notification_->set_icon(image); | 342 notification_->set_icon(image); |
339 AddToMessageCenter(); | 343 AddToMessageCenter(); |
340 } | 344 } |
341 | 345 |
342 } // namespace arc | 346 } // namespace arc |
OLD | NEW |