Commit 07615e04 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

android: Remove manual jni registration in ui/

All generated RegisterNativesImpl functions are no-op already. Remove
all manual jni registration code in ui that calls these generated
RegisterNativesImpl calls.

TBR=garykac@chromium.org,zmo@chromium.org

Bug: 749244
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Iebbb9d91e5cc78d62b323113c5ccecd59a7311a8
Reviewed-on: https://chromium-review.googlesource.com/592333
Commit-Queue: Bo Liu <boliu@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491362}
parent 6817f5b0
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/form_field_data.h" #include "components/autofill/core/common/form_field_data.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util_android.h"
using autofill::AutofillWebDataService; using autofill::AutofillWebDataService;
using autofill::FormFieldData; using autofill::FormFieldData;
...@@ -32,7 +31,6 @@ class AwFormDatabaseServiceTest : public Test { ...@@ -32,7 +31,6 @@ class AwFormDatabaseServiceTest : public Test {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
env_ = AttachCurrentThread(); env_ = AttachCurrentThread();
ASSERT_TRUE(env_ != NULL); ASSERT_TRUE(env_ != NULL);
ASSERT_TRUE(l10n_util::RegisterLocalizationUtil(env_));
service_.reset(new AwFormDatabaseService(temp_dir_.GetPath())); service_.reset(new AwFormDatabaseService(temp_dir_.GetPath()));
} }
......
...@@ -18,11 +18,6 @@ ...@@ -18,11 +18,6 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "ui/gl/init/gl_factory.h" #include "ui/gl/init/gl_factory.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "ui/gl/android/gl_jni_registrar.h"
#endif
namespace { namespace {
int RunHelper(base::TestSuite* testSuite) { int RunHelper(base::TestSuite* testSuite) {
...@@ -44,9 +39,6 @@ int RunHelper(base::TestSuite* testSuite) { ...@@ -44,9 +39,6 @@ int RunHelper(base::TestSuite* testSuite) {
} // namespace } // namespace
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if defined(OS_ANDROID)
ui::gl::android::RegisterJni(base::android::AttachCurrentThread());
#endif
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
base::CommandLine::Init(argc, argv); base::CommandLine::Init(argc, argv);
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "base/android/jni_android.h" #include "base/android/jni_android.h"
#include "media/base/android/media_codec_util.h" #include "media/base/android/media_codec_util.h"
#include "media/base/android/media_jni_registrar.h" #include "media/base/android/media_jni_registrar.h"
#include "ui/gl/android/gl_jni_registrar.h"
#endif #endif
class TestSuiteNoAtExit : public base::TestSuite { class TestSuiteNoAtExit : public base::TestSuite {
...@@ -42,8 +41,6 @@ void TestSuiteNoAtExit::Initialize() { ...@@ -42,8 +41,6 @@ void TestSuiteNoAtExit::Initialize() {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// Register JNI bindings for android. // Register JNI bindings for android.
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
// Needed for surface texture support.
ui::gl::android::RegisterJni(env);
media::RegisterJni(env); media::RegisterJni(env);
......
...@@ -11,12 +11,10 @@ ...@@ -11,12 +11,10 @@
#include "net/android/net_jni_registrar.h" #include "net/android/net_jni_registrar.h"
#include "remoting/client/jni/remoting_jni_registrar.h" #include "remoting/client/jni/remoting_jni_registrar.h"
#include "remoting/client/remoting_jni_registration.h" #include "remoting/client/remoting_jni_registration.h"
#include "ui/gfx/android/gfx_jni_registrar.h"
namespace { namespace {
base::android::RegistrationMethod kRemotingRegisteredMethods[] = { base::android::RegistrationMethod kRemotingRegisteredMethods[] = {
{"gfx", gfx::android::RegisterJni},
{"net", net::android::RegisterJni}, {"net", net::android::RegisterJni},
{"remoting", remoting::RegisterJni}, {"remoting", remoting::RegisterJni},
}; };
......
...@@ -34,15 +34,12 @@ component("android") { ...@@ -34,15 +34,12 @@ component("android") {
"resources/resource.cc", "resources/resource.cc",
"resources/resource.h", "resources/resource.h",
"resources/resource_factory.cc", "resources/resource_factory.cc",
"resources/resource_factory.h",
"resources/resource_manager.h", "resources/resource_manager.h",
"resources/resource_manager_impl.cc", "resources/resource_manager_impl.cc",
"resources/resource_manager_impl.h", "resources/resource_manager_impl.h",
"resources/ui_resource_provider.h", "resources/ui_resource_provider.h",
"screen_android.h", "screen_android.h",
"ui_android_export.h", "ui_android_export.h",
"ui_android_jni_registrar.cc",
"ui_android_jni_registrar.h",
"view_android.cc", "view_android.cc",
"view_android.h", "view_android.h",
"view_client.cc", "view_client.cc",
......
...@@ -32,10 +32,6 @@ void SetScreenAndroid() { ...@@ -32,10 +32,6 @@ void SetScreenAndroid() {
Java_DisplayAndroidManager_onNativeSideCreated(env, (jlong)manager); Java_DisplayAndroidManager_onNativeSideCreated(env, (jlong)manager);
} }
bool RegisterScreenAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
DisplayAndroidManager::DisplayAndroidManager() {} DisplayAndroidManager::DisplayAndroidManager() {}
DisplayAndroidManager::~DisplayAndroidManager() {} DisplayAndroidManager::~DisplayAndroidManager() {}
......
...@@ -161,8 +161,4 @@ void EventForwarder::OnDragEvent(JNIEnv* env, ...@@ -161,8 +161,4 @@ void EventForwarder::OnDragEvent(JNIEnv* env,
view_->OnDragEvent(event); view_->OnDragEvent(event);
} }
bool RegisterEventForwarder(JNIEnv* env) {
return RegisterNativesImpl(env);
}
} // namespace ui } // namespace ui
...@@ -93,8 +93,6 @@ class EventForwarder { ...@@ -93,8 +93,6 @@ class EventForwarder {
DISALLOW_COPY_AND_ASSIGN(EventForwarder); DISALLOW_COPY_AND_ASSIGN(EventForwarder);
}; };
bool RegisterEventForwarder(JNIEnv* env);
} // namespace ui } // namespace ui
#endif // UI_ANDROID_EVENT_FORWARDER_H_ #endif // UI_ANDROID_EVENT_FORWARDER_H_
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/android/resources/resource_factory.h"
#include "jni/ResourceFactory_jni.h" #include "jni/ResourceFactory_jni.h"
#include "ui/android/resources/nine_patch_resource.h" #include "ui/android/resources/nine_patch_resource.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
...@@ -12,10 +10,6 @@ using base::android::JavaParamRef; ...@@ -12,10 +10,6 @@ using base::android::JavaParamRef;
namespace ui { namespace ui {
bool RegisterResourceFactory(JNIEnv* env) {
return RegisterNativesImpl(env);
}
jlong CreateBitmapResource(JNIEnv* env, const JavaParamRef<jclass>& clazz) { jlong CreateBitmapResource(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
return reinterpret_cast<intptr_t>(new Resource()); return reinterpret_cast<intptr_t>(new Resource());
} }
......
// Copyright 2017 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.
#ifndef UI_ANDROID_RESOURCES_RESOURCE_FACTORY_H_
#define UI_ANDROID_RESOURCES_RESOURCE_FACTORY_H_
#include "base/android/jni_android.h"
namespace ui {
bool RegisterResourceFactory(JNIEnv* env);
} // namespace ui
#endif // UI_ANDROID_RESOURCES_RESOURCE_FACTORY_H_
...@@ -233,11 +233,6 @@ bool ResourceManagerImpl::OnMemoryDump( ...@@ -233,11 +233,6 @@ bool ResourceManagerImpl::OnMemoryDump(
return true; return true;
} }
// static
bool ResourceManagerImpl::RegisterResourceManager(JNIEnv* env) {
return RegisterNativesImpl(env);
}
void ResourceManagerImpl::PreloadResourceFromJava(AndroidResourceType res_type, void ResourceManagerImpl::PreloadResourceFromJava(AndroidResourceType res_type,
int res_id) { int res_id) {
TRACE_EVENT2("ui", "ResourceManagerImpl::PreloadResourceFromJava", TRACE_EVENT2("ui", "ResourceManagerImpl::PreloadResourceFromJava",
......
...@@ -58,8 +58,6 @@ class UI_ANDROID_EXPORT ResourceManagerImpl ...@@ -58,8 +58,6 @@ class UI_ANDROID_EXPORT ResourceManagerImpl
void ClearTintedResourceCache(JNIEnv* env, void ClearTintedResourceCache(JNIEnv* env,
const base::android::JavaRef<jobject>& jobj); const base::android::JavaRef<jobject>& jobj);
static bool RegisterResourceManager(JNIEnv* env);
// base::trace_event::MemoryDumpProvider implementation. // base::trace_event::MemoryDumpProvider implementation.
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override; base::trace_event::ProcessMemoryDump* pmd) override;
......
...@@ -10,10 +10,8 @@ ...@@ -10,10 +10,8 @@
#include "base/test/launcher/unit_test_launcher.h" #include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/android/ui_android_jni_registrar.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#include "ui/gfx/android/gfx_jni_registrar.h"
namespace { namespace {
...@@ -25,9 +23,6 @@ class UIAndroidTestSuite : public base::TestSuite { ...@@ -25,9 +23,6 @@ class UIAndroidTestSuite : public base::TestSuite {
void Initialize() override { void Initialize() override {
base::TestSuite::Initialize(); base::TestSuite::Initialize();
gfx::android::RegisterJni(base::android::AttachCurrentThread());
ui::RegisterUIAndroidJni(base::android::AttachCurrentThread());
ui::RegisterPathProvider(); ui::RegisterPathProvider();
base::FilePath ui_test_pak_path; base::FilePath ui_test_pak_path;
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
namespace ui { namespace ui {
bool RegisterScreenAndroid(JNIEnv* env);
UI_ANDROID_EXPORT void SetScreenAndroid(); UI_ANDROID_EXPORT void SetScreenAndroid();
} // namespace display } // namespace display
......
// Copyright 2014 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 "ui/android/ui_android_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"
#include "ui/android/event_forwarder.h"
#include "ui/android/resources/resource_factory.h"
#include "ui/android/resources/resource_manager_impl.h"
#include "ui/android/screen_android.h"
#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
namespace ui {
static base::android::RegistrationMethod kAndroidRegisteredMethods[] = {
{"DisplayAndroidManager", ui::RegisterScreenAndroid},
{"EventForwarder", ui::RegisterEventForwarder},
{"ResourceFactory", ui::RegisterResourceFactory},
{"ResourceManager", ui::ResourceManagerImpl::RegisterResourceManager},
{"WindowAndroid", WindowAndroid::RegisterWindowAndroid},
};
bool RegisterUIAndroidJni(JNIEnv* env) {
return RegisterNativeMethods(env, kAndroidRegisteredMethods,
arraysize(kAndroidRegisteredMethods));
}
} // namespace ui
// Copyright 2014 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.
#ifndef UI_ANDROID_UI_ANDROID_JNI_REGISTRAR_H_
#define UI_ANDROID_UI_ANDROID_JNI_REGISTRAR_H_
#include <jni.h>
#include "ui/android/ui_android_export.h"
namespace ui {
// Register all JNI bindings necessary for chrome.
UI_ANDROID_EXPORT bool RegisterUIAndroidJni(JNIEnv* env);
} // namespace ui
#endif // UI_ANDROID_UI_ANDROID_JNI_REGISTRAR_H_
...@@ -131,10 +131,6 @@ ScopedJavaLocalRef<jobject> WindowAndroid::GetJavaObject() { ...@@ -131,10 +131,6 @@ ScopedJavaLocalRef<jobject> WindowAndroid::GetJavaObject() {
return base::android::ScopedJavaLocalRef<jobject>(java_window_); return base::android::ScopedJavaLocalRef<jobject>(java_window_);
} }
bool WindowAndroid::RegisterWindowAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
WindowAndroid::~WindowAndroid() { WindowAndroid::~WindowAndroid() {
DCHECK(parent_ == nullptr) << "WindowAndroid must be a root view."; DCHECK(parent_ == nullptr) << "WindowAndroid must be a root view.";
DCHECK(!compositor_); DCHECK(!compositor_);
......
...@@ -44,8 +44,6 @@ class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid { ...@@ -44,8 +44,6 @@ class UI_ANDROID_EXPORT WindowAndroid : public ViewAndroid {
base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
static bool RegisterWindowAndroid(JNIEnv* env);
// Compositor callback relay. // Compositor callback relay.
void OnCompositingDidCommit(); void OnCompositingDidCommit();
......
...@@ -67,8 +67,6 @@ component("base") { ...@@ -67,8 +67,6 @@ component("base") {
"accelerators/platform_accelerator.h", "accelerators/platform_accelerator.h",
"accelerators/platform_accelerator_cocoa.h", "accelerators/platform_accelerator_cocoa.h",
"accelerators/platform_accelerator_cocoa.mm", "accelerators/platform_accelerator_cocoa.mm",
"android/ui_base_jni_registrar.cc",
"android/ui_base_jni_registrar.h",
"class_property.cc", "class_property.cc",
"class_property.h", "class_property.h",
"clipboard/clipboard_android.cc", "clipboard/clipboard_android.cc",
......
// Copyright 2013 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 "ui/base/android/ui_base_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"
#include "ui/base/clipboard/clipboard_android.h"
#include "ui/base/l10n/l10n_util_android.h"
namespace ui {
namespace android {
static base::android::RegistrationMethod kUiRegisteredMethods[] = {
{"LocalizationUtils", l10n_util::RegisterLocalizationUtil},
{"ClipboardAndroid", ui::RegisterClipboardAndroid},
};
bool RegisterJni(JNIEnv* env) {
return RegisterNativeMethods(env, kUiRegisteredMethods,
arraysize(kUiRegisteredMethods));
}
} // namespace android
} // namespace ui
// Copyright 2013 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.
#ifndef UI_BASE_ANDROID_UI_BASE_JNI_REGISTRAR_H_
#define UI_BASE_ANDROID_UI_BASE_JNI_REGISTRAR_H_
#include <jni.h>
#include "ui/base/ui_base_export.h"
namespace ui {
namespace android {
// Register all JNI bindings necessary for chrome.
UI_BASE_EXPORT bool RegisterJni(JNIEnv* env);
} // namespace android
} // namespace ui
#endif // UI_BASE_ANDROID_UI_BASE_JNI_REGISTRAR_H_
...@@ -550,10 +550,6 @@ void ClipboardAndroid::WriteData(const Clipboard::FormatType& format, ...@@ -550,10 +550,6 @@ void ClipboardAndroid::WriteData(const Clipboard::FormatType& format,
g_map.Get().Set(format.ToString(), std::string(data_data, data_len)); g_map.Get().Set(format.ToString(), std::string(data_data, data_len));
} }
bool RegisterClipboardAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
// Returns a pointer to the current ClipboardAndroid object. // Returns a pointer to the current ClipboardAndroid object.
static jlong Init(JNIEnv* env, static jlong Init(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj) { const base::android::JavaParamRef<jobject>& obj) {
......
...@@ -87,9 +87,6 @@ class ClipboardAndroid : public Clipboard { ...@@ -87,9 +87,6 @@ class ClipboardAndroid : public Clipboard {
DISALLOW_COPY_AND_ASSIGN(ClipboardAndroid); DISALLOW_COPY_AND_ASSIGN(ClipboardAndroid);
}; };
// Registers the ClipboardAndroid native method.
bool RegisterClipboardAndroid(JNIEnv* env);
} // namespace ui } // namespace ui
#endif // UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ #endif // UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_
...@@ -108,8 +108,4 @@ ScopedJavaLocalRef<jstring> GetDurationString(JNIEnv* env, ...@@ -108,8 +108,4 @@ ScopedJavaLocalRef<jstring> GetDurationString(JNIEnv* env,
return jtime_remaining; return jtime_remaining;
} }
bool RegisterLocalizationUtil(JNIEnv* env) {
return RegisterNativesImpl(env);
}
} // namespace l10n_util } // namespace l10n_util
...@@ -20,8 +20,6 @@ UI_BASE_EXPORT base::string16 GetDisplayNameForLocale( ...@@ -20,8 +20,6 @@ UI_BASE_EXPORT base::string16 GetDisplayNameForLocale(
UI_BASE_EXPORT bool IsLayoutRtl(); UI_BASE_EXPORT bool IsLayoutRtl();
UI_BASE_EXPORT bool RegisterLocalizationUtil(JNIEnv* env);
} // namespace l10n_util } // namespace l10n_util
#endif // UI_BASE_L10N_L10N_UTIL_ANDROID_H_ #endif // UI_BASE_L10N_L10N_UTIL_ANDROID_H_
...@@ -13,12 +13,6 @@ ...@@ -13,12 +13,6 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "ui/base/android/ui_base_jni_registrar.h"
#include "ui/gfx/android/gfx_jni_registrar.h"
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS) #if defined(OS_MACOSX) && !defined(OS_IOS)
#include "base/mac/bundle_locations.h" #include "base/mac/bundle_locations.h"
#include "base/test/mock_chrome_application_mac.h" #include "base/test/mock_chrome_application_mac.h"
...@@ -53,12 +47,6 @@ void UIBaseTestSuite::Initialize() { ...@@ -53,12 +47,6 @@ void UIBaseTestSuite::Initialize() {
display::win::SetDefaultDeviceScaleFactor(1.0); display::win::SetDefaultDeviceScaleFactor(1.0);
#endif #endif
#if defined(OS_ANDROID)
// Register JNI bindings for android.
gfx::android::RegisterJni(base::android::AttachCurrentThread());
ui::android::RegisterJni(base::android::AttachCurrentThread());
#endif
ui::RegisterPathProvider(); ui::RegisterPathProvider();
base::FilePath exe_path; base::FilePath exe_path;
......
...@@ -19,10 +19,6 @@ using base::android::JavaParamRef; ...@@ -19,10 +19,6 @@ using base::android::JavaParamRef;
namespace ui { namespace ui {
bool InputDeviceObserverAndroid::RegisterInputDeviceObserver(JNIEnv* env) {
return RegisterNativesImpl(env);
}
InputDeviceObserverAndroid::InputDeviceObserverAndroid() {} InputDeviceObserverAndroid::InputDeviceObserverAndroid() {}
InputDeviceObserverAndroid::~InputDeviceObserverAndroid() {} InputDeviceObserverAndroid::~InputDeviceObserverAndroid() {}
...@@ -64,4 +60,4 @@ NOTIFY_OBSERVERS(NotifyObserversTouchpadDeviceConfigurationChanged(), ...@@ -64,4 +60,4 @@ NOTIFY_OBSERVERS(NotifyObserversTouchpadDeviceConfigurationChanged(),
NOTIFY_OBSERVERS(NotifyObserversKeyboardDeviceConfigurationChanged(), NOTIFY_OBSERVERS(NotifyObserversKeyboardDeviceConfigurationChanged(),
OnKeyboardDeviceConfigurationChanged()); OnKeyboardDeviceConfigurationChanged());
} // namespace ui } // namespace ui
\ No newline at end of file
...@@ -25,8 +25,6 @@ class EVENTS_DEVICES_EXPORT InputDeviceObserverAndroid { ...@@ -25,8 +25,6 @@ class EVENTS_DEVICES_EXPORT InputDeviceObserverAndroid {
static InputDeviceObserverAndroid* GetInstance(); static InputDeviceObserverAndroid* GetInstance();
~InputDeviceObserverAndroid(); ~InputDeviceObserverAndroid();
static bool RegisterInputDeviceObserver(JNIEnv* env);
void AddObserver(ui::InputDeviceEventObserver* observer); void AddObserver(ui::InputDeviceEventObserver* observer);
void RemoveObserver(ui::InputDeviceEventObserver* observer); void RemoveObserver(ui::InputDeviceEventObserver* observer);
......
...@@ -44,8 +44,6 @@ component("geometry_skia") { ...@@ -44,8 +44,6 @@ component("geometry_skia") {
component("gfx") { component("gfx") {
sources = [ sources = [
"android/gfx_jni_registrar.cc",
"android/gfx_jni_registrar.h",
"android/java_bitmap.cc", "android/java_bitmap.cc",
"android/java_bitmap.h", "android/java_bitmap.h",
"android/view_configuration.cc", "android/view_configuration.cc",
......
// Copyright (c) 2013 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 "ui/gfx/android/gfx_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"
#include "ui/gfx/android/view_configuration.h"
namespace gfx {
namespace android {
static base::android::RegistrationMethod kGfxRegisteredMethods[] = {
{ "ViewConfiguration", ViewConfiguration::RegisterViewConfiguration }
};
bool RegisterJni(JNIEnv* env) {
return RegisterNativeMethods(env, kGfxRegisteredMethods,
arraysize(kGfxRegisteredMethods));
}
} // namespace android
} // namespace gfx
// Copyright (c) 2013 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.
#ifndef UI_GFX_ANDROID_GFX_JNI_REGISTRAR_H_
#define UI_GFX_ANDROID_GFX_JNI_REGISTRAR_H_
#include <jni.h>
#include "ui/gfx/gfx_export.h"
namespace gfx {
namespace android {
// Register all JNI bindings necessary for chrome.
GFX_EXPORT bool RegisterJni(JNIEnv* env);
} // namespace android
} // namespace gfx
#endif // UI_GFX_ANDROID_GFX_JNI_REGISTRAR_H_
...@@ -175,8 +175,4 @@ int ViewConfiguration::GetMinScalingSpanInDips() { ...@@ -175,8 +175,4 @@ int ViewConfiguration::GetMinScalingSpanInDips() {
return g_view_configuration.Get().min_scaling_span_in_dips(); return g_view_configuration.Get().min_scaling_span_in_dips();
} }
bool ViewConfiguration::RegisterViewConfiguration(JNIEnv* env) {
return RegisterNativesImpl(env);
}
} // namespace gfx } // namespace gfx
...@@ -26,9 +26,6 @@ class GFX_EXPORT ViewConfiguration { ...@@ -26,9 +26,6 @@ class GFX_EXPORT ViewConfiguration {
static int GetDoubleTapSlopInDips(); static int GetDoubleTapSlopInDips();
static int GetMinScalingSpanInDips(); static int GetMinScalingSpanInDips();
// Registers methods with JNI and returns true if succeeded.
static bool RegisterViewConfiguration(JNIEnv* env);
}; };
} // namespace gfx } // namespace gfx
......
...@@ -13,11 +13,6 @@ ...@@ -13,11 +13,6 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "ui/gfx/android/gfx_jni_registrar.h"
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS) #if defined(OS_MACOSX) && !defined(OS_IOS)
#include "base/test/mock_chrome_application_mac.h" #include "base/test/mock_chrome_application_mac.h"
#endif #endif
...@@ -46,10 +41,6 @@ class GfxTestSuite : public base::TestSuite { ...@@ -46,10 +41,6 @@ class GfxTestSuite : public base::TestSuite {
void Initialize() override { void Initialize() override {
base::TestSuite::Initialize(); base::TestSuite::Initialize();
#if defined(OS_ANDROID)
gfx::android::RegisterJni(base::android::AttachCurrentThread());
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS) #if defined(OS_MACOSX) && !defined(OS_IOS)
mock_cr_app::RegisterMockCrApp(); mock_cr_app::RegisterMockCrApp();
#endif #endif
......
...@@ -45,8 +45,6 @@ component("gl") { ...@@ -45,8 +45,6 @@ component("gl") {
output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib. output_name = "gl_wrapper" # Avoid colliding with OS X"s libGL.dylib.
sources = [ sources = [
"android/gl_jni_registrar.cc",
"android/gl_jni_registrar.h",
"android/scoped_java_surface.cc", "android/scoped_java_surface.cc",
"android/scoped_java_surface.h", "android/scoped_java_surface.h",
"android/surface_texture.cc", "android/surface_texture.cc",
......
// Copyright (c) 2013 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 "ui/gl/android/gl_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"
#include "ui/gl/android/surface_texture_listener.h"
namespace ui {
namespace gl {
namespace android {
static base::android::RegistrationMethod kGLRegisteredMethods[] = {
{"SurfaceTextureListener",
::gl::SurfaceTextureListener::RegisterSurfaceTextureListener},
};
bool RegisterJni(JNIEnv* env) {
return RegisterNativeMethods(env, kGLRegisteredMethods,
arraysize(kGLRegisteredMethods));
}
} // namespace android
} // namespace gl
} // namespace ui
// Copyright (c) 2013 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.
#ifndef UI_GL_ANDROID_GL_JNI_REGISTRAR_H_
#define UI_GL_ANDROID_GL_JNI_REGISTRAR_H_
#include <jni.h>
#include "ui/gl/gl_export.h"
namespace ui {
namespace gl {
namespace android {
// Register all JNI bindings necessary for chrome.
GL_EXPORT bool RegisterJni(JNIEnv* env);
} // namespace android
} // namespace gl
} // namespace ui
#endif // UI_GL_ANDROID_GL_JNI_REGISTRAR_H_
...@@ -38,9 +38,4 @@ void SurfaceTextureListener::FrameAvailable(JNIEnv* env, ...@@ -38,9 +38,4 @@ void SurfaceTextureListener::FrameAvailable(JNIEnv* env,
} }
} }
// static
bool SurfaceTextureListener::RegisterSurfaceTextureListener(JNIEnv* env) {
return RegisterNativesImpl(env);
}
} // namespace gl } // namespace gl
...@@ -30,8 +30,6 @@ class GL_EXPORT SurfaceTextureListener { ...@@ -30,8 +30,6 @@ class GL_EXPORT SurfaceTextureListener {
void FrameAvailable(JNIEnv* env, void FrameAvailable(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj); const base::android::JavaParamRef<jobject>& obj);
static bool RegisterSurfaceTextureListener(JNIEnv* env);
private: private:
friend class base::DeleteHelper<SurfaceTextureListener>; friend class base::DeleteHelper<SurfaceTextureListener>;
......
...@@ -13,11 +13,6 @@ using base::android::ScopedJavaLocalRef; ...@@ -13,11 +13,6 @@ using base::android::ScopedJavaLocalRef;
namespace ui { namespace ui {
// static
bool PlatformImeControllerAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
PlatformImeControllerAndroid::PlatformImeControllerAndroid() { PlatformImeControllerAndroid::PlatformImeControllerAndroid() {
} }
......
...@@ -15,8 +15,6 @@ namespace ui { ...@@ -15,8 +15,6 @@ namespace ui {
class ANDROID_WINDOW_EXPORT PlatformImeControllerAndroid : class ANDROID_WINDOW_EXPORT PlatformImeControllerAndroid :
public PlatformImeController { public PlatformImeController {
public: public:
static bool Register(JNIEnv* env);
PlatformImeControllerAndroid(); PlatformImeControllerAndroid();
~PlatformImeControllerAndroid() override; ~PlatformImeControllerAndroid() override;
......
...@@ -49,11 +49,6 @@ ui::EventType MotionEventActionToEventType(jint action) { ...@@ -49,11 +49,6 @@ ui::EventType MotionEventActionToEventType(jint action) {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// PlatformWindowAndroid, public: // PlatformWindowAndroid, public:
// static
bool PlatformWindowAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
PlatformWindowAndroid::PlatformWindowAndroid(PlatformWindowDelegate* delegate) PlatformWindowAndroid::PlatformWindowAndroid(PlatformWindowDelegate* delegate)
: delegate_(delegate), : delegate_(delegate),
window_(NULL), window_(NULL),
......
...@@ -24,8 +24,6 @@ class PlatformWindowDelegate; ...@@ -24,8 +24,6 @@ class PlatformWindowDelegate;
class ANDROID_WINDOW_EXPORT PlatformWindowAndroid : public PlatformWindow { class ANDROID_WINDOW_EXPORT PlatformWindowAndroid : public PlatformWindow {
public: public:
static bool Register(JNIEnv* env);
explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate); explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate);
~PlatformWindowAndroid() override; ~PlatformWindowAndroid() override;
......
...@@ -51,8 +51,6 @@ component("shell_dialogs") { ...@@ -51,8 +51,6 @@ component("shell_dialogs") {
if (is_android && !use_aura) { if (is_android && !use_aura) {
sources += [ sources += [
"android/shell_dialogs_jni_registrar.cc",
"android/shell_dialogs_jni_registrar.h",
"select_file_dialog_android.cc", "select_file_dialog_android.cc",
"select_file_dialog_android.h", "select_file_dialog_android.h",
] ]
......
// Copyright (c) 2013 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 "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "base/macros.h"
#include "ui/shell_dialogs/select_file_dialog_android.h"
namespace ui {
namespace shell_dialogs {
static base::android::RegistrationMethod kUiRegisteredMethods[] = {
{ "SelectFileDialog", ui::SelectFileDialogImpl::RegisterSelectFileDialog },
};
bool RegisterJni(JNIEnv* env) {
return RegisterNativeMethods(env, kUiRegisteredMethods,
arraysize(kUiRegisteredMethods));
}
} // namespace shell_dialogs
} // namespace ui
// Copyright (c) 2013 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.
#ifndef UI_SHELL_DIALOGS_ANDROID_UI_SHELL_DIALOGS_JNI_REGISTRAR_H_
#define UI_SHELL_DIALOGS_ANDROID_UI_SHELL_DIALOGS_JNI_REGISTRAR_H_
#include <jni.h>
#include "ui/shell_dialogs/shell_dialogs_export.h"
namespace ui {
namespace shell_dialogs {
// Register all JNI bindings necessary for chrome.
SHELL_DIALOGS_EXPORT bool RegisterJni(JNIEnv* env);
} // namespace shell_dialogs
} // namespace ui
#endif // UI_SHELL_DIALOGS_ANDROID_UI_SHELL_DIALOGS_JNI_REGISTRAR_H_
...@@ -125,10 +125,6 @@ void SelectFileDialogImpl::SelectFileImpl( ...@@ -125,10 +125,6 @@ void SelectFileDialogImpl::SelectFileImpl(
owning_window->GetJavaObject()); owning_window->GetJavaObject());
} }
bool SelectFileDialogImpl::RegisterSelectFileDialog(JNIEnv* env) {
return RegisterNativesImpl(env);
}
SelectFileDialogImpl::~SelectFileDialogImpl() { SelectFileDialogImpl::~SelectFileDialogImpl() {
} }
......
...@@ -50,8 +50,6 @@ class SelectFileDialogImpl : public SelectFileDialog { ...@@ -50,8 +50,6 @@ class SelectFileDialogImpl : public SelectFileDialog {
gfx::NativeWindow owning_window, gfx::NativeWindow owning_window,
void* params) override; void* params) override;
static bool RegisterSelectFileDialog(JNIEnv* env);
protected: protected:
~SelectFileDialogImpl() override; ~SelectFileDialogImpl() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment