| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 void ArcNotificationItem::ButtonClick(int button_index) { | 269 void ArcNotificationItem::ButtonClick(int button_index) { |
| 270 manager_->SendNotificationButtonClickedOnChrome( | 270 manager_->SendNotificationButtonClickedOnChrome( |
| 271 notification_key_, button_index); | 271 notification_key_, button_index); |
| 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 { |
| 279 return manager_->IsOpeningSettingsSupported(); |
| 280 } |
| 281 |
| 278 // Converts from Android notification priority to Chrome notification priority. | 282 // Converts from Android notification priority to Chrome notification priority. |
| 279 // On Android, PRIORITY_DEFAULT does not pop up, so this maps PRIORITY_DEFAULT | 283 // On Android, PRIORITY_DEFAULT does not pop up, so this maps PRIORITY_DEFAULT |
| 280 // to Chrome's -1 to adapt that behavior. Also, this maps PRIORITY_LOW and _HIGH | 284 // to Chrome's -1 to adapt that behavior. Also, this maps PRIORITY_LOW and _HIGH |
| 281 // to -2 and 0 respectively to adjust the value with keeping the order among | 285 // to -2 and 0 respectively to adjust the value with keeping the order among |
| 282 // _LOW, _DEFAULT and _HIGH. | 286 // _LOW, _DEFAULT and _HIGH. |
| 283 // static | 287 // static |
| 284 int ArcNotificationItem::ConvertAndroidPriority(int android_priority) { | 288 int ArcNotificationItem::ConvertAndroidPriority(int android_priority) { |
| 285 switch (android_priority) { | 289 switch (android_priority) { |
| 286 case -2: // PRIORITY_MIN | 290 case -2: // PRIORITY_MIN |
| 287 case -1: // PRIORITY_LOW | 291 case -1: // PRIORITY_LOW |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 333 |
| 330 void ArcNotificationItem::OnImageDecoded(const SkBitmap& bitmap) { | 334 void ArcNotificationItem::OnImageDecoded(const SkBitmap& bitmap) { |
| 331 DCHECK(thread_checker_.CalledOnValidThread()); | 335 DCHECK(thread_checker_.CalledOnValidThread()); |
| 332 | 336 |
| 333 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmap); | 337 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmap); |
| 334 notification_->set_icon(image); | 338 notification_->set_icon(image); |
| 335 AddToMessageCenter(); | 339 AddToMessageCenter(); |
| 336 } | 340 } |
| 337 | 341 |
| 338 } // namespace arc | 342 } // namespace arc |
| OLD | NEW |