Simple Cache: a few tests for rare corner cases with CRC check missing.
[chromium-blink-merge.git] / ui / android / window_android.cc
blob1f2ccb2f97259dcf4b6456af86048385f7a24205
1 // Copyright (c) 2012 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.
5 #include "ui/android/window_android.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_helper.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "jni/WindowAndroid_jni.h"
12 namespace ui {
14 using base::android::AttachCurrentThread;
15 using base::android::ScopedJavaLocalRef;
17 WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj)
18 : weak_java_window_(env, obj) {
21 void WindowAndroid::Destroy(JNIEnv* env, jobject obj) {
22 delete this;
25 ScopedJavaLocalRef<jobject> WindowAndroid::GetJavaObject() {
26 return weak_java_window_.get(AttachCurrentThread());
29 bool WindowAndroid::RegisterWindowAndroid(JNIEnv* env) {
30 return RegisterNativesImpl(env);
33 WindowAndroid::~WindowAndroid() {
36 // ----------------------------------------------------------------------------
37 // Native JNI methods
38 // ----------------------------------------------------------------------------
40 jint Init(JNIEnv* env, jobject obj) {
41 WindowAndroid* window = new WindowAndroid(env, obj);
42 return reinterpret_cast<jint>(window);
45 } // namespace ui