OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 #include "base/android/jni_android.h" |
| 6 #include "base/android/jni_string.h" |
| 7 |
| 8 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h" |
| 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_android.h" |
| 12 |
| 13 #include "jni/DomDistillerServiceFactory_jni.h" |
| 14 |
| 15 static jlong GetDomDistillerServiceForProfile(JNIEnv* env, |
| 16 jclass clazz, |
| 17 jobject j_profile) { |
| 18 Profile* nativeProfilePointer = ProfileAndroid::FromProfileAndroid(j_profile); |
| 19 dom_distiller::DomDistillerService* service = |
| 20 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
| 21 nativeProfilePointer); |
| 22 return reinterpret_cast<intptr_t>(service); |
| 23 } |
| 24 |
| 25 bool RegisterDomDistillerServiceFactory(JNIEnv* env) { |
| 26 return RegisterNativesImpl(env); |
| 27 } |
OLD | NEW |