Home | History | Annotate | Download | only in chromium
      1 /*
      2  * Copyright (C) 2012 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 
     17 package com.android.webview.chromium;
     18 
     19 import android.content.Context;
     20 import android.webkit.WebViewDatabase;
     21 
     22 import org.chromium.android_webview.AwFormDatabase;
     23 import org.chromium.android_webview.HttpAuthDatabase;
     24 
     25 /**
     26  * Chromium implementation of WebViewDatabase -- forwards calls to the
     27  * chromium internal implementation.
     28  */
     29 final class WebViewDatabaseAdapter extends WebViewDatabase {
     30 
     31     private AwFormDatabase mFormDatabase;
     32     private HttpAuthDatabase mHttpAuthDatabase;
     33 
     34     public WebViewDatabaseAdapter(AwFormDatabase formDatabase, HttpAuthDatabase httpAuthDatabase) {
     35         mFormDatabase = formDatabase;
     36         mHttpAuthDatabase = httpAuthDatabase;
     37     }
     38 
     39     @Override
     40     public boolean hasUsernamePassword() {
     41         // This is a deprecated API: intentional no-op.
     42         return false;
     43     }
     44 
     45     @Override
     46     public void clearUsernamePassword() {
     47         // This is a deprecated API: intentional no-op.
     48     }
     49 
     50     @Override
     51     public boolean hasHttpAuthUsernamePassword() {
     52         return mHttpAuthDatabase.hasHttpAuthUsernamePassword();
     53     }
     54 
     55     @Override
     56     public void clearHttpAuthUsernamePassword() {
     57         mHttpAuthDatabase.clearHttpAuthUsernamePassword();
     58     }
     59 
     60     @Override
     61     public boolean hasFormData() {
     62         return mFormDatabase.hasFormData();
     63     }
     64 
     65     @Override
     66     public void clearFormData() {
     67         mFormDatabase.clearFormData();
     68     }
     69 }
     70