HttpAuthHandler.java revision a7f0ed46208bf1658624e22dc061e20e97d30481
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.webkit;
18
19import android.os.Handler;
20
21/**
22 * HTTP authentication request that must be handled by the user interface.
23 * WebView creates the object and hands it to the current {@link WebViewClient},
24 * which must call either {@link #proceed(String, String)} or {@link #cancel()}.
25 */
26public class HttpAuthHandler extends Handler {
27
28    /**
29     * Package-private constructor needed for API compatibility.
30     */
31    HttpAuthHandler() {
32    }
33
34    /**
35     * @return True if we can use user credentials on record
36     * (ie, if we did not fail trying to use them last time)
37     */
38    public boolean useHttpAuthUsernamePassword() {
39        return false;
40    }
41
42    /**
43     * Cancel the authorization request.
44     */
45    public void cancel() {
46    }
47
48    /**
49     * Proceed with the authorization with the given credentials.
50     */
51    public void proceed(String username, String password) {
52    }
53
54    /**
55     * return true if the prompt dialog should be suppressed.
56     * @hide
57     */
58    public boolean suppressDialog() {
59        return false;
60    }
61}
62