summaryrefslogtreecommitdiffstats
path: root/android_webview/native/android_webview_jni_registrar.cc
blob: beb2fd8e52895700f3d257cd37af95e657f16d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "android_webview/native/android_webview_jni_registrar.h"

#include "android_webview/native/android_protocol_handler.h"
#include "android_webview/native/android_stream_reader_url_request_job.h"
#include "android_webview/native/aw_contents.h"
#include "android_webview/native/aw_contents_io_thread_client_impl.h"
#include "android_webview/native/aw_http_auth_handler.h"
#include "android_webview/native/aw_resource.h"
#include "android_webview/native/cookie_manager.h"
#include "android_webview/native/intercepted_request_data_impl.h"
#include "android_webview/native/js_result_handler.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "chrome/browser/component/navigation_interception/component_jni_registrar.h"
#include "chrome/browser/component/web_contents_delegate_android/component_jni_registrar.h"

namespace android_webview {

static base::android::RegistrationMethod kWebViewRegisteredMethods[] = {
  // Register JNI for components we depend on.
  { "navigation_interception", navigation_interception::RegisterJni },
  { "web_contents_delegate_android",
      web_contents_delegate_android::RegisterJni },
  // Register JNI for android_webview classes.
  { "AndroidProtocolHandler", RegisterAndroidProtocolHandler },
  { "AndroidStreamReaderUrlRequestJob",
      RegisterAndroidStreamReaderUrlRequestJob },
  { "AwContents", RegisterAwContents },
  { "AwContentsIoThreadClientImpl", RegisterAwContentsIoThreadClientImpl},
  { "AwHttpAuthHandler", RegisterAwHttpAuthHandler },
  { "AwResource", AwResource::RegisterAwResource },
  { "CookieManager", RegisterCookieManager },
  { "InterceptedRequestDataImpl", RegisterInterceptedRequestData },
  { "JsResultHandler", RegisterJsResultHandler },
};

bool RegisterJni(JNIEnv* env) {
  return RegisterNativeMethods(env,
      kWebViewRegisteredMethods, arraysize(kWebViewRegisteredMethods));
}

} // namespace android_webview