OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2015 The Android Open Source Project | 2 * Copyright (C) 2015 The Android Open Source Project |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
11 * distributed under the License is distributed on an "AS IS" BASIS, | 11 * distributed under the License is distributed on an "AS IS" BASIS, |
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 * See the License for the specific language governing permissions and | 13 * See the License for the specific language governing permissions and |
14 * limitations under the License. | 14 * limitations under the License. |
15 */ | 15 */ |
16 | 16 |
17 package android.support.customtabs; | 17 package android.support.customtabs; |
18 | 18 |
19 import android.net.Uri; | 19 import android.net.Uri; |
20 import android.os.Bundle; | 20 import android.os.Bundle; |
21 | 21 |
| 22 import org.chromium.base.annotations.SuppressFBWarnings; |
| 23 |
22 /** | 24 /** |
23 * A callback class for custom tabs client to get messages regarding events in t
heir custom tabs. In | 25 * A callback class for custom tabs client to get messages regarding events in t
heir custom tabs. In |
24 * the implementation, all callbacks are sent to the UI thread for the client. | 26 * the implementation, all callbacks are sent to the UI thread for the client. |
25 */ | 27 */ |
26 public class CustomTabsCallback { | 28 public class CustomTabsCallback { |
27 /** | 29 /** |
28 * Sent when the tab has started loading a page. | 30 * Sent when the tab has started loading a page. |
29 */ | 31 */ |
30 public static final int NAVIGATION_STARTED = 1; | 32 public static final int NAVIGATION_STARTED = 1; |
31 | 33 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 public void onNavigationEvent(int navigationEvent, Bundle extras) {} | 66 public void onNavigationEvent(int navigationEvent, Bundle extras) {} |
65 | 67 |
66 /** | 68 /** |
67 * Sent when {@link CustomTabsSession} has requested a postMessage channel t
hrough | 69 * Sent when {@link CustomTabsSession} has requested a postMessage channel t
hrough |
68 * {@link CustomTabsService#validatePostMessageOrigin(CustomTabsSessionToken
)} and the channel | 70 * {@link CustomTabsService#validatePostMessageOrigin(CustomTabsSessionToken
)} and the channel |
69 * is ready for sending and receiving messages on both ends. | 71 * is ready for sending and receiving messages on both ends. |
70 * @param origin The web origin that has been validated and will be used in
all messages coming | 72 * @param origin The web origin that has been validated and will be used in
all messages coming |
71 * from this {@link CustomTabsSession}. | 73 * from this {@link CustomTabsSession}. |
72 * @param extras Reserved for future use. | 74 * @param extras Reserved for future use. |
73 */ | 75 */ |
| 76 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") |
74 public synchronized void onMessageChannelReady(Uri origin, Bundle extras) {} | 77 public synchronized void onMessageChannelReady(Uri origin, Bundle extras) {} |
75 | 78 |
76 /** | 79 /** |
77 * Sent when a tab controlled by this {@link CustomTabsSession} has sent a p
ostMessage message. | 80 * Sent when a tab controlled by this {@link CustomTabsSession} has sent a p
ostMessage message. |
78 * If postMessage() is called from a single thread, then the messages will b
e posted in the same | 81 * If postMessage() is called from a single thread, then the messages will b
e posted in the same |
79 * order. When received on the client side, it is the client's responsibilit
y to preserve the | 82 * order. When received on the client side, it is the client's responsibilit
y to preserve the |
80 * ordering further. | 83 * ordering further. |
81 * | 84 * |
82 * @param message The message sent. | 85 * @param message The message sent. |
83 * @param extras Reserved for future use. | 86 * @param extras Reserved for future use. |
84 */ | 87 */ |
| 88 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") |
85 public synchronized void onPostMessage(String message, Bundle extras) {} | 89 public synchronized void onPostMessage(String message, Bundle extras) {} |
86 | 90 |
87 /** | 91 /** |
88 * Unsupported callbacks that may be provided by the implementation. | 92 * Unsupported callbacks that may be provided by the implementation. |
89 * | 93 * |
90 * <p> | 94 * <p> |
91 * <strong>Note:</strong>Clients should <strong>never</strong> rely on this
callback to be | 95 * <strong>Note:</strong>Clients should <strong>never</strong> rely on this
callback to be |
92 * called and/or to have a defined behavior, as it is entirely implementatio
n-defined and not | 96 * called and/or to have a defined behavior, as it is entirely implementatio
n-defined and not |
93 * supported. | 97 * supported. |
94 * | 98 * |
95 * <p> This can be used by implementations to add extra callbacks, for testi
ng or experimental | 99 * <p> This can be used by implementations to add extra callbacks, for testi
ng or experimental |
96 * purposes. | 100 * purposes. |
97 * | 101 * |
98 * @param callbackName Name of the extra callback. | 102 * @param callbackName Name of the extra callback. |
99 * @param args Arguments for the calback | 103 * @param args Arguments for the calback |
100 */ | 104 */ |
101 public void extraCallback(String callbackName, Bundle args) {} | 105 public void extraCallback(String callbackName, Bundle args) {} |
102 } | 106 } |
OLD | NEW |