| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/android/callback_android.h" | 5 #include "base/android/callback_android.h" |
| 6 #include "base/android/scoped_java_ref.h" | 6 #include "base/android/scoped_java_ref.h" |
| 7 #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" | 7 #include "chrome/browser/android/offline_pages/background_scheduler_bridge.h" |
| 8 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" | 8 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
| 9 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" | 9 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "components/offline_pages/background/device_conditions.h" | 12 #include "components/offline_pages/background/device_conditions.h" |
| 13 #include "components/offline_pages/background/request_coordinator.h" | 13 #include "components/offline_pages/background/request_coordinator.h" |
| 14 #include "jni/BackgroundSchedulerBridge_jni.h" | 14 #include "jni/BackgroundSchedulerBridge_jni.h" |
| 15 | 15 |
| 16 using base::android::JavaParamRef; |
| 16 using base::android::ScopedJavaGlobalRef; | 17 using base::android::ScopedJavaGlobalRef; |
| 18 using base::android::ScopedJavaLocalRef; |
| 17 | 19 |
| 18 namespace offline_pages { | 20 namespace offline_pages { |
| 19 namespace android { | 21 namespace android { |
| 20 | 22 |
| 21 namespace { | 23 namespace { |
| 22 | 24 |
| 23 // C++ callback that delegates to Java callback. | 25 // C++ callback that delegates to Java callback. |
| 24 void ProcessingDoneCallback( | 26 void ProcessingDoneCallback( |
| 25 const ScopedJavaGlobalRef<jobject>& j_callback_obj, bool result) { | 27 const ScopedJavaGlobalRef<jobject>& j_callback_obj, bool result) { |
| 26 base::android::RunCallbackAndroid(j_callback_obj, result); | 28 base::android::RunCallbackAndroid(j_callback_obj, result); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 env, require_power_connected, minimum_battery_percentage, | 79 env, require_power_connected, minimum_battery_percentage, |
| 78 require_unmetered_network); | 80 require_unmetered_network); |
| 79 } | 81 } |
| 80 | 82 |
| 81 bool RegisterBackgroundSchedulerBridge(JNIEnv* env) { | 83 bool RegisterBackgroundSchedulerBridge(JNIEnv* env) { |
| 82 return RegisterNativesImpl(env); | 84 return RegisterNativesImpl(env); |
| 83 } | 85 } |
| 84 | 86 |
| 85 } // namespace android | 87 } // namespace android |
| 86 } // namespace offline_pages | 88 } // namespace offline_pages |
| OLD | NEW |