Index: content/browser/android/android_startup_observer.cc |
diff --git a/content/browser/android/android_startup_observer.cc b/content/browser/android/android_startup_observer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3608cbd6eb3c1ae269a0af84fddbf8d06704f639 |
--- /dev/null |
+++ b/content/browser/android/android_startup_observer.cc |
@@ -0,0 +1,28 @@ |
+// 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 "android_startup_observer.h" |
+ |
+#include "jni/StartupObserver_jni.h" |
+ |
+namespace content { |
+ |
+AndroidStartupObserver::AndroidStartupObserver(jobject java_observer) |
+ : java_observer_(java_observer) {} |
+ |
+void AndroidStartupObserver::AllTasksRun() { |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ Java_StartupObserver_allTasksRun(env, java_observer_); |
+} |
+ |
+bool AndroidStartupObserver::RegisterStartupObserver(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |
+ |
+AndroidStartupObserver::~AndroidStartupObserver() { |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ env->DeleteGlobalRef(java_observer_); |
+} |
+ |
+} // namespace content |