aw_form_database.cc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2013 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. #include "android_webview/browser/aw_browser_context.h"
  5. #include "android_webview/browser/aw_content_browser_client.h"
  6. #include "android_webview/browser/aw_form_database_service.h"
  7. #include "android_webview/browser_jni_headers/AwFormDatabase_jni.h"
  8. #include "base/android/jni_android.h"
  9. #include "base/time/time.h"
  10. using base::android::JavaParamRef;
  11. namespace android_webview {
  12. namespace {
  13. AwFormDatabaseService* GetFormDatabaseService() {
  14. AwBrowserContext* context = AwBrowserContext::GetDefault();
  15. AwFormDatabaseService* service = context->GetFormDatabaseService();
  16. return service;
  17. }
  18. } // anonymous namespace
  19. // static
  20. jboolean JNI_AwFormDatabase_HasFormData(JNIEnv*) {
  21. return GetFormDatabaseService()->HasFormData();
  22. }
  23. // static
  24. void JNI_AwFormDatabase_ClearFormData(JNIEnv*) {
  25. GetFormDatabaseService()->ClearFormData();
  26. }
  27. } // namespace android_webview