Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.browser.notifications; | |
| 6 | |
| 7 import org.chromium.base.BuildInfo; | |
| 8 import org.chromium.base.annotations.CalledByNative; | |
| 9 | |
| 10 /** | |
| 11 * Interface for native code to interact with Android notification channels. | |
| 12 */ | |
| 13 public class NotificationSettingsBridge { | |
| 14 @CalledByNative | |
|
Peter Beverloo
2017/05/15 15:10:08
nit: TODO w/ comment to remove once the the SDK ve
awdf
2017/05/16 15:17:35
Done.
| |
| 15 static boolean shouldUseChannelSettings() { | |
| 16 return BuildInfo.isAtLeastO(); | |
| 17 } | |
| 18 | |
| 19 /** | |
| 20 * Creates a notification channel for the given origin. | |
| 21 * @param origin The site origin to be used as the channel name. | |
| 22 * @param enabled True if the channel should be initially enabled, false if | |
| 23 * it should start off as blocked. | |
| 24 * @return true if the channel was successfully created, false otherwise. | |
| 25 */ | |
| 26 @CalledByNative | |
| 27 static boolean createChannel(String origin, boolean enabled) { | |
| 28 // TODO(crbug.com/700377) Actually construct a channel. | |
| 29 return false; | |
| 30 } | |
| 31 | |
| 32 @CalledByNative | |
| 33 static @NotificationChannelStatus int getChannelStatus(String origin) { | |
| 34 // TODO(crbug.com/700377) Actually check channel status. | |
| 35 return NotificationChannelStatus.UNAVAILABLE; | |
| 36 } | |
| 37 | |
| 38 @CalledByNative | |
| 39 static void deleteChannel(String origin) { | |
| 40 // TODO(crbug.com/700377) Actually delete channel. | |
| 41 } | |
| 42 } | |
| OLD | NEW |